[Dart-dev] [7370] DART/trunk/models: All changes should not change answers.

nancy at ucar.edu nancy at ucar.edu
Wed Jan 14 13:19:42 MST 2015


Revision: 7370
Author:   thoar
Date:     2015-01-14 13:19:41 -0700 (Wed, 14 Jan 2015)
Log Message:
-----------
All changes should not change answers.

* default casenames contain CESM version
* protect against using unsupported compsets
* using environment variable for MPI_RUN_COMMAND instead of hardcoded mpirun.lsf
* correct comment about the name of the HOME/cesm1_* Sourcemods directory
* removed trailing commas from things in the CESM user namelists
* belt and suspenders and new change-in-one-place timestamp for stage_cesm_files

Modified Paths:
--------------
    DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid
    DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo
    DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_special
    DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_hybrid
    DART/trunk/models/CESM/shell_scripts/CESM_DART_config
    DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid
    DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo
    DART/trunk/models/POP/shell_scripts/CESM1_2_1_setup_hybrid
    DART/trunk/models/POP/shell_scripts/CESM1_2_1_setup_pmo
    DART/trunk/models/POP/shell_scripts/CESM_DART_config
    DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid
    DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo
    DART/trunk/models/cam/shell_scripts/CESM1_2_1_setup_hybrid
    DART/trunk/models/cam/shell_scripts/CESM1_2_1_setup_pmo
    DART/trunk/models/cam/shell_scripts/CESM_DART_config
    DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_hybrid
    DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_pmo
    DART/trunk/models/clm/shell_scripts/CESM1_2_1_setup_hybrid
    DART/trunk/models/clm/shell_scripts/CESM1_2_1_setup_pmo
    DART/trunk/models/clm/shell_scripts/CESM_DART_config

Added Paths:
-----------
    DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_pmo

Property Changed:
----------------
    DART/trunk/models/cam/shell_scripts/CESM_DART_config

-------------- next part --------------
Modified: DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid	2015-01-13 23:15:48 UTC (rev 7369)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid	2015-01-14 20:19:41 UTC (rev 7370)
@@ -6,7 +6,7 @@
 #
 # DART $Id$
 
-# ==============================================================================
+#*******************************************************************************
 #
 # ---------------------
 # Purpose
@@ -91,10 +91,8 @@
 # ./${case}.clean_build
 # ./${case}.build
 #
-# ==============================================================================
+#*******************************************************************************
 
-
-
 # ==============================================================================
 # case options:
 #
@@ -108,7 +106,7 @@
 # num_instances The number of ensemble members.
 # ==============================================================================
 
-setenv case                 cesm_6h_hybrid
+setenv case                 cesm1_1_1_hybrid
 setenv compset              B_2000_CAM5
 setenv resolution           0.9x1.25_gx1v6
 setenv cesmtag              cesm1_1_1
@@ -170,7 +168,6 @@
 
 setenv stagedir /glade/p/image/CESM_initial_ensemble/rest/${reftimestamp}
 
-
 # ==============================================================================
 # runtime settings:
 #
@@ -219,11 +216,11 @@
 # queue      can be changed during a series by changing the ${case}.run
 # timewall   can be changed during a series by changing the ${case}.run
 #
-# TJH: Advancing 30 instances for 6 hours with 900 pes
-#      took less than 10 minutes on yellowstone.
+# TJH: Advancing 30 instances for 6 hours and assimilating took
+#      less than 10 minutes on yellowstone using 1800 pes (120 nodes)
 # ==============================================================================
 
-setenv ACCOUNT      P8685xxxx
+setenv ACCOUNT      NIMGxxxx
 setenv queue        economy
 setenv timewall     0:30
 
@@ -460,6 +457,11 @@
 
 ./xmlchange PIO_TYPENAME=pnetcdf
 
+set TEST_MPI = `./xmlquery -valonly MPI_RUN_COMMAND | sed -e 's/MPI_RUN_COMMAND = //'`
+if (${TEST_MPI} == 'UNSET') then
+   ./xmlchange MPI_RUN_COMMAND=mpirun.lsf
+endif
+
 # COUPLING discussion.
 # http://bugs.cgd.ucar.edu/show_bug.cgi?id=1740
 # "In summary, users should ensure that the following is true,
@@ -476,19 +478,24 @@
 # so we are also turning on the CLM biogeochemistry.
 ./xmlchange CLM_CONFIG_OPTS='-bgc cn'
 
+# These are archiving options that may be used.
+# You can turn the short/long term archivers on or off,
+# but these settings should be made in either event.
+
+./xmlchange DOUT_S_ROOT=${archdir}
+./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
+./xmlchange DOUT_L_MSROOT="csm/${case}"
+./xmlchange DOUT_L_HTAR=FALSE
+
 if ($short_term_archiver == 'off') then
    ./xmlchange DOUT_S=FALSE
 else
    ./xmlchange DOUT_S=TRUE
-   ./xmlchange DOUT_S_ROOT=${archdir}
-   ./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
 endif
 if ($long_term_archiver == 'off') then
    ./xmlchange DOUT_L_MS=FALSE
 else
    ./xmlchange DOUT_L_MS=TRUE
-   ./xmlchange DOUT_L_MSROOT="csm/${case}"
-   ./xmlchange DOUT_L_HTAR=FALSE
 endif
 
 # level of debug output, 0=minimum, 1=normal, 2=more, 3=too much, valid values: 0,1,2,3 (integer)
@@ -501,6 +508,8 @@
 # This creates the EXEROOT and RUNDIR directories.
 # ==============================================================================
 
+echo 'Setting up the case ...'
+
 ./cesm_setup
 
 if ( $status != 0 ) then
