[Dart-dev] [6540] DART/trunk/models/cam/shell_scripts: Runs a single-instance configuration of CESM by default and

nancy at ucar.edu nancy at ucar.edu
Wed Oct 23 11:24:29 MDT 2013


Revision: 6540
Author:   thoar
Date:     2013-10-23 11:24:29 -0600 (Wed, 23 Oct 2013)
Log Message:
-----------
Runs a single-instance configuration of CESM by default and 
can be extended to run a perfect model experiment.
The short-term archiver now preserves obs_seq.perfect files.

Modified Paths:
--------------
    DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo
    DART/trunk/models/cam/shell_scripts/CESM_DART_config
    DART/trunk/models/cam/shell_scripts/no_assimilate.csh
    DART/trunk/models/cam/shell_scripts/st_archive.sh

-------------- next part --------------
Modified: DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo	2013-10-22 23:28:49 UTC (rev 6539)
+++ DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo	2013-10-23 17:24:29 UTC (rev 6540)
@@ -59,12 +59,12 @@
 #
 # -- Provide the CESM initial file needed by your run.
 #
-# -- Run this script. It will modify the $CASEROOT/${case}.run script to
+# -- Run this script. It will modify the $CASEROOT/${CASE}.run script to
 #    insert a block to perform the DART operations needed to create synthetic obs.
 #
 # -- Edit the DART input.nml that appears in the $CASEROOT directory.
 #
-# -- Submit the job using ${CASEROOT}/${case}.submit
+# -- Submit the job using ${CASEROOT}/${CASE}.submit
 #
 # ---------------------
 # Important features
@@ -117,8 +117,8 @@
 # ==============================================================================
 
 setenv mach         yellowstone
-setenv cesm_datadir /glade/p/cesm/cseg/inputdata
 
+setenv cesm_datadir /glade/p/cesm/cseg/inputdata
 setenv cesmroot     /glade/p/cesm/cseg/collections/$cesmtag
 setenv caseroot     /glade/p/work/${USER}/cases/${case}
 setenv exeroot      /glade/scratch/${USER}/${case}/bld
@@ -158,9 +158,10 @@
 
 setenv SingleInstanceRefcase 0
 setenv TRUTHinstance 23
-setenv stagedir /glade/p/image/CESM_initial_ensemble/rest/${run_refdate}-${run_reftod}
+setenv CAM_stagedir /glade/p/image/CESM_initial_ensemble/rest/${run_refdate}-${run_reftod}
 
-# setenv stagedir /glade/p/work/raeder/Models/CAM_init/${run_refcase}_${run_refdate}
+# alternative reference case for different times may be available here:
+# setenv CAM_stagedir /glade/p/work/raeder/Models/CAM_init/${run_refcase}_${run_refdate}
 
 # ==============================================================================
 # runtime settings
@@ -186,7 +187,6 @@
 setenv year_start    1850
 setenv year_end      2012
 
-# setenv  sst_grid ${cesm_datadir}/ocn/docn7/domain.ocn.gx1v6.090206.nc
 setenv    sst_grid ${cesm_datadir}/share/domains/domain.ocn.fv0.9x1.25_gx1v6.130409.nc
 setenv sst_dataset ${cesm_datadir}/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2011_c110307.nc
 
@@ -202,11 +202,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 (4 nodes)
-#      took less than 5 minutes on yellowstone.
+# TJH: Advancing 1 instance for 6 hours and creating synthetic obs took
+#      less than 3 minutes with 60 pes (4 nodes) on yellowstone.
 # ==============================================================================
 
-setenv ACCOUNT      P86850054
+setenv ACCOUNT      P8685xxxx
 setenv queue        economy
 setenv timewall     0:20
 
@@ -243,7 +243,7 @@
 # VAR is the shell variable name, DIR is the value
 # ==============================================================================
 
-foreach VAR ( cesmroot dartroot stagedir )
+foreach VAR ( cesmroot dartroot CAM_stagedir )
    set DIR = `eval echo \${$VAR}`
    if ( ! -d $DIR ) then
       echo "ERROR: directory '$DIR' not found"
@@ -744,7 +744,7 @@
 # the run_refdate and the time in the filenames can be unrelated.
 #----------------------------------------------------------------------
 
-set filedir = ${stagedir}
+set filedir = ${CAM_stagedir}
 
 @ inst=1
 while (\$inst <= 1)
@@ -807,16 +807,11 @@
 echo ""
 echo "3) If you want to simply advance CESM without using DART, make sure the"
 echo "   ${case}.run script references the 'no_assimilate.csh' script."
-echo "   If you want to assimilate, reference the 'assimilate.csh' script."
-echo "   The default action is to assimilate."
 echo ""
 echo "4) Verify the contents of env_run.xml and submit the CESM job:"
 echo "   ./${case}.submit"
 echo ""
