Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance multiple case diagnostics #229

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
23 changes: 23 additions & 0 deletions config_cam_baseline_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ diag_cam_climo:
#Name of CAM case (or CAM run name):
cam_case_name: b.e20.BHIST.f09_g17.20thC.297_05

#Case nickname
#If left blank, it will default to cam_case_name
justin-richling marked this conversation as resolved.
Show resolved Hide resolved
# ** NOTE: if nickname starts with a zero, the string must be in quotes! **
case_nickname: ${diag_cam_climo.cam_case_name}

#Location of CAM history (h0) files:
#Example test files
cam_hist_loc: /glade/p/cesm/ADF/${diag_cam_climo.cam_case_name}
Expand Down Expand Up @@ -201,6 +206,10 @@ diag_cam_climo:
# - b.e20.BHIST.f09_g17.20thC.297_05
# - b1850.f19_g17.validation_mct.004

#case_nickname:
# - nickname 1
# - "026c"

#calc_cam_climo:
# - true
# - true
Expand Down Expand Up @@ -259,6 +268,11 @@ diag_cam_baseline_climo:
#Name of CAM baseline case:
cam_case_name: b.e20.BHIST.f09_g16.20thC.125.02

#Case nickname
#If left blank, it will default to baseline cam_case_name
justin-richling marked this conversation as resolved.
Show resolved Hide resolved
# ** NOTE: if nickname starts with a zero, the string must be in quotes! **
case_nickname: ${diag_cam_baseline_climo.cam_case_name}

#Location of CAM baseline history (h0) files:
#Example test files
cam_hist_loc: /glade/p/cesm/ADF/${diag_cam_baseline_climo.cam_case_name}
Expand Down Expand Up @@ -377,6 +391,15 @@ diag_var_list:

#<Add more variables here.>

# Make mulit-plot comparison image for specified plots types
# This will only run if there are more than one specified test cases declared above
# NOTE: These plot types also need to be present above in the plotting_scripts section (for now) and variables in the diag_var_list
# NOTE: Only global LatLon multi-case plots are available at this time - more are coming. JR
multi_case_plots:
global_latlon_map:
- SST
- PSL

# Options for multi-case regional contour plots (./plotting/regional_map_multicase.py)
# region_multicase:
# region_spec: [slat, nlat, wlon, elon]
Expand Down
13 changes: 13 additions & 0 deletions lib/adf_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def __init__(self, config_file, debug=False):
self.expand_references(self.__cvdp_info)
#End if

#Add multi plots info to object:
self.__multi_case_plots = self.read_config_var('multi_case_plots')

#Add averaging script names:
self.__time_averaging_scripts = self.read_config_var('time_averaging_scripts')

Expand Down Expand Up @@ -197,6 +200,16 @@ def get_cvdp_info(self, var_str, required=False):
conf_dict=self.__cvdp_info,
required=required)

def get_multi_case_info(self, var_str, required=False):
"""
Return the config variable from 'multi_case_plots' as requested by
the user.
"""

return self.read_config_var(var_str,
conf_dict=self.__multi_case_plots,
required=required)

#########
#Script-running functions
#########
Expand Down
Loading