@@ -527,15 +536,14 @@
       # NCAR "bluefire", "yellowstone"
       set TIMEWALL=`grep BSUB ${case}.run | grep -e '-W' `
       set    QUEUE=`grep BSUB ${case}.run | grep -e '-q' `
-      sed -e "s/$TIMEWALL[3]/$timewall/" \
-          -e "s/ptile=[0-9][0-9]*/ptile=$ptile/" \
-          -e "s/$QUEUE[3]/$queue/" < ${case}.run >! temp.$$
+      sed -e "/BSUB/s#$TIMEWALL[3]#$timewall#" \
+          -e "/BSUB/s#ptile=[0-9][0-9]*#ptile=$ptile#" \
+          -e "/BSUB/s#$QUEUE[3]#$queue#" < ${case}.run >! temp.$$
           ${MOVE} temp.$$ ${case}.run
           chmod 755       ${case}.run
    breaksw
 
    default:
-
    breaksw
 endsw
 
@@ -559,10 +567,10 @@
    echo "ERROR - No SourceMods for this case."
    echo "ERROR - No SourceMods for this case."
    echo "DART requires modifications to several src files."
-   echo "These files can be downloaded from:"
-   echo "http://www.image.ucar.edu/pub/DART/CESM/DART_SourceMods_cesm1_1_1_24Oct2013.tar"
+   echo "Download the appropriate files for CESM 1_1_1 from:"
+   echo "http://www.image.ucar.edu/pub/DART/CESM"
    echo "untar these into your HOME directory - they will create a"
-   echo "~/cesm_1_1_1  directory with the appropriate SourceMods structure."
+   echo "~/cesm1_1_1  directory with the appropriate SourceMods structure."
    exit -4
 endif
 
@@ -643,7 +651,9 @@
    set fname = "user_nl_clm${inst_string}"
    # ===========================================================================
    # LAND Namelist
-   # The filename is built using the REFCASE/REFDATE/REFTOD information.
+   # With a RUN_TYPE=hybrid the finidat is automatically specified
+   # using the REFCASE/REFDATE/REFTOD information. i.e.
+   # finidat = ${stagedir}/${refcase}.clm2${inst_string}.r.${reftimestamp}.nc
    #
    # This is the time to consider how DART and CESM will interact.  If you intend
    # on assimilating flux tower observations (nominally at 30min intervals),
@@ -654,20 +664,19 @@
    #
    # DART's forward observation operators for these fluxes just reads them
    # from the .h1. file rather than trying to create them from the subset of
-   # CLM variables that are available in the DART state vector.
-   #
-   # For a HOP TEST ... hist_empty_htapes = .false.
-   # For a HOP TEST ... use a default hist_fincl1
-   #
-   # FIXME ... add documentation for configuring CLM history files
+   # CLM variables that are available in the DART state vector. We have a terrible
+   # time trying to predict the .h1. filename given only current model time.
+   # DART does not read the clm namelist input that has this information, and
+   # since it is in a namelist - it can change during the course of a run - BUT
+   # as discussed above, only the first settings are important. Tricky.
 
-   echo "dtime             = $clm_dtime,"            >> ${fname}
-   echo "hist_empty_htapes = .true."   >> ${fname}
-   echo "hist_fincl1 = 'NEP'"                        >> ${fname}
-   echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"  >> ${fname}
-   echo "hist_nhtfrq = -$stop_n,1,"                  >> ${fname}
-   echo "hist_mfilt  = 1,$h1nsteps"                  >> ${fname}
-   echo "hist_avgflag_pertape = 'A','A'"             >> ${fname}
+   echo "dtime             = $clm_dtime"              >> ${fname}
+   echo "hist_empty_htapes = .true."                  >> ${fname}
+   echo "hist_fincl1 = 'NEP'"                         >> ${fname}
+   echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"   >> ${fname}
+   echo "hist_nhtfrq = -$stop_n,1"                    >> ${fname}
+   echo "hist_mfilt  = 1,$h1nsteps"                   >> ${fname}
+   echo "hist_avgflag_pertape = 'A','A'"              >> ${fname}
 
    # ===========================================================================
    set fname = "user_nl_pop2${inst_string}"
@@ -744,57 +753,58 @@
 
 set restart_time = $init_time
 
-
 # get the settings for this case from the CESM environment
 cd ${caseroot}
 source ./Tools/ccsm_getenv || exit -2
 cd ${RUNDIR}
 
 echo 'Copying the required CESM files to the run directory to rerun'
-echo 'a previous step.  CONTINUE_RUN from env_run.xml is' \$CONTINUE_RUN
-if ( \$CONTINUE_RUN == TRUE ) then
+echo 'a previous step.  CONTINUE_RUN from env_run.xml is' \${CONTINUE_RUN}
+if ( \${CONTINUE_RUN} == TRUE ) then
   echo 'so files for some later step than the initial one will be restaged.'
-  echo "Date to reset files to is: \$restart_time"
+  echo "Date to reset files to is: \${restart_time}"
 else
   echo 'so files for the initial step of this experiment will be restaged.'
-  echo "Date to reset files to is: $init_time"
+  echo "Date to reset files to is: ${init_time}"
 endif
 echo ''
 
+if ( \${CONTINUE_RUN} == TRUE ) then
 
-if ( \$CONTINUE_RUN == TRUE ) then
-
    #----------------------------------------------------------------------
    # This block copies over a set of restart files from any previous step of
    # the experiment that is NOT the initial step.
    # After running this script resubmit the job to rerun.
    #----------------------------------------------------------------------
 