-echo "5) After the job has run, check to make sure it worked and that"
-echo "   a: the right restart files exist in the run directory,"
-echo "   b: (if you're running DART) the archive dart/hist directory has the DART output,"
-echo "   c: everything is working correctly ..."
+echo "5) After the job has run, check to make sure it worked."
 echo ""
 echo "6) To extend the run in $stop_n '"$stop_option"' steps,"
 echo "   change the env_run.xml variables:"
@@ -829,6 +824,8 @@
 echo "   ./${case}.submit"
 echo ""
 
+cat ${caseroot}/DART_instructions.txt
+
 exit 0
 
 # <next few lines under version control, do not edit>

Modified: DART/trunk/models/cam/shell_scripts/CESM_DART_config
===================================================================
--- DART/trunk/models/cam/shell_scripts/CESM_DART_config	2013-10-22 23:28:49 UTC (rev 6539)
+++ DART/trunk/models/cam/shell_scripts/CESM_DART_config	2013-10-23 17:24:29 UTC (rev 6540)
@@ -288,7 +288,7 @@
 
 # ==============================================================================
 # Creating the code to add to the *.run script to call DART.
-# If there is one instance ... we MUST be running a perfect_model experiment.
+# If there is one instance ... we COULD be running a perfect_model experiment.
 # If there are many instances ... we MUST be assimilating.
 # The number of instances dictates what DART script will be used.
 # ==============================================================================
@@ -311,8 +311,14 @@
 
 grep 'SUCCESSFUL TERMINATION' $CplLogFile
 if ( $status == 0 ) then
-   ${CASEROOT}/DARTSCRIPTNAME
 
+   # If you want to simply run CESM, use 'no_assimilate.csh'
+   # If you want to use DART , use 'DARTSCRIPTNAME'
+   # You can only use one of the two.
+
+   ${CASEROOT}/no_assimilate.csh
+#  ${CASEROOT}/DARTSCRIPTNAME
+
    if ( $status == 0 ) then
       echo "`date` -- DART HAS FINISHED"
    else
@@ -338,11 +344,13 @@
 # modify the "here" document to call the logical DART script.
 
 if ( $num_instances == 1 ) then
-   sed -e "s#DARTSCRIPTNAME#perfect_model.csh#" < temp.$$ >! add_to_run.txt
+   set DARTscript = perfect_model.csh
 else
-   sed -e "s#DARTSCRIPTNAME#no_assimilate.csh#" < temp.$$ >! add_to_run.txt
+   set DARTscript = assimilate.csh
 endif
 
+sed -e "s#DARTSCRIPTNAME#${DARTscript}#" < temp.$$ >! add_to_run.txt
+
 # Now that the "here" document is created,
 # determine WHERE to insert it -- ONLY IF it is not already there.
 
@@ -382,25 +390,39 @@
 # What to do next
 # ==============================================================================
 
-echo "Time to check the DART configuration:"
-echo ""
-echo "1) Modify what you need to in the DART namelists. These are "
-echo "   ${CASEROOT}/input.nml"
-echo ""
-echo "2) If you have recompiled any part of the DART system, 'refresh_dart_files'"
-echo "   will copy them into the correct places."
-echo ""
-echo "3) Make sure the observation directory names in assimilate.csh match"
-echo "   those on your system, and submit the CESM job in the normal way."
-echo ""
-echo "4) Inflation files? Observation files for the time of interest?"
-echo ""
-echo "5) Make sure the ${CASE}.run script calls 'assimilate.csh' if you desire."
-echo "   The default behavior is to _not_ invoke DART and simply run CESM."
-echo ""
-echo "6) You can use ${CASEROOT}/stage_cesm_files"
-echo "    to stage files to restart a run." 
 
+cat << EndOfText >! DART_instructions.txt
+
+------------------------------------------------------------
+
+Check the DART configuration:
+
+1) The default behavior is to _not_ invoke DART and simply run CESM.
+   We recommend that you make sure this works before proceeding.
+
+2) When you want to run DART, edit the ${CASE}.run script to
+   reference "$DARTscript" instead of "no_assimilate.csh".
+
+3) Modify what you need to in the DART namelists. These are 
+   ${CASEROOT}/input.nml
+
+4) If you have recompiled any part of the DART system, 'refresh_dart_files'
+   will copy them into the correct places.
+
+5) Make sure the observation directory names in $DARTscript match
+   those on your system, and submit the CESM job in the normal way.
+
+6) Inflation files? Observation files for the time of interest?
+
+7) You can use ${CASEROOT}/stage_cesm_files
+    to stage files to restart a run.
+
+------------------------------------------------------------
+
+EndOfText
+
+cat DART_instructions.txt
+
 exit 0
 
 # <next few lines under version control, do not edit>

