Skip to content

Commit c8d5830

Browse files
authored
Merge pull request NCAR#329 from mnlevy1981/updates_for_cesm3_workflow
Updates to CUPiD for CESM3 development runs
2 parents ab25df5 + 7fa8820 commit c8d5830

File tree

6 files changed

+37
-9
lines changed

6 files changed

+37
-9
lines changed

cime_config/config_tool.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,16 @@
247247
<default_value>FALSE</default_value>
248248
<group>cupid_run_components</group>
249249
<file>env_postprocessing.xml</file>
250-
<desc>Boolean value that determines whether or not ADF diagnostics are run (if CUPID_RUN_ALL is FALSE)</desc>
250+
<desc>Boolean value that determines whether or not ADF diagnostics are run</desc>
251+
</entry>
252+
253+
<entry id="CUPID_RUN_CVDP">
254+
<type>char</type>
255+
<valid_values>TRUE,FALSE</valid_values>
256+
<default_value>FALSE</default_value>
257+
<group>cupid_run_components</group>
258+
<file>env_postprocessing.xml</file>
259+
<desc>Boolean value that determines whether or not CVDP diagnostics are run (requires CUPID_RUN_ADF=TRUE)</desc>
251260
</entry>
252261

253262
<entry id="CUPID_RUN_LDF">
@@ -256,7 +265,7 @@
256265
<default_value>FALSE</default_value>
257266
<group>cupid_run_components</group>
258267
<file>env_postprocessing.xml</file>
259-
<desc>Boolean value that determines whether or not LDF diagnostics are run (if CUPID_RUN_ALL is FALSE)</desc>
268+
<desc>Boolean value that determines whether or not LDF diagnostics are run</desc>
260269
</entry>
261270

262271
<entry id="CUPID_RUN_ILAMB">

examples/key_metrics/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ compute_notebooks:
156156
obs_data_loc: /glade/campaign/cgd/amp/amwg/ADF_obs
157157
analysis_scripts: ["amwg_table"]
158158
diag_cvdp_info:
159-
cvdp_run: False # a bunch of warnings of convert being deprecated in IMv7 will be printed if turned on - will be fixed with CVDP update
159+
cvdp_run: False
160160
cvdp_tar: False
161161
regridded_output: False
162162
base_regridded_output: False

helper_scripts/cesm_postprocessing.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ CUPID_RUN_ICE=`./xmlquery --value CUPID_RUN_ICE`
3535
CUPID_RUN_ROF=`./xmlquery --value CUPID_RUN_ROF`
3636
CUPID_RUN_GLC=`./xmlquery --value CUPID_RUN_GLC`
3737
CUPID_RUN_ADF=`./xmlquery --value CUPID_RUN_ADF`
38+
CUPID_RUN_CVDP=`./xmlquery --value CUPID_RUN_CVDP`
3839
CUPID_RUN_LDF=`./xmlquery --value CUPID_RUN_LDF`
3940
CUPID_RUN_ILAMB=`./xmlquery --value CUPID_RUN_ILAMB`
4041
CUPID_RUN_TYPE=`./xmlquery --value CUPID_RUN_TYPE`
@@ -115,7 +116,19 @@ fi
115116
conda activate ${CUPID_INFRASTRUCTURE_ENV}
116117

117118
# 1. Generate CUPiD config file
119+
if [ "${CUPID_RUN_CVDP}" == "TRUE" ]; then
120+
if [ "${CUPID_RUN_ADF}" != "TRUE" ]; then
121+
echo "ERROR: CUPID_RUN_CVDP=TRUE but CUPID_RUN_ADF=${CUPID_RUN_ADF}. CVDP is run by"
122+
echo "the ADF, so that combination of flags will result in CVDP not being run."
123+
echo "Either set CUPID_RUN_ADF=TRUE or CUPID_RUN_CVDP=FALSE"
124+
exit 1
125+
fi
126+
CVDP_OPT="--run-cvdp"
127+
else
128+
CVDP_OPT=""
129+
fi
118130
${CUPID_ROOT}/helper_scripts/generate_cupid_config_for_cesm_case.py \
131+
${CVDP_OPT} \
119132
--case-root ${CASEROOT} \
120133
--cesm-root ${SRCROOT} \
121134
--cupid-root ${CUPID_ROOT} \

helper_scripts/generate_cupid_config_for_cesm_case.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
default=None,
7171
help="Boolean flag to indicate whether to run ILAMB analysis",
7272
)
73+
@click.option("--run-cvdp", is_flag=True, default=False, help="Run CVDP diagnostics")
7374
def generate_cupid_config(
7475
case_root,
7576
cesm_root,
@@ -88,6 +89,7 @@ def generate_cupid_config(
8889
cupid_run_adf,
8990
cupid_run_ldf,
9091
cupid_run_ilamb,
92+
run_cvdp,
9193
):
9294
"""
9395
Generate a CUPiD `config.yml` file based on information from a CESM case and
@@ -210,9 +212,7 @@ def generate_cupid_config(
210212
my_dict = yaml.safe_load(f)
211213

212214
my_dict["data_sources"]["nb_path_root"] = os.path.join(
213-
cesm_root,
214-
"tools",
215-
"CUPiD",
215+
cupid_root,
216216
"nblibrary",
217217
)
218218
my_dict["global_params"]["case_name"] = case
@@ -291,7 +291,13 @@ def generate_cupid_config(
291291
my_dict["compute_notebooks"]["atm"]["ADF"]["parameter_groups"]["none"][
292292
"adf_root"
293293
] = os.path.join(adf_output_root, "ADF_output")
294-
294+
if "diag_cvdp_info" in my_dict["compute_notebooks"]["atm"]["ADF"].get(
295+
"external_tool",
296+
{},
297+
):
298+
my_dict["compute_notebooks"]["atm"]["ADF"]["external_tool"][
299+
"diag_cvdp_info"
300+
]["cvdp_run"] = run_cvdp
295301
if "CVDP" in my_dict["compute_notebooks"].get("atm", {}):
296302
my_dict["compute_notebooks"]["atm"]["CVDP"]["parameter_groups"]["none"][
297303
"cvdp_loc"

nblibrary/atm/ADF.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
" adf_root = adf_root_candidate\n",
178178
" display(\n",
179179
" HTML(\n",
180-
" f'<a href=\"./ADF/{adf_comparison_name}/website/index.html\" target=\"_blank\" style=\"font-size: 30px\">Full ADF output</a>'\n",
180+
" f'<a href=\"../ADF/{adf_comparison_name}/website/index.html\" target=\"_blank\" style=\"font-size: 30px\">Full ADF output</a>'\n",
181181
" )\n",
182182
" )\n",
183183
" break\n",

nblibrary/lnd/LDF.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
" ldf_root = ldf_root_candidate\n",
166166
" display(\n",
167167
" HTML(\n",
168-
" f'<a href=\"./LDF/{ldf_comparison_name}/website/index.html\" target=\"_blank\" style=\"font-size: 30px\">Full LDF output</a>'\n",
168+
" f'<a href=\"../LDF/{ldf_comparison_name}/website/index.html\" target=\"_blank\" style=\"font-size: 30px\">Full LDF output</a>'\n",
169169
" )\n",
170170
" )\n",
171171
" break\n",

0 commit comments

Comments
 (0)