[Dart-dev] [6110] DART/branches/development/models/CESM/shell_scripts: latest updates to run CESM in 6h mode; update short term
nancy at ucar.edu
nancy at ucar.edu
Mon May 6 16:27:36 MDT 2013
Revision: 6110
Author: nancy
Date: 2013-05-06 16:27:35 -0600 (Mon, 06 May 2013)
Log Message:
-----------
latest updates to run CESM in 6h mode; update short term
archive script to not require pop files to have a timestamp
of -00000 in it (midnight); remove backup namelist files
correctly for pop when alternating between assimilating
and simply restarting; give the correct directory name
when calling the shell error exit script; corrections to the
two scripts which are autogenerated by the setup script to
help in restarting a failed advance or restarting the entire
experiment over.
Modified Paths:
--------------
DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh
DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid.csh
DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh
DART/branches/development/models/CESM/shell_scripts/pop_assimilate.csh
DART/branches/development/models/CESM/shell_scripts/st_archive.sh
-------------- next part --------------
Modified: DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh 2013-05-06 21:23:08 UTC (rev 6109)
+++ DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh 2013-05-06 22:27:35 UTC (rev 6110)
@@ -544,7 +544,7 @@
echo 'ERROR: Assimilation will not be attempted.'
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
setenv EXITCODE -1
- mpirun.lsf ./shell_exit.sh
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -1
endif
@@ -558,7 +558,7 @@
echo "`date` -- DART FILTER ERROR - ABANDON HOPE"
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
setenv EXITCODE -3
- mpirun.lsf ./shell_exit.sh
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -3
endif
else
@@ -566,7 +566,7 @@
echo 'ERROR: Assimilation will not be attempted.'
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
setenv EXITCODE -2
- mpirun.lsf ./shell_exit.sh
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -2
endif
Modified: DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid.csh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid.csh 2013-05-06 21:23:08 UTC (rev 6109)
+++ DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid.csh 2013-05-06 22:27:35 UTC (rev 6110)
@@ -565,6 +565,9 @@
if ($CplLogFile == "") then
echo 'ERROR: Model did not complete - no cpl.log file present - exiting.'
echo 'ERROR: Assimilation will not be attempted.'
+ setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
+ setenv EXITCODE -1
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -1
endif
@@ -577,13 +580,17 @@
else
echo "`date` -- DART FILTER ERROR - ABANDON HOPE"
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
- mpirun.lsf "exit -3"
+ setenv EXITCODE -3
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
+ exit -3
endif
else
echo 'ERROR: Model did not complete successfully - exiting.'
echo 'ERROR: Assimilation will not be attempted.'
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
- mpirun.lsf "exit -2"
+ setenv EXITCODE -2
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
+ exit -2
endif
# END OF DART BLOCK
@@ -639,6 +646,7 @@
${COPY} ${DARTroot}/models/CESM/shell_scripts/st_archive.sh Tools/.
${COPY} ${DARTroot}/models/CESM/shell_scripts/assimilate.csh assimilate.csh
+${COPY} ${DARTroot}/shell_scripts/shell_exit.sh shell_exit.sh
${COPY} ${DARTroot}/models/CESM/shell_scripts/cam_assimilate.csh cam_assimilate.csh
${COPY} ${DARTroot}/models/CESM/shell_scripts/pop_assimilate.csh pop_assimilate.csh
${COPY} ${DARTroot}/models/CESM/shell_scripts/clm_assimilate.csh clm_assimilate.csh
Modified: DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh 2013-05-06 21:23:08 UTC (rev 6109)
+++ DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh 2013-05-06 22:27:35 UTC (rev 6110)
@@ -126,14 +126,14 @@
# runtime settings -- How many assimilation steps will be done after this one
# plus archiving options
#
-# resubmit How many job steps to run (should be 0 initially)
+# resubmit How many job steps to run on continue runs (will be 0 initially)
# stop_option Units for determining the forecast length between assimilations
# stop_n Number of time units in the forecast
# assim_n Number of time units between assimilations
#
# ==============================================================================
-setenv resubmit 0
+setenv resubmit 10
setenv stop_option nhours
setenv stop_n 12
setenv assim_n 6
@@ -327,7 +327,7 @@
./xmlchange STOP_OPTION=$stop_option
./xmlchange STOP_N=$stop_n
./xmlchange CONTINUE_RUN=FALSE
-./xmlchange RESUBMIT=$resubmit
+./xmlchange RESUBMIT=0
./xmlchange PIO_TYPENAME=pnetcdf
# this is to set the ocean coupling time to 6 hours.
@@ -596,7 +596,7 @@
echo 'ERROR: Assimilation will not be attempted.'
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
setenv EXITCODE -1
- mpirun.lsf ./shell_exit.sh
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -1
endif
@@ -610,7 +610,7 @@
echo "`date` -- DART FILTER ERROR - ABANDON HOPE"
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
setenv EXITCODE -3
- mpirun.lsf ./shell_exit.sh
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -3
endif
else
@@ -618,7 +618,7 @@
echo 'ERROR: Assimilation will not be attempted.'
setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
setenv EXITCODE -2
- mpirun.lsf ./shell_exit.sh
+ mpirun.lsf ${CASEROOT}/shell_exit.sh
exit -2
endif
@@ -673,7 +673,7 @@
echo "a Tools/st_archive.sh backup copy already exists"
endif
-${COPY} ${DARTroot}/models/CESM/shell_scripts/st_archive.sh Tools/.
+${COPY} ${DARTroot}/models/CESM/shell_scripts/st_archive.sh Tools/
${COPY} ${DARTroot}/models/CESM/shell_scripts/assimilate.csh .
${COPY} ${DARTroot}/shell_scripts/shell_exit.sh .
${COPY} ${DARTroot}/models/CESM/shell_scripts/cam_assimilate.csh .
@@ -686,11 +686,18 @@
# having to run this entire script again and rebuild CESM.
# 1) restage initial case files to start over
# 2) restore the last successful cesm fileset to restart in the middle of a run
+# 3) the changes you need to make in the env_run file between steps 1 and 2
+# 4) resetting the env_run file to the first step
# ==============================================================================
-cat << EndOfText >! restage.ksh
-#!/bin/ksh
+cat << EndOfText >! restage.sh
+#!/bin/sh
+# this script removes the current contents of the run directory and
+# replaces the initial staged files needed to start the experiment over.
+# this script was autogenerated by $0
+# using the variables set in that script
+
# before removing everything, be sure we make it to the run dir
cd ${rundir}
if [[ "\`pwd\`" != ${rundir} ]]; then
@@ -718,18 +725,29 @@
let inst=inst+1
done
+cd ${caseroot}
+
+# reset the env_run options to start a new run over
+./xmlchange STOP_OPTION=$stop_option
+./xmlchange STOP_N=$stop_n
+./xmlchange CONTINUE_RUN=FALSE
+./xmlchange RESUBMIT=0
+
exit 0
EndOfText
+chmod 0775 restage.sh
-chmod 0775 restage.ksh
+cat << EndOfText >! restart.sh
+#!/bin/sh
+# this script removes the current contents of the run directory and
+# restores the files from the last successfully archived directory.
+# this script was autogenerated by $0
+# using the variables set in that script
-cat << EndOfText >! restart.ksh
-#!/bin/ksh
+lastarchivedir=\`ls -1dt ${archdir}/rest/* | head -n 1\`
-lastarchdir=\`ls -1dt ${archdir}/rest/* | head -n 1\`
-
# before removing everything, be sure we make it to the run dir
cd ${rundir}
if [[ "\`pwd\`" != ${rundir} ]]; then
@@ -738,24 +756,62 @@
fi
${REMOVE} ${rundir}/*
-${COPY} \${lastarchdir}/* .
+${COPY} \${lastarchivedir}/* .
let inst=1
while [[ \$inst -le $num_instances ]]
do
# instance string includes the leading underscore
inst_string=\`printf _%04d \$inst\`
+ timetag=\`basename ${lastarchivedir}\`
- ${LINK} ${refcase}.cam\${inst_string}.i.\${lastarchdir}.nc cam_initial\${inst_string}.nc
+ ${LINK} ${case}.cam\${inst_string}.i.\${timetag}.nc cam_initial\${inst_string}.nc
let inst=inst+1
done
exit 0
+# reset the env_run options for a continue run
+./xmlchange STOP_OPTION=$stop_option
+./xmlchange STOP_N=$assim_n
+./xmlchange CONTINUE_RUN=TRUE
+# ./xmlchange RESUBMIT=$resubmit # depends on how many runs worked before failing
+
EndOfText
+chmod 0775 restart.sh
-chmod 0775 restart.ksh
+cat << EndOfText >! step2.sh
+#!/bin/sh
+# this script changes the env_run options that are needed for
+# any jobs step after the first one.
+# this script was autogenerated by $0
+# using the variables set in that script
+
+./xmlchange STOP_OPTION=$stop_option
+./xmlchange STOP_N=$assim_n
+./xmlchange CONTINUE_RUN=TRUE
+./xmlchange RESUBMIT=$resubmit
+
+EndOfText
+chmod 0775 step2.sh
+
+cat << EndOfText >! step1.sh
+#!/bin/sh
+
+# this script changes the env_run options that are needed for
+# the first job step.
+# this script was autogenerated by $0
+# using the variables set in that script
+
+./xmlchange STOP_OPTION=$stop_option
+./xmlchange STOP_N=$stop_n
+./xmlchange CONTINUE_RUN=FALSE
+./xmlchange RESUBMIT=0
+
+EndOfText
+chmod 0775 step1.sh
+
# ==============================================================================
# Stage the DART executables in the CESM execution root directory: EXEROOT
# ==============================================================================
Modified: DART/branches/development/models/CESM/shell_scripts/pop_assimilate.csh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/pop_assimilate.csh 2013-05-06 21:23:08 UTC (rev 6109)
+++ DART/branches/development/models/CESM/shell_scripts/pop_assimilate.csh 2013-05-06 22:27:35 UTC (rev 6110)
@@ -85,7 +85,7 @@
# restart configuration for pop (data_assim or rest).
#-------------------------------------------------------------------------
-${REMOVE} user_nl_pop2_*back
+${REMOVE} ${CASEROOT}/user_nl_pop2_*back
if ( $OCN_HOUR != 0 ) then
echo "Hour is not 0Z so we are skipping the ocean assimilation"
foreach nml ( ${CASEROOT}/user_nl_pop2_* )
Modified: DART/branches/development/models/CESM/shell_scripts/st_archive.sh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/st_archive.sh 2013-05-06 21:23:08 UTC (rev 6109)
+++ DART/branches/development/models/CESM/shell_scripts/st_archive.sh 2013-05-06 22:27:35 UTC (rev 6110)
@@ -265,14 +265,15 @@
get_inst_suffix $IDX $NINST_OCN
set ocn${inst_suffix}.log.*; dispose ifiles_n ${sta}/ocn/logs $*
set ${CASE}.pop${inst_suffix}.r.*.hdr; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
- set ${CASE}.pop${inst_suffix}.r.*0000; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
- set ${CASE}.pop${inst_suffix}.r.*0000.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.r.*[0-9]; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.r.*.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
set ${CASE}.pop${inst_suffix}.rh.ecosys.*.hdr; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
- set ${CASE}.pop${inst_suffix}.rh.ecosys.*0000; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
- set ${CASE}.pop${inst_suffix}.rh.ecosys.*0000.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.rh.ecosys.*[0-9]; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.rh.ecosys.*.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
set ${CASE}.pop${inst_suffix}.rh.*.hdr; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
- set ${CASE}.pop${inst_suffix}.rh.*0000; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
- set ${CASE}.pop${inst_suffix}.rh.*0000.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.rh.*[0-9]; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.rh.[0-9]*.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
+ set ${CASE}.pop${inst_suffix}.rh.*.nc; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
set ${CASE}.pop${inst_suffix}.ro.*; latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
set ${CASE}.pop${inst_suffix}.d?*; dispose ifiles_n ${sta}/ocn/hist $*
set ${CASE}.pop${inst_suffix}.h*; dispose ifiles_n ${sta}/ocn/hist $*
More information about the Dart-dev
mailing list