-   echo "Staging restart files for run date/time: " \$restart_time
+   echo "Staging restart files for run date/time: " \${restart_time}
 
    #  The short term archiver is on, so the files we want should be in one
    #  of the short term archive 'rest' restart directories.  This assumes
    #  the long term archiver has NOT copied these files to the HPSS yet.
 
-   if (  \$DOUT_S   == TRUE ) then
+   if (  \${DOUT_S} == TRUE ) then
 
       # The restarts should be in the short term archive directory.  See
       # www.cesm.ucar.edu/models/cesm1.1/cesm/doc/usersguide/x1631.html#running_ccsm_restart_back
       # for more help and information.
 
-      if ( ! -d \$DOUT_S_ROOT/rest/\${restart_time} ) then
+      set RESTARTDIR = \${DOUT_S_ROOT}/rest/\${restart_time}
 
+      if ( ! -d \${RESTARTDIR} ) then
+
          echo "restart file directory not found: "
-         echo " \$DOUT_S_ROOT/rest/\${restart_time} "
+         echo " \${RESTARTDIR}"
          echo "If the long-term archiver is on, you may have to restore this directory first."
          echo "You can also check for either a .sta or a .sta2 hidden subdirectory in"
-         echo \$DOUT_S_ROOT
-         echo "which may contain the 'rest' directory you need."
+         echo "\${DOUT_S_ROOT}"
+         echo "which may contain the 'rest' directory you need,"
+         echo "and then modify RESTARTDIR in this script."
          exit -1
 
       endif
 
-      ${COPY} \$DOUT_S_ROOT/rest/\${restart_time}/* . || exit -1
+      ${COPY} \${RESTARTDIR}/* . || exit -1
 
    else
 

Modified: DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo	2015-01-13 23:15:48 UTC (rev 7369)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo	2015-01-14 20:19:41 UTC (rev 7370)
@@ -6,7 +6,7 @@
 #
 # DART $Id$
 
-# ==============================================================================
+#*******************************************************************************
 #
 # ---------------------
 # Purpose
@@ -102,10 +102,8 @@
 # ./${case}.clean_build
 # ./${case}.build
 #
-# ==============================================================================
+#*******************************************************************************
 
-
-
 # ==============================================================================
 # case options:
 #
@@ -118,7 +116,7 @@
 # cesmtag       The version of the CESM source code to use when building the code.
 # ==============================================================================
 
-setenv case                 cesm_6h_pmo
+setenv case                 cesm1_1_1_pmo
 setenv compset              B_2000_CAM5
 setenv resolution           0.9x1.25_gx1v6
 setenv cesmtag              cesm1_1_1
@@ -196,7 +194,6 @@
 
 setenv stagedir /glade/p/image/CESM_initial_ensemble/rest/${reftimestamp}
 
-
 # ==============================================================================
 # runtime settings:
 #
@@ -245,11 +242,11 @@
 # queue      can be changed during a series by changing the ${case}.run
 # timewall   can be changed during a series by changing the ${case}.run
 #
-# TJH: Advancing 1 instance for 6 hours with 60 pes
-#      took less than 10 minutes on yellowstone.
+# TJH: Advancing 1 instance for 6 hours and creating synthetic obs took
+#      less than 10 minutes with 60 pes (4 nodes) on yellowstone.
 # ==============================================================================
 
-setenv ACCOUNT      P8685xxxx
+setenv ACCOUNT      NIMGxxxx
 setenv queue        economy
 setenv timewall     0:30
 
@@ -471,6 +468,11 @@
 
 ./xmlchange PIO_TYPENAME=pnetcdf
 
+set TEST_MPI = `./xmlquery -valonly MPI_RUN_COMMAND | sed -e 's/MPI_RUN_COMMAND = //'`
+if (${TEST_MPI} == 'UNSET') then
+   ./xmlchange MPI_RUN_COMMAND=mpirun.lsf
+endif
+
 # COUPLING discussion.
 # http://bugs.cgd.ucar.edu/show_bug.cgi?id=1740
 # "In summary, users should ensure that the following is true,
@@ -487,19 +489,24 @@
 # so we are also turning on the CLM biogeochemistry.
 ./xmlchange CLM_CONFIG_OPTS='-bgc cn'
 
+# These are archiving options that may be used.
+# You can turn the short/long term archivers on or off,
+# but these settings should be made in either event.
+
+./xmlchange DOUT_S_ROOT=${archdir}
+./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
+./xmlchange DOUT_L_MSROOT="csm/${case}"
+./xmlchange DOUT_L_HTAR=FALSE
+
 if ($short_term_archiver == 'off') then
    ./xmlchange DOUT_S=FALSE
 else
    ./xmlchange DOUT_S=TRUE
-   ./xmlchange DOUT_S_ROOT=${archdir}
-   ./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
 endif
 if ($long_term_archiver == 'off') then
    ./xmlchange DOUT_L_MS=FALSE
 else
    ./xmlchange DOUT_L_MS=TRUE
-   ./xmlchange DOUT_L_MSROOT="csm/${case}"
-   ./xmlchange DOUT_L_HTAR=FALSE
 endif
 
 # level of debug output, 0=minimum, 1=normal, 2=more, 3=too much, valid values: 0,1,2,3 (integer)
@@ -512,6 +519,8 @@
 # This creates the EXEROOT and RUNDIR directories.
 # ==============================================================================
 
+echo 'Setting up the case ...'
+
 ./cesm_setup
 
 if ( $status != 0 ) then
@@ -538,15 +547,14 @@
       # NCAR "bluefire", "yellowstone"
       set TIMEWALL=`grep BSUB ${case}.run | grep -e '-W' `
       set    QUEUE=`grep BSUB ${case}.run | grep -e '-q' `
-      sed -e "s/$TIMEWALL[3]/$timewall/" \
-          -e "s/ptile=[0-9][0-9]*/ptile=$ptile/" \
-          -e "s/$QUEUE[3]/$queue/" < ${case}.run >! temp.$$
+      sed -e "/BSUB/s#$TIMEWALL[3]#$timewall#" \
+          -e "/BSUB/s#ptile=[0-9][0-9]*#ptile=$ptile#" \
+          -e "/BSUB/s#$QUEUE[3]#$queue#" < ${case}.run >! temp.$$
           ${MOVE} temp.$$ ${case}.run
           chmod 755       ${case}.run
    breaksw
 
    default:
