Skip to content

Commit

Permalink
Merge pull request #529 from NCAR/cam-fv_small_fixes
Browse files Browse the repository at this point in the history
Cam fv small fixes
  • Loading branch information
hkershaw-brown authored Aug 21, 2023
2 parents 9729d78 + cb8f436 commit 70e6af8
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 20 additions & 2 deletions models/cam-fv/shell_scripts/cesm2_1/setup_advanced
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -895,7 +903,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:

Expand Down Expand Up @@ -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
Expand Down
22 changes: 20 additions & 2 deletions models/cam-fv/shell_scripts/cesm2_1/setup_hybrid
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -860,7 +868,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:

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 70e6af8

Please sign in to comment.