Modified: DART/trunk/models/cam/shell_scripts/no_assimilate.csh
===================================================================
--- DART/trunk/models/cam/shell_scripts/no_assimilate.csh	2013-10-22 23:28:49 UTC (rev 6539)
+++ DART/trunk/models/cam/shell_scripts/no_assimilate.csh	2013-10-23 17:24:29 UTC (rev 6540)
@@ -33,8 +33,12 @@
 # of the form "./${CASE}.cam_${ensemble_member}.i.2000-01-06-00000.nc"
 #-------------------------------------------------------------------------
 
-set FILE = `head -n 1 rpointer.atm_0001`
-set FILE = $FILE:t
+if ( $ensemble_size == 1 ) then
+   set FILE = `head -n 1 rpointer.atm`
+else
+   set FILE = `head -n 1 rpointer.atm_0001`
+endif
+
 set FILE = $FILE:r
 set ATM_DATE_EXT = `echo $FILE:e`
 
@@ -44,19 +48,20 @@
 # the short-term archiver 'restores' the CESM files, the links are right.
 #=========================================================================
 
-set member = 1
-while ( ${member} <= ${ensemble_size} )
+if ( $ensemble_size == 1 ) then
+      set inst_string = ''
+      set ATM_INITIAL_FILENAME = ${CASE}.cam${inst_string}.i.${ATM_DATE_EXT}.nc
+      ${LINK} ${ATM_INITIAL_FILENAME}    cam_initial${inst_string}.nc || exit -9
+else
+   set member = 1
+   while ( ${member} <= ${ensemble_size} )
+      set inst_string = `printf _%04d $member`
+      set ATM_INITIAL_FILENAME = ${CASE}.cam${inst_string}.i.${ATM_DATE_EXT}.nc
+      ${LINK} ${ATM_INITIAL_FILENAME}    cam_initial${inst_string}.nc || exit -9
+      @ member++
+   end
+endif
 
-   set inst_string = `printf _%04d $member`
-
-   set ATM_INITIAL_FILENAME = ${CASE}.cam${inst_string}.i.${ATM_DATE_EXT}.nc
-
-   ${LINK} ${ATM_INITIAL_FILENAME} cam_initial${inst_string}.nc || exit -9
-
-   @ member++
-
-end
-
 echo "`date` -- END CAM_NO_ASSIMILATE"
 
 exit 0

Modified: DART/trunk/models/cam/shell_scripts/st_archive.sh
===================================================================
--- DART/trunk/models/cam/shell_scripts/st_archive.sh	2013-10-22 23:28:49 UTC (rev 6539)
+++ DART/trunk/models/cam/shell_scripts/st_archive.sh	2013-10-23 17:24:29 UTC (rev 6540)
@@ -2,6 +2,7 @@
 #
 # This code is part of the CESM distribution,
 # So it is not protected by the DART copyright agreement.
+#
 # DART $Id$
 
 #short-term archive script - move model output out of run directory
@@ -149,6 +150,7 @@
 set *Posterior_Diag.*.nc;                                                                                             dispose ifiles_n ${sta}/dart/hist $*
 set *obs_seq.*.out;                                                                                                   dispose ifiles_n ${sta}/dart/hist $*
 set *obs_seq.*.final;                                                                                                 dispose ifiles_n ${sta}/dart/hist $*
+set *obs_seq.*.perfect;                                                                                               dispose ifiles_n ${sta}/dart/hist $*
 set *pr*inflate_restart*;  latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null;   dispose ifiles_n ${sta}/dart/rest $*
 set *po*inflate_restart*;  latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null;   dispose ifiles_n ${sta}/dart/rest $*
 
@@ -158,7 +160,6 @@
 do
     get_inst_suffix $IDX $NINST_ATM
     set atm${inst_suffix}.log.*;                                                                                                   dispose ifiles_n ${sta}/atm/logs $*
-#   set cam_initial_${IDX}.nc;            latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_n ${sta}/atm/rest $*
     set ${CASE}.cam*${inst_suffix}.r.*;   latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/atm/rest $*
     set ${CASE}.cam*${inst_suffix}.rs.*;  latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/atm/rest $*
     set ${CASE}.cam*${inst_suffix}.ra.*;  latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/atm/rest $*
@@ -280,7 +281,6 @@
     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 $*
-
     set ${CASE}.docn${inst_suffix}.r.* ;              latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
     set ${CASE}.docn${inst_suffix}.rs* ;              latest=`ls -rt $* 2> /dev/null | tail -1`; mv $latest ${sta}/rest/${dname} 2> /dev/null; dispose ifiles_y ${sta}/ocn/rest $*
     set ${CASE}.docn${inst_suffix}.h.* ;                                                                                                       dispose ifiles_n ${sta}/ocn/hist $*


More information about the Dart-dev mailing list