-
    breaksw
 endsw
 
@@ -570,10 +578,10 @@
    echo "ERROR - No SourceMods for this case."
    echo "ERROR - No SourceMods for this case."
    echo "DART requires modifications to several src files."
-   echo "These files can be downloaded from:"
-   echo "http://www.image.ucar.edu/pub/DART/CESM/DART_SourceMods_cesm1_1_1_24Oct2013.tar"
+   echo "Download the appropriate files for CESM 1_1_1 from:"
+   echo "http://www.image.ucar.edu/pub/DART/CESM"
    echo "untar these into your HOME directory - they will create a"
-   echo "~/cesm_1_1_1  directory with the appropriate SourceMods structure."
+   echo "~/cesm1_1_1  directory with the appropriate SourceMods structure."
    exit -4
 endif
 
@@ -682,13 +690,13 @@
    # echo "hist_mfilt  = 1"              >> ${fname}
    # echo "hist_nhtfrq = 0"              >> ${fname}
 
-   echo "dtime             = $clm_dtime,"            >> ${fname}
-   echo "hist_empty_htapes = .true."   >> ${fname}
-   echo "hist_fincl1 = 'NEP'"                        >> ${fname}
-   echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"  >> ${fname}
-   echo "hist_nhtfrq = -$stop_n,1,"                  >> ${fname}
-   echo "hist_mfilt  = 1,$h1nsteps"                  >> ${fname}
-   echo "hist_avgflag_pertape = 'A','A'"             >> ${fname}
+   echo "dtime             = $clm_dtime"              >> ${fname}
+   echo "hist_empty_htapes = .true."                  >> ${fname}
+   echo "hist_fincl1 = 'NEP'"                         >> ${fname}
+   echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"   >> ${fname}
+   echo "hist_nhtfrq = -$stop_n,1"                    >> ${fname}
+   echo "hist_mfilt  = 1,$h1nsteps"                   >> ${fname}
+   echo "hist_avgflag_pertape = 'A','A'"              >> ${fname}
 
    # ===========================================================================
    set fname = "user_nl_pop2${inst_string}"
@@ -765,57 +773,58 @@
 
 set restart_time = $init_time
 
-
 # get the settings for this case from the CESM environment
 cd ${caseroot}
 source ./Tools/ccsm_getenv || exit -2
 cd ${RUNDIR}
 
 echo 'Copying the required CESM files to the run directory to rerun'
-echo 'a previous step.  CONTINUE_RUN from env_run.xml is' \$CONTINUE_RUN
-if ( \$CONTINUE_RUN == TRUE ) then
+echo 'a previous step.  CONTINUE_RUN from env_run.xml is' \${CONTINUE_RUN}
+if ( \${CONTINUE_RUN} == TRUE ) then
   echo 'so files for some later step than the initial one will be restaged.'
-  echo "Date to reset files to is: \$restart_time"
+  echo "Date to reset files to is: \${restart_time}"
 else
   echo 'so files for the initial step of this experiment will be restaged.'
-  echo "Date to reset files to is: $init_time"
+  echo "Date to reset files to is: ${init_time}"
 endif
 echo ''
 
+if ( \${CONTINUE_RUN} == TRUE ) then
 
-if ( \$CONTINUE_RUN == TRUE ) then
-
    #----------------------------------------------------------------------
    # This block copies over a set of restart files from any previous step of
    # the experiment that is NOT the initial step.
    # After running this script resubmit the job to rerun.
    #----------------------------------------------------------------------
 
-   echo "Staging restart files for run date/time: " \$restart_time
+   echo "Staging restart files for run date/time: " \${restart_time}
 
    #  The short term archiver is on, so the files we want should be in one
    #  of the short term archive 'rest' restart directories.  This assumes
    #  the long term archiver has NOT copied these files to the HPSS yet.
 
-   if (  \$DOUT_S   == TRUE ) then
+   if (  \${DOUT_S} == TRUE ) then
 
       # The restarts should be in the short term archive directory.  See
       # www.cesm.ucar.edu/models/cesm1.1/cesm/doc/usersguide/x1631.html#running_ccsm_restart_back
       # for more help and information.
 
-      if ( ! -d \$DOUT_S_ROOT/rest/\${restart_time} ) then
+      set RESTARTDIR = \${DOUT_S_ROOT}/rest/\${restart_time}
 
+      if ( ! -d \${RESTARTDIR} ) then
+
          echo "restart file directory not found: "
-         echo " \$DOUT_S_ROOT/rest/\${restart_time} "
+         echo " \${RESTARTDIR}"
          echo "If the long-term archiver is on, you may have to restore this directory first."
          echo "You can also check for either a .sta or a .sta2 hidden subdirectory in"
-         echo \$DOUT_S_ROOT
-         echo "which may contain the 'rest' directory you need."
+         echo "\${DOUT_S_ROOT}"
+         echo "which may contain the 'rest' directory you need,"
+         echo "and then modify RESTARTDIR in this script."
          exit -1
 
       endif
 
