From b710f9f87e12085c86e48b797c31e5fad1b35d35 Mon Sep 17 00:00:00 2001 From: kdraeder Date: Wed, 2 Feb 2022 20:07:24 -0700 Subject: [PATCH 1/3] Remove a spurious _ from CAM's fv_div24del2flag --- models/cam-fv/shell_scripts/cesm2_1/setup_advanced | 2 +- models/cam-fv/shell_scripts/cesm2_1/setup_hybrid | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/cam-fv/shell_scripts/cesm2_1/setup_advanced b/models/cam-fv/shell_scripts/cesm2_1/setup_advanced index 35e384de73..e245b9f7a5 100755 --- a/models/cam-fv/shell_scripts/cesm2_1/setup_advanced +++ b/models/cam-fv/shell_scripts/cesm2_1/setup_advanced @@ -895,7 +895,7 @@ while ($inst <= $num_instances) # echo " mfilt = 1 " >> ${fname} echo $CAM_CONFIG_OPTS | grep 'cam4' - if ($status == 0) echo " fv_div24del2_flag = 4 " >> ${fname} + if ($status == 0) echo " fv_div24del2flag = 4 " >> ${fname} # Settings that differ between regular CAM and the WACCM version: diff --git a/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid b/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid index 62fd5200b6..20ffa142c2 100755 --- a/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid +++ b/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid @@ -860,7 +860,7 @@ while ($inst <= $num_instances) # echo " mfilt = 1 " >> ${fname} echo $CAM_CONFIG_OPTS | grep 'cam4' - if ($status == 0) echo " fv_div24del2_flag = 4 " >> ${fname} + if ($status == 0) echo " fv_div24del2flag = 4 " >> ${fname} # Settings that differ between regular CAM and the WACCM version: From 8c29b618ce97b696d24850ebe8f2d7d2d53df639 Mon Sep 17 00:00:00 2001 From: kdraeder Date: Wed, 16 Aug 2023 07:38:49 -0600 Subject: [PATCH 2/3] Small independent upgrades to cam-fv shell scripts shell_scripts/cesm2_1/ assimilate.csh.template Avoid listing files if the CAM_PHIS file already exists. setup_advanced setup_hybrid Define a TMPDIR that's not the default /var/tmp. Changing CIME_OUTPUT_ROOT changes RUNDIR, so define RUNDIR after CIME_OUTPUT_ROOT. Check for existence of inflation files. --- .../cesm2_1/assimilate.csh.template | 9 +++++---- .../shell_scripts/cesm2_1/setup_advanced | 20 ++++++++++++++++++- .../cam-fv/shell_scripts/cesm2_1/setup_hybrid | 20 ++++++++++++++++++- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template b/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template index 855f990c43..150e33ec99 100644 --- a/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template +++ b/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template @@ -530,13 +530,14 @@ ${REMOVE} ${CAMINPUT} ${LINK} ${CASE}.cam_0001.i.${ATM_DATE_EXT}.nc ${CAMINPUT} || exit 90 # All of the .h0. files contain the same PHIS field, so we can link to any of them. - -set hists = `${LIST} ${CASE}.cam_0001.h0.*.nc` set MYSTRING = `grep cam_phis_filename input.nml` set MYSTRING = `echo $MYSTRING | sed -e "s#[=,']# #g"` set CAM_PHIS = $MYSTRING[2] -${REMOVE} ${CAM_PHIS} -${LINK} $hists[1] ${CAM_PHIS} || exit 100 +# Listings are slow in productions runs; only do it if necessary +if (! -f ${CAM_PHIS}) then + set hists = `${LIST} ${CASE}.cam_0001.h0.*.nc` + ${COPY} $hists[1] ${CAM_PHIS} || exit 100 +endif # Now, actually check the inflation settings diff --git a/models/cam-fv/shell_scripts/cesm2_1/setup_advanced b/models/cam-fv/shell_scripts/cesm2_1/setup_advanced index e245b9f7a5..f74692b164 100755 --- a/models/cam-fv/shell_scripts/cesm2_1/setup_advanced +++ b/models/cam-fv/shell_scripts/cesm2_1/setup_advanced @@ -42,6 +42,13 @@ #PBS -o Test_0.bld1 #PBS -j oe # +if ($?PBS_O_WORKDIR) then + # This avoids using /var/tmp, which can be purged by other jobs while this + # share queue job is running, which kills it. + setenv TMPDIR /glade/scratch/$USER/temp + mkdir -p $TMPDIR +endif + # --------------------- # Purpose # --------------------- @@ -516,7 +523,6 @@ setenv COMP_GLC `./xmlquery COMP_GLC --value` setenv COMP_ROF `./xmlquery COMP_ROF --value` setenv CIMEROOT `./xmlquery CIMEROOT --value` setenv EXEROOT `./xmlquery EXEROOT --value` -setenv RUNDIR `./xmlquery RUNDIR --value` setenv CAM_CONFIG_OPTS `./xmlquery CAM_CONFIG_OPTS --value` set max_tasks_per_node = `./xmlquery MAX_TASKS_PER_NODE --value` @@ -672,6 +678,8 @@ echo "After xmlchanges for ROOTPEs ..." ./xmlchange GET_REFCASE=FALSE ./xmlchange CIME_OUTPUT_ROOT=${cime_output} +# Changing CIME_OUTPUT_ROOT changes RUNDIR in CESM, so change it here too. +setenv RUNDIR `./xmlquery RUNDIR --value` ./xmlchange SSTICE_DATA_FILENAME=$sst_dataset ./xmlchange SSTICE_GRID_FILENAME=$sst_grid @@ -1236,6 +1244,16 @@ else # CONTINUE_RUN == FALSE echo "All files set to run the FIRST experiment step using (ref)time" $init_time endif + +ls *inf*\${restart_time}* >& /dev/null +if (\$status != 0) then + echo "" + echo '===========================================================' + echo "WARNING: no inflation files were found for \$restart_time" + echo '===========================================================' + echo "" +endif + exit 0 EndOfText diff --git a/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid b/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid index 20ffa142c2..33d710c102 100755 --- a/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid +++ b/models/cam-fv/shell_scripts/cesm2_1/setup_hybrid @@ -42,6 +42,13 @@ #PBS -o Test_0.bld1 #PBS -j oe # +if ($?PBS_O_WORKDIR) then + # This avoids using /var/tmp, which can be purged by other jobs while this + # share queue job is running, which kills it. + setenv TMPDIR /glade/scratch/$USER/temp + mkdir -p $TMPDIR +endif + # --------------------- # Purpose # --------------------- @@ -484,7 +491,6 @@ setenv COMP_GLC `./xmlquery COMP_GLC --value` setenv COMP_ROF `./xmlquery COMP_ROF --value` setenv CIMEROOT `./xmlquery CIMEROOT --value` setenv EXEROOT `./xmlquery EXEROOT --value` -setenv RUNDIR `./xmlquery RUNDIR --value` setenv CAM_CONFIG_OPTS `./xmlquery CAM_CONFIG_OPTS --value` set max_tasks_per_node = `./xmlquery MAX_TASKS_PER_NODE --value` @@ -640,6 +646,8 @@ echo "After xmlchanges for ROOTPEs ..." ./xmlchange GET_REFCASE=FALSE ./xmlchange CIME_OUTPUT_ROOT=${cime_output} +# Changing CIME_OUTPUT_ROOT changes RUNDIR in CESM, so change it here too. +setenv RUNDIR `./xmlquery RUNDIR --value` ./xmlchange SSTICE_DATA_FILENAME=$sst_dataset ./xmlchange SSTICE_GRID_FILENAME=$sst_grid @@ -1128,6 +1136,16 @@ else # CONTINUE_RUN == FALSE echo "All files set to run the FIRST experiment step using (ref)time" $init_time endif + +ls *inf*\${restart_time}* >& /dev/null +if (\$status != 0) then + echo "" + echo '===========================================================' + echo "WARNING: no inflation files were found for \$restart_time" + echo '===========================================================' + echo "" +endif + exit 0 EndOfText From cb8f4362da489b163c7d6ef635eb49f1535bc5a3 Mon Sep 17 00:00:00 2001 From: Helen Kershaw Date: Mon, 21 Aug 2023 09:48:25 -0400 Subject: [PATCH 3/3] Changelog and bump version for release --- CHANGELOG.rst | 9 +++++++++ conf.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4ce36d1f39..26b3529ad6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -22,6 +22,15 @@ individual files. The changes are now listed with the most recent at the top. +**August 21 2023 :: CAM-FV shell scripts. Tag v10.8.3** + +Performance improvements for CAM-FV shell scripts: + +- Avoid listing files if the CAM_PHIS file already exists. +- Avoid using /var/tmp +- RUNDIR defined after CIME_OUTPUT_ROOT change. +- Warn if no inflation files found. + **August 8 2023 :: MPAS-ATM constants and readthedocs fix. Tag v10.8.2** - MPAS-ATM constants updated to MPAS v5+ diff --git a/conf.py b/conf.py index 80ab85600d..90264588af 100644 --- a/conf.py +++ b/conf.py @@ -21,7 +21,7 @@ author = 'Data Assimilation Research Section' # The full version, including alpha/beta/rc tags -release = '10.8.2' +release = '10.8.3' root_doc = 'index' # -- General configuration ---------------------------------------------------