-      ${COPY} \$DOUT_S_ROOT/rest/\${restart_time}/* . || exit -1
+      ${COPY} \${RESTARTDIR}/* . || exit -1
 
    else
 
@@ -848,7 +857,7 @@
       end
 
       # There are no instance numbers in these filenames.
-      echo "${case}.cpl.r.\${restart_time}.nc"     >! rpointer.drv
+      echo "${case}.cpl.r.\${restart_time}.nc" >! rpointer.drv
 
    endif
 

Modified: DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_special
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_special	2015-01-13 23:15:48 UTC (rev 7369)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_special	2015-01-14 20:19:41 UTC (rev 7370)
@@ -14,6 +14,8 @@
 
 exit
 
+#*******************************************************************************
+#
 # ---------------------
 # Purpose
 # ---------------------
@@ -116,23 +118,29 @@
 # ./${case}.clean_build
 # ./${case}.build
 #
+#*******************************************************************************
+
 # ==============================================================================
-# ====  Set case options
+# case options:
+#
+# case          The value of "case" will be used many ways; directory and file
+#               names both locally and on HPSS, and script names; so consider
+#               its length and information content.
+# compset       Must be one of the CESM standard names, see the CESM documentation
+#               for supported strings.
+# resolution    Sets the model grid resolution, see the CESM documentation.
+# cesmtag       The version of the CESM source code to use when building the code.
+# num_instances The number of ensemble members.
 # ==============================================================================
 
-# the value of "case" will be used many ways;
-#    directory and file names, both locally and on HPSS, and
-#    script names; so consider its length and information content.
-# num_instances:  Number of ensemble members
-
-setenv case                 cesm_multi
+setenv case                 cesm1_1_1_special
 setenv compset              B_2000_CAM5
 setenv resolution           0.9x1.25_gx1v6
 setenv cesmtag              cesm1_1_1
 setenv num_instances        30
 
 # ==============================================================================
-# define machines and directories
+# machines and directories:
 #
 # mach            Computer name
 # cesmroot        Location of the cesm code base
@@ -150,11 +158,10 @@
 # ==============================================================================
 
 setenv mach         yellowstone
-
 setenv cesmroot     /glade/p/cesm/cseg/collections/$cesmtag
 setenv caseroot     /glade/p/work/${USER}/cases/${case}
+setenv rundir       /glade/scratch/${USER}/${case}/run
 setenv exeroot      /glade/scratch/${USER}/${case}/bld
-setenv rundir       /glade/scratch/${USER}/${case}/run
 setenv archdir      /glade/scratch/${USER}/archive/${case}
 setenv dartroot     /glade/u/home/${USER}/svn/DART/trunk
 
@@ -192,7 +199,6 @@
 # If the long-term archiver is off, you get a chance to examine the files before
 # they get moved to long-term storage. You can always submit $CASE.l_archive
 # whenever you want to free up space in the short-term archive directory.
-#
 # ==============================================================================
 
 setenv short_term_archiver on
@@ -210,7 +216,7 @@
 @ h1nsteps = $assim_n * 3600 / $clm_dtime
 
 # ==============================================================================
-# job settings
+# job settings:
 #
 # queue      can be changed during a series by changing the ${case}.run
 # timewall   can be changed during a series by changing the ${case}.run
@@ -219,12 +225,15 @@
 #      took about 30 minutes on yellowstone.
 # ==============================================================================
 
-setenv ACCOUNT      P8685xxxx
+setenv ACCOUNT      NIMGxxxx
 setenv queue        economy
 setenv timewall     1:00
 
 # ==============================================================================
-# set these standard commands based on the machine you are running on.
+# standard commands:
+#
+# If you are running on a machine where the standard commands are not in the
+# expected location, add a case for them below.
 # ==============================================================================
 
 set nonomatch       # suppress "rm" warnings if wildcard does not match anything
@@ -334,6 +343,7 @@
 
 source ./Tools/ccsm_getenv || exit -2
 
+# MAX_TASKS_PER_NODE comes from $case/Tools/mkbatch.$machine
 @ ptile = $MAX_TASKS_PER_NODE / 2
 @ nthreads = 1
 
@@ -408,7 +418,7 @@
 # namelists are changed in the hybrid run. In a hybrid initialization, the ocean
 # model does not start until the second ocean coupling (normally the second day),
 # and the coupler does a "cold start" without a restart file."
-
+#
 # TJH:
 # DART's CAM implementation causes a bit more complexity. DART only uses CAM _initial_
 # files, not RESTART files, so there are sourcemods to force a hybrid start for CAM to
@@ -441,6 +451,11 @@
 
 ./xmlchange PIO_TYPENAME=pnetcdf
 
+set TEST_MPI = `./xmlquery -valonly MPI_RUN_COMMAND | sed -e 's/MPI_RUN_COMMAND = //'`
+if (${TEST_MPI} == 'UNSET') then
+   ./xmlchange MPI_RUN_COMMAND=mpirun.lsf
+endif
+
 # COUPLING discussion.
 # http://bugs.cgd.ucar.edu/show_bug.cgi?id=1740
 # "In summary, users should ensure that the following is true,
@@ -457,19 +472,24 @@
 # so we are also turning on the CLM biogeochemistry.
 ./xmlchange CLM_CONFIG_OPTS='-bgc cn'
 
+# These are archiving options that may be used.
+# You can turn the short/long term archivers on or off,
+# but these settings should be made in either event.
+
+./xmlchange DOUT_S_ROOT=${archdir}
+./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
+./xmlchange DOUT_L_MSROOT="csm/${case}"
+./xmlchange DOUT_L_HTAR=FALSE
+
 if ($short_term_archiver == 'off') then
    ./xmlchange DOUT_S=FALSE
 else
    ./xmlchange DOUT_S=TRUE
-   ./xmlchange DOUT_S_ROOT=${archdir}
-   ./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
 endif
 if ($long_term_archiver == 'off') then
    ./xmlchange DOUT_L_MS=FALSE
 else
    ./xmlchange DOUT_L_MS=TRUE
-   ./xmlchange DOUT_L_MSROOT="csm/${case}"
-   ./xmlchange DOUT_L_HTAR=FALSE
 endif
 
 # level of debug output, 0=minimum, 1=normal, 2=more, 3=too much, valid values: 0,1,2,3 (integer)
@@ -482,6 +502,8 @@
 # This creates the EXEROOT and RUNDIR directories.
 # ==============================================================================
 
+echo 'Setting up the case ...'
+
 ./cesm_setup
 
 if ( $status != 0 ) then
@@ -508,15 +530,14 @@
       # NCAR "bluefire", "yellowstone"
       set TIMEWALL=`grep BSUB ${case}.run | grep -e '-W' `
       set    QUEUE=`grep BSUB ${case}.run | grep -e '-q' `
-      sed -e "s/$TIMEWALL[3]/$timewall/" \
-          -e "s/ptile=[0-9][0-9]*/ptile=$ptile/" \
-          -e "s/$QUEUE[3]/$queue/" < ${case}.run >! temp.$$
+      sed -e "/BSUB/s#$TIMEWALL[3]#$timewall#" \
+          -e "/BSUB/s#ptile=[0-9][0-9]*#ptile=$ptile#" \
+          -e "/BSUB/s#$QUEUE[3]#$queue#" < ${case}.run >! temp.$$
           ${MOVE} temp.$$ ${case}.run
           chmod 755       ${case}.run
    breaksw
 
    default:
-
    breaksw
 endsw
 
@@ -524,7 +545,7 @@
 # correctly given the modifications of CAM for DART. It also copies several
 # required DART files to the caseroot directory.
 
-./CESM_DART_config
+./CESM_DART_config || exit -3
 
 # ==============================================================================
 # Update source files.
@@ -540,10 +561,10 @@
    echo "ERROR - No SourceMods for this case."
    echo "ERROR - No SourceMods for this case."
    echo "DART requires modifications to several src files."
-   echo "These files can be downloaded from:"
-   echo "http://www.image.ucar.edu/pub/DART/CESM/DART_SourceMods_cesm1_1_1_24Oct2013.tar"
+   echo "Download the appropriate files for CESM 1_1_1 from:"
+   echo "http://www.image.ucar.edu/pub/DART/CESM"
    echo "untar these into your HOME directory - they will create a"
-   echo "~/cesm_1_1_1  directory with the appropriate SourceMods structure."
+   echo "~/cesm1_1_1  directory with the appropriate SourceMods structure."
    exit -4
 endif
 
@@ -628,7 +649,7 @@
    # ===========================================================================
    set fname = "user_nl_clm${inst_string}"
    # ===========================================================================
-
+   # LAND Namelist
    # Customize the land namelists
    # The filename is built using the REFCASE/REFDATE/REFTOD information.
    #
@@ -642,25 +663,19 @@
    # DART's forward observation operators for these fluxes just reads them
    # from the .h1. file rather than trying to create them from the subset of
    # CLM variables that are available in the DART state vector.
-   #
-   # For a HOP TEST ... hist_empty_htapes = .false.
-   # For a HOP TEST ... use a default hist_fincl1
-   #
-   # FIXME ... add documentation for configuring CLM history files
 
-   echo "dtime             = $clm_dtime,"            >> ${fname}
-   echo "hist_empty_htapes = .true."                 >> ${fname}
-   echo "hist_fincl1 = 'NEP'"                        >> ${fname}
-   echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"  >> ${fname}
-   echo "hist_nhtfrq = -$assim_n,1,"                 >> ${fname}
-   echo "hist_mfilt  = 1,$h1nsteps"                  >> ${fname}
-   echo "hist_avgflag_pertape = 'A','A'"             >> ${fname}
+   echo "dtime             = $clm_dtime"              >> ${fname}
+   echo "hist_empty_htapes = .true."                  >> ${fname}
+   echo "hist_fincl1 = 'NEP'"                         >> ${fname}
+   echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"   >> ${fname}
+   echo "hist_nhtfrq = -$assim_n,1"                   >> ${fname}
+   echo "hist_mfilt  = 1,$h1nsteps"                   >> ${fname}
+   echo "hist_avgflag_pertape = 'A','A'"              >> ${fname}
 
    # ===========================================================================
    set fname = "user_nl_pop2${inst_string}"
    # ===========================================================================
-
-   # POP Namelists
+   # POP Namelist
    # init_ts_suboption = 'data_assim'   for non bit-for-bit restarting (assimilation mode)
    # init_ts_suboption = 'rest'         --> default behavior
    #
@@ -693,16 +708,13 @@
    # tavg_file_freq_opt = 'nmonth' 'never' 'never'
    # tavg_freq_opt      = 'nmonth' 'never' 'never'
    # The  first entry indicates we get a monthly average once a month, and thats all we get..
-   #
-   # For a HOP TEST ... Would like to have restart files every day, not just for end.
-   # For a HOP TEST (untested)... tavg_file_freq_opt = 'nmonth' 'nday' 'once'"
 
    echo "init_ts_suboption  = 'data_assim'" >> ${fname}
 
    # ===========================================================================
    set fname = "user_nl_cice${inst_string}"
    # ===========================================================================
-   # CICE Namelists
+   # CICE Namelist
 
    echo "ice_ic = 'b40.20th.005_ens${instance2}.cice.r.2004-01-01-00000.nc'" >> ${fname}
 
@@ -718,7 +730,7 @@
    @ inst ++
 end
 
-./preview_namelists
+./preview_namelists || exit -3
 
 # ==============================================================================
 # Stage the restarts now that the run directory exists

Modified: DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_hybrid
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_hybrid	2015-01-13 23:15:48 UTC (rev 7369)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_hybrid	2015-01-14 20:19:41 UTC (rev 7370)
@@ -6,7 +6,7 @@
 #
 # DART $Id$
 
-# ==============================================================================
+#*******************************************************************************
 #
 # ---------------------
 # Purpose
@@ -91,10 +91,8 @@
 # ./${case}.clean_build
 # ./${case}.build
 #
-# ==============================================================================
+#*******************************************************************************
 
-
-
 # ==============================================================================
 # case options:
 #
@@ -109,8 +107,8 @@
 # ==============================================================================
 # 2000_CAM5_CLM40%CN_CICE_POP2_RTM_SGLC_SWAV (B_2000_CAM5_CN) (BC5CN)
 
-setenv case                 cesm_test2
-setenv compset              2000_CAM5_CLM40%CN_CICE_POP2_RTM_SGLC_SWAV
+setenv case                 cesm1_2_1_hybrid
+setenv compset              B_2000_CAM5_CN
 setenv resolution           0.9x1.25_gx1v6
 setenv cesmtag              cesm1_2_1
 setenv num_instances        30
@@ -224,7 +222,7 @@
 #      an assimilation step took about 17 minutes on yellowstone.
 # ==============================================================================
 
-setenv ACCOUNT      P8685xxxx
+setenv ACCOUNT      NIMGxxxx
 setenv queue        economy
 setenv timewall     0:30
 
@@ -465,8 +463,19 @@
 ./xmlchange RESUBMIT=$resubmit
 
 ./xmlchange PIO_TYPENAME=pnetcdf
-./xmlchange MPI_RUN_COMMAND=mpirun.lsf
 
+set TEST_MPI = `./xmlquery -valonly MPI_RUN_COMMAND | sed -e 's/MPI_RUN_COMMAND = //'`
+if (${TEST_MPI} == 'UNSET') then
+   ./xmlchange MPI_RUN_COMMAND=mpirun.lsf
+endif
+
+# The river transport model ON is useful only when using an active ocean or
+# land surface diagnostics. Setting ROF_GRID, RTM_MODE to 'null' turns off the RTM.
+# If it is ON, you will have to stage initial files etc.
+
+# ./xmlchange ROF_GRID='null'
+# ./xmlchange RTM_MODE="NULL"
+
 # COUPLING discussion.
 # http://bugs.cgd.ucar.edu/show_bug.cgi?id=1740
 # "In summary, users should ensure that the following is true,
@@ -482,12 +491,10 @@
 ./xmlchange GLC_NCPL=4
 ./xmlchange OCN_NCPL=4
 
-# The river transport model ON is useful only when using an active ocean or
-# land surface diagnostics. Setting ROF_GRID to 'null' turns off the RTM.
+# These are archiving options that may be used.
+# You can turn the short/long term archivers on or off,
+# but these settings should be made in either event.
 
-#./xmlchange ROF_GRID='null'
-#./xmlchange RTM_MODE="NULL"
-
 ./xmlchange DOUT_S_ROOT=${archdir}
 ./xmlchange DOUT_S_SAVE_INT_REST_FILES=FALSE
 ./xmlchange DOUT_L_MSROOT="csm/${case}"
@@ -526,7 +533,6 @@
    # Each CLM version has some SourceMods. Link to the right version.
    # must parse from a variable of the form:
    # CLM_CONFIG_OPTS: -phys clm4_0 -bgc cn
-   # FIXME ... if bgc off ... can I still copy in CNBalanceCheckMod.F90
 
    set clm_opts = `echo $CLM_CONFIG_OPTS | sed -e "s/-//"`
 
@@ -548,7 +554,7 @@
                echo "Got the version from CLM_CONFIG_OPTS ...  <${CLM_CONFIG_OPTS}>"
             endif
          breaksw
-      #  case "bgc":  FIXME ... any special action needed here?
+      #  case "bgc":  no special action needed here at this time
       #  breaksw
 
          default:
@@ -560,7 +566,7 @@
 
    # Each CAM dynamical core has its own SourceMods
 
-   if ( -e    SourceMods/src.cam/src/dynamics/${CAM_DYCORE} ) then
+   if ( -e    SourceMods/src.cam/src/dynamics/${CAM_DYCORE}/*F90 ) then
       cd      SourceMods/src.cam
       ${LINK} src/dynamics/${CAM_DYCORE}/*F90 .
       cd      ../..
@@ -572,10 +578,10 @@
    echo "ERROR - No SourceMods for this case."
    echo "ERROR - No SourceMods for this case."
    echo "DART requires modifications to several src files."
-   echo "These files can be downloaded from:"
-   echo "http://www.image.ucar.edu/pub/DART/CESM/DART_SourceMods_cesm1_2_1_18Mar2014.tar"
+   echo "Download the appropriate files for CESM 1_2_1 from:"
+   echo "http://www.image.ucar.edu/pub/DART/CESM"
    echo "untar these into your HOME directory - they will create a"
-   echo "~/cesm_1_2_1  directory with the appropriate SourceMods structure."
+   echo "~/cesm1_2_1  directory with the appropriate SourceMods structure."
    exit -4
 endif
 
@@ -724,9 +730,6 @@
    # DART does not read the clm namelist input that has this information, and
    # since it is in a namelist - it can change during the course of a run - BUT
    # as discussed above, only the first settings are important. Tricky.
-   #
-   # For a HOP TEST ... hist_empty_htapes = .false.
-   # For a HOP TEST ... use a default hist_fincl1
 
    echo "dtime             = $clm_dtime"              >> ${fname}
    echo "hist_empty_htapes = .true."                  >> ${fname}
@@ -811,57 +814,58 @@
 
 set restart_time = $init_time
 
-
 # get the settings for this case from the CESM environment
 cd ${caseroot}
 source ./Tools/ccsm_getenv || exit -2
 cd ${RUNDIR}
 
 echo 'Copying the required CESM files to the run directory to rerun'
-echo 'a previous step.  CONTINUE_RUN from env_run.xml is' \$CONTINUE_RUN
-if ( \$CONTINUE_RUN == TRUE ) then
+echo 'a previous step.  CONTINUE_RUN from env_run.xml is' \${CONTINUE_RUN}
+if ( \${CONTINUE_RUN} == TRUE ) then
   echo 'so files for some later step than the initial one will be restaged.'
-  echo "Date to reset files to is: \$restart_time"
+  echo "Date to reset files to is: \${restart_time}"
 else
   echo 'so files for the initial step of this experiment will be restaged.'
-  echo "Date to reset files to is: $init_time"
+  echo "Date to reset files to is: ${init_time}"
 endif
 echo ''
 
+if ( \${CONTINUE_RUN} == TRUE ) then
 
-if ( \$CONTINUE_RUN == TRUE ) then
-
    #----------------------------------------------------------------------
    # This block copies over a set of restart files from any previous step of
    # the experiment that is NOT the initial step.
    # After running this script resubmit the job to rerun.
    #----------------------------------------------------------------------
 
-   echo "Staging restart files for run date/time: " \$restart_time
+   echo "Staging restart files for run date/time: " \${restart_time}
 
    #  The short term archiver is on, so the files we want should be in one
    #  of the short term archive 'rest' restart directories.  This assumes
    #  the long term archiver has NOT copied these files to the HPSS yet.
 
-   if (  \$DOUT_S   == TRUE ) then
+   if (  \${DOUT_S} == TRUE ) then
 
       # The restarts should be in the short term archive directory.  See
       # www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide1_2/x1565.html#running_ccsm_restarts
       # for more help and information.
 
-      if ( ! -d \$DOUT_S_ROOT/rest/\${restart_time} ) then
+      set RESTARTDIR = \${DOUT_S_ROOT}/rest/\${restart_time}
 
+      if ( ! -d \${RESTARTDIR} ) then
+
          echo "restart file directory not found: "
-         echo " \$DOUT_S_ROOT/rest/\${restart_time} "
+         echo " \${RESTARTDIR}"
          echo "If the long-term archiver is on, you may have to restore this directory first."
          echo "You can also check for either a .sta or a .sta2 hidden subdirectory in"
-         echo \$DOUT_S_ROOT
-         echo "which may contain the 'rest' directory you need."
+         echo "\${DOUT_S_ROOT}"
+         echo "which may contain the 'rest' directory you need,"
+         echo "and then modify RESTARTDIR in this script."
          exit -1
 
       endif
 
-      ${COPY} \$DOUT_S_ROOT/rest/\${restart_time}/* . || exit -1
+      ${COPY} \${RESTARTDIR}/* . || exit -1
 
    else
 

Added: DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_pmo
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_pmo	                        (rev 0)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_2_1_setup_pmo	2015-01-14 20:19:41 UTC (rev 7370)
@@ -0,0 +1,1055 @@
+#!/bin/csh -f
+#
+# DART software - Copyright 2004 - 2013 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# DART $Id$
+
+#*******************************************************************************
+#
+# ---------------------
+# Purpose
+# ---------------------
+#
+# This script is designed to set up, stage, and build a single-instance run
+# of CESM using a B compset where CAM, POP, and CLM are all active. The
+# initial state can come from a single multi-instance reference case so a
+# CESM hybrid setup is used.
+#
+# While not required for CESM, POP is configured to write out netCDF
+# restart files because they are required by DART (if you are going
+# to assimilate ocean obs).
+#
+# This script has a counterpart that is a multi-instance setup for either a
+# free run or an assimilation experiment. To make it easy to maintain (and
+# hopefully understand), the two scripts are intended to parallel each other.
+# That means this script performs a lot of manipulation of the 'instance'
+# portion of the filenames, which seems unnecessary initially.
+#
+# CESM/DART requires some modifications to the CESM source code EVEN IF YOU
+# ARE NOT USING DART. The modifications for CAM require a change to the CESM
+# ${CASE}.run script to invoke a DART script that will allow CAM to cycle
+# correctly with the source code modifications. Changing one line will
+# allow you to invoke DART.
+#
+# This script results in a viable setup for a CESM single instance experiment.
+# You are STRONGLY encouraged to run the single instance CESM a few times and
+# experiment with different settings BEFORE you try to generate 'perfect'
+# observations. You should become comfortable using CESM's restart capability
+# to re-stage files in your RUN directory.
+#
+# ${CASEROOT}/CESM_DART_config is automatically run by this script and will
+# augment the CESM case with the required setup and configuration to use DART
+# to harvest synthetic observations. CESM_DART_config will insert a few dozen

@@ Diff output truncated at 40000 characters. @@


More information about the Dart-dev mailing list