[Dart-dev] [5953] DART/branches/development/models/clm/shell_scripts: This works with the CESM1_1 'stock' distribution on yellowstone.

nancy at ucar.edu nancy at ucar.edu
Fri Feb 1 11:54:16 MST 2013


Revision: 5953
Author:   thoar
Date:     2013-02-01 11:54:15 -0700 (Fri, 01 Feb 2013)
Log Message:
-----------
This works with the CESM1_1 'stock' distribution on yellowstone.

Modified Paths:
--------------
    DART/branches/development/models/clm/shell_scripts/CESM1_1_setup.csh
    DART/branches/development/models/clm/shell_scripts/assimilate.csh
    DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Precip_template
    DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Solar_template
    DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip_template

-------------- next part --------------
Modified: DART/branches/development/models/clm/shell_scripts/CESM1_1_setup.csh
===================================================================
--- DART/branches/development/models/clm/shell_scripts/CESM1_1_setup.csh	2013-01-28 23:41:57 UTC (rev 5952)
+++ DART/branches/development/models/clm/shell_scripts/CESM1_1_setup.csh	2013-02-01 18:54:15 UTC (rev 5953)
@@ -28,63 +28,61 @@
 #    and an execution directory, where each forecast and assimilation will
 #    take place.  The short term archiver will use a third directory for
 #    storage of model output until it can be moved to long term storage (HPSS)
-# -- Examin the whole script to identify things to change for your experiments.
+# -- Examine the whole script to identify things to change for your experiments.
 # -- Provide any initial files needed by your run:
 #       inflation
-#       sampling error correction
 #       CAM/CLM/CICE initial ensemble
 #       ...
 # -- Run this script.
-# -- Edit the DART input.nml that appears in the $caseroot directory.
-# -- Submit the job using $caseroot/${case}.${mach}.submit
-#      ($mach may not be needed for cesm releases after cesm1_1_beta04)
+# -- Edit the DART input.nml that appears in the $CASEROOT directory.
+# -- Submit the job using $CASEROOT/${case}.submit
 #
 # ---------------------
 # Important features
 # ---------------------
 #
 # If you want to change something in your case other than the runtime
-# settings, you need to delete everything and start the run from scratch.
+# settings, it is safest to delete everything and start the run from scratch.
+# For the brave, read
 #
-# ./${CASENAME}.*.clean_build
-# ./configure -cleanall
+# http://www.cesm.ucar.edu/models/cesm1.1/cesm/doc/usersguide/x1142.html
 #
-# ====================================================================
+# and you may be able to salvage something with
+# ./cesm_setup -clean
+# ./${CASENAME}.clean_build
+#
+# ==============================================================================
 # ====  Set case options
-# ====================================================================
+# ==============================================================================
 
 # case will be used many ways;
 #    directory and file names, both locally and on HPSS, and
 #    script names; so consider it's length and information content.
 # num_instances:  Number of ensemble members
-# reuse_existing_case:
-#    false; Remove $caseroot and $exeroot and rebuild
-#    true;  configure -cleannamelist
 
 setenv case                 clm_cesm1_1
 setenv compset              I_2000_CN
 setenv cesmtag              cesm1_1
 setenv resolution           f19_f19
 setenv num_instances        4
-setenv reuse_existing_case  false
 
-# ====================================================================
+# ==============================================================================
 # define machines and directories
 #
 # mach            Computer name
 # cesm_datadir    Root path of the public CESM data files
 # cesmroot        Location of the cesm code base
-#                 For cesm1_1_beta04 on yellowstone, MUST use 'thoar' value provided.
 # DARTroot        Location of DART code tree.
 #                    Executables, scripts and input in $DARTroot/models/dev/...
 # caseroot        Your (future) cesm case directory, where this CESM+DART will be built.
 #                    Preferably not a frequently scrubbed location.
-#                 caseroot will be deleted if reuse_existing_case is false (below)
-#                 So this script, and other useful things should be kept elsewhere.
-# exeroot         (Future) Run-time directory; scrubbable, large amount of space needed.
+#                    This script will delete any existing caseroot, so this script, 
+#                    and other useful things should be kept elsewhere.
+# rundir          (Future) Run-time directory; scrubbable, large amount of space needed.
+# exeroot         (Future) directory for executables - scrubbable, large amount of space needed.
 # archdir         (Future) Short-term archive directory
 #                    until the long-term archiver moves it to permanent storage.
-# ====================================================================
+# ==============================================================================
 
 setenv mach         yellowstone
 setenv cesm_datadir /glade/p/cesm/cseg/inputdata
@@ -97,8 +95,18 @@
 setenv DARTroot     /glade/u/home/${USER}/svn/DART/dev
 
 # ==============================================================================
+# The initial ensemble can be set by specifying the 'finidat' variable in the
+# user_nl_clm_${instance}. A FULL pathname to the file is required. This is nice
+# for two reasons - one is that you don't need to copy the files and rename them
+# (tedious), the second is that the full pathname provides a means of tracking 
+# the origin of the initial ensemble.
+# ==============================================================================
+
+set stagedir = /glade/scratch/afox/bptmp/MD_40_PME/run/MD_40_PME
+
+# ==============================================================================
 # configure settings
-# ====================================================================
+# ==============================================================================
 
 setenv stream_year_first 2000
 setenv stream_year_last  2000
@@ -109,34 +117,35 @@
 setenv run_reftod  00000
 setenv run_refdate $refyear-$refmon-$refday
 
-# ====================================================================
+# ==============================================================================
 # runtime settings --  How many assimilation steps will be done after this one
 #
 # stop_option   Units for determining the forecast length between assimilations
 #               Changing stop_option requires changes to user_nl_clm below.
 # stop_n        Number of time units in the forecast
-# ====================================================================
+# ==============================================================================
 
 setenv resubmit      4
 setenv stop_option   nhours
 setenv stop_n        24
 
-# ====================================================================
+# ==============================================================================
 # job settings
 #
 # timewall   can be changed during a series by changing the ${case}.run
 # queue      can be changed during a series by changing the ${case}.run
 #
 # TJH How many f19_f19 CLM instances can fit on 1 'regular' node?
-# ====================================================================
+# ==============================================================================
 
-setenv proj         P86850054
-setenv timewall     0:29
+setenv ACCOUNT      P86850054
+setenv timewall     0:10
 setenv queue        premium
+setenv ptile        30
 
-# ====================================================================
+# ==============================================================================
 # set these standard commands based on the machine you are running on.
-# ====================================================================
+# ==============================================================================
 
 switch ("`hostname`")
    case be*:
@@ -159,16 +168,14 @@
    breaksw
 endsw
 
-
-# ====================================================================
+# ==============================================================================
 # Create the case.
 #
 # For list of the pre-defined cases: ./create_newcase -list
 # To create a variant case, see the CESM documentation and carefully
 # incorporate any needed changes into this script.
-# ====================================================================
+# ==============================================================================
 
-if ("${reuse_existing_case}" == "false") then
    echo "removing old files from ${caseroot}"
    echo "removing old files from ${exeroot}"
    echo "removing old files from ${rundir}"
@@ -182,34 +189,18 @@
       echo "ERROR: Case could not be created."
       exit 1
    endif
-else
-   cd ${caseroot}
-   ./configure -cleannamelist
-   ./configure -cleanmach
 
-endif
+# ==============================================================================
+# Configure the case - this creates the CASEROOT directory.
+# ==============================================================================
 
-# ====================================================================
-# Configure the case.
-# ====================================================================
-
 cd ${caseroot}
 
-# This is just for debug purposes
+# Save a copy for debug purposes
 foreach FILE ( *xml )
-   cp $FILE ${FILE}.original
+   ${COPY} $FILE ${FILE}.original
 end
 
-
-# The river transport model ON is useful only when using an active ocean or
-# land surface diagnostics. The biogeochemistry should also be turned (back) on.
-# If you have 'CN' in the compset name, CLM_CONFIG_OPTS defaults properly.
-# since we are turning off the RTM, we need to turn back on "the right thing".
-# ./xmlchange -file env_build.xml -id CLM_CONFIG_OPTS -val '-rtm off -bgc cn'
-#
-./xmlchange CLM_CONFIG_OPTS='-bgc cn'
-./xmlchange ROF_GRID='null'
-
 @ total_nt = 128
 @ atm_pes  = $total_nt
 @ cpl_pes  = $total_nt / 8
@@ -224,6 +215,7 @@
 echo "CPL gets $cpl_pes"
 echo "ICE gets $ice_pes"
 echo "OCN gets $ocn_pes"
+echo "ROF gets $rof_pes"
 echo "LND gets $lnd_pes"
 echo ""
 
@@ -236,17 +228,17 @@
 ./xmlchange NTHRDS_CPL=1,NTASKS_CPL=$cpl_pes
 
 # http://www.cesm.ucar.edu/models/cesm1.1/cesm/doc/usersguide/c1158.html#run_start_stop
-# "A hybrid run indicates that CESM is initialized more like a startup, but uses 
-# initialization datasets from a previous case. This is somewhat analogous to a 
-# branch run with relaxed restart constraints. A hybrid run allows users to bring 
-# together combinations of initial/restart files from a previous case (specified 
-# by $RUN_REFCASE) at a given model output date (specified by $RUN_REFDATE). 
-# Unlike a branch run, the starting date of a hybrid run (specified by $RUN_STARTDATE) 
-# can be modified relative to the reference case. In a hybrid run, the model does not 
-# continue in a bit-for-bit fashion with respect to the reference case. The resulting 
-# climate, however, should be continuous provided that no model source code or 
-# 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), 
+# "A hybrid run indicates that CESM is initialized more like a startup, but uses
+# initialization datasets from a previous case. This is somewhat analogous to a
+# branch run with relaxed restart constraints. A hybrid run allows users to bring
+# together combinations of initial/restart files from a previous case (specified
+# by $RUN_REFCASE) at a given model output date (specified by $RUN_REFDATE).
+# Unlike a branch run, the starting date of a hybrid run (specified by $RUN_STARTDATE)
+# can be modified relative to the reference case. In a hybrid run, the model does not
+# continue in a bit-for-bit fashion with respect to the reference case. The resulting
+# climate, however, should be continuous provided that no model source code or
+# 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.
 
 ./xmlchange RUN_TYPE=startup
@@ -256,6 +248,8 @@
 ./xmlchange RUN_REFTOD=$run_reftod
 ./xmlchange BRNCH_RETAIN_CASENAME=TRUE
 ./xmlchange GET_REFCASE=FALSE
+./xmlchange CALENDAR=GREGORIAN
+./xmlchange EXEROOT=${exeroot}
 
 ./xmlchange STOP_OPTION=$stop_option
 ./xmlchange STOP_N=$stop_n
@@ -275,19 +269,24 @@
 ./xmlchange DATM_CPLHIST_YR_START=$refyear
 ./xmlchange DATM_CPLHIST_YR_END=$refyear
 
-#./xmlchange USE_ESMF_LIB=TRUE
-#./xmlchange ESMF_LIBDIR=${nancy_scratch}/esmf-mpi
+# 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.
 
-./xmlchange CALENDAR=GREGORIAN
-./xmlchange EXEROOT=${exeroot}
+./xmlchange ROF_GRID='null'
 
-# ====================================================================
-# Configure
-# ====================================================================
+# ==============================================================================
+# Set up the case.
+# This creates the EXEROOT and RUNDIR directories.
+# ==============================================================================
 
 ./cesm_setup
 
-# ====================================================================
+if ( $status != 0 ) then
+   echo "ERROR: Case could not be set up."
+   exit 2
+endif
+
+# ==============================================================================
 # Create namelist template: user_nl_clm
 # Example user_nl_clm namelist adding and removing fields on primary history file
 # hist_fincl1 = 'COSZEN', 'DECL'
@@ -304,7 +303,7 @@
 # The fincl2 history tape has the half-hourly flux tower observations.
 # The observation operators in obs_def_tower_mod.f90
 # are going to read from the .h1. history file for these values.
-# ====================================================================
+# ==============================================================================
 
 @ inst = 1
 while ($inst <= $num_instances)
@@ -322,20 +321,20 @@
    echo "          'datm.streams.txt.CPLHIST3HrWx.Precip_$instance            $stream_year_align $stream_year_first $stream_year_last'," >> $fname
    echo "          'datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip_$instance $stream_year_align $stream_year_first $stream_year_last'"  >> $fname
    echo "taxmode = 'cycle','cycle','cycle'"          >> $fname
-   echo "tintalgo = 'coszen','coszen','coszen'"      >> $fname
+   echo "tintalgo = 'coszen','nearest','linear'"     >> $fname
    echo "restfils = 'unset'"                         >> $fname
    echo "restfilm = 'unset'"                         >> $fname
 
    # Customize the land namelists
-   # Initially, just use the default restart files ... then move to
-   # something ... specify in finidat?
+   # The initial ensemble can be set by specifying the 'finidat' variable in the
+   # user_nl_clm_${instance}. A FULL pathname to the file is required. This is nice
+   # for two reasons - one is that you don't need to copy the files and rename them
+   # (tedious), the second is that the full pathname provides a means of tracking 
+   # the origin of the initial ensemble.
 
    set fname = "user_nl_clm_$instance"
 
-   set stagedir = /glade/scratch/afox/bptmp/MD_40_PME/run/MD_40_PME
-
-
-#  echo "finidat = '${stagedir}.clm2_$instance.r.${run_refdate}-${run_reftod}.nc'" >> $fname
+   echo "finidat = '${stagedir}.clm2_$instance.r.${run_refdate}-${run_reftod}.nc'" >> $fname
    echo "hist_empty_htapes = .false."                >> $fname
    echo "hist_fincl1 = 'NEP'"                        >> $fname
    echo "hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R'"  >> $fname
@@ -352,120 +351,162 @@
 #  obtain the contents of the stream txt files in CaseDocs, and then place a copy
 #  of the modified stream txt file in $CASEROOT with the string user_ prepended."
 #
-# -or- 
+# -or-
 #
-# we copy a template stream txt file from the 
+# we copy a template stream txt file from the
 # $DARTroot/models/POP/shell_scripts directory and modify one for each instance.
 #
 # ==============================================================================
 
 ./preview_namelists
 
-# This gives us the right number of stream files
+# This gives us a stream txt file for each instance that we can
+# modify for our own purpose.
 
 foreach FILE (CaseDocs/*streams*)
    set FNAME = $FILE:t
 
    switch ( ${FNAME} )
       case *presaero*:
-         echo "Skipping prescribed aerosol stream txt file." 
+         echo "Skipping prescribed aerosol stream txt file."
          breaksw
-      default:  
-         cp -v $FILE user_$FNAME
-         chmod 644   user_$FNAME
+      default:
+         ${COPY} $FILE user_$FNAME
+         chmod   644   user_$FNAME
          breaksw
    endsw
 
 end
 
-# This gives us the right number of stream files
+# Replace each default stream txt file with one that uses the CAM DATM
+# conditions for a default year a the instance number.
 
-foreach FILE (user*streams*)
-   set FNAME = $FILE
-   set name_parse = `echo $FNAME:q | sed 's/\_/ /g'`
+foreach FNAME (user*streams*)
+   set name_parse = `echo $FNAME | sed 's/\_/ /g'`
+   @ instance_index = $#name_parse
+   @ filename_index = $#name_parse - 1
+   set instance   = $name_parse[$instance_index]
+   set streamname = $name_parse[$filename_index]
 
-   if ($#name_parse == 3) then
+   if (-e $DARTroot/models/clm/shell_scripts/user_$streamname*template) then
 
-      set instance = $name_parse[3]
-      if (-e $DARTroot/models/clm/shell_scripts/*$name_parse[2]*template) then
-         echo "Copying over DART template for $FNAME and changing instances"
-         cp $DARTroot/models/clm/shell_scripts/*$name_parse[2]*template $FNAME
-         sed s/ninst/$instance/g $FNAME >! out
-         mv out $FNAME
-      else
-         echo "Looking for multi-instance template for $FNAME"
-      endif
+      echo "Copying DART template for $FNAME and changing instances, refyear"
 
-   else 
+      ${COPY} $DARTroot/models/clm/shell_scripts/user_$streamname*template $FNAME
 
-      echo "Looking for template for $FNAME"
-      if (-e $DARTroot/models/clm/shell_scripts/${FNAME}_template) then
-         echo "Copying over the DART template for $FNAME"
-         cp  $DARTroot/models/clm/shell_scripts/${FNAME}_template $FNAME
-      else
-         echo "WARNING: cannot find DART template for $FNAME"
-         echo "WARNING: cannot find DART template for $FNAME"
-         exit 7
-      endif
+      sed s/NINST/$instance/g   $FNAME >! out
+      sed s/REFYEAR/$refyear/g  out    >! $FNAME
+      \rm -f out
 
+   else
+      echo "DIED Looking for a DART stream txt template for $FNAME"
+      echo "DIED Looking for a DART stream txt template for $FNAME"
+      exit 3
    endif
+
 end
 
 ./preview_namelists
 
-# ====================================================================
+# ==============================================================================
 # Update source files if need be
 #    Ideally, using DART will not require any source mods.
 #    Until then, this script accesses source mods from a hard-wired location below.
 #    Those may eventually be packaged into the DART repository.
 #    If you have additional source mods, they will need to be merged into any DART
 #    mods and put in the SourceMods subdirectory found in the 'case' directory.
-# ====================================================================
+# ==============================================================================
 
-# this one needs a recursive copy to get all the files in the subdirs
-#  ${COPY} -r  ~thoar/${cesmtag}/SourceMods/* ${caseroot}/SourceMods/
-#if ( $status == 0) then
-#   echo "FYI - Local Source Modifications used for this case:"
-#   ls -lr ${caseroot}/SourceMods/*
-#else
-#   echo "FYI - No SourceMods for this case"
-#endif
+if ( -d ~/${cesmtag}/SourceMods ) then
+   ${COPY} -r  ~/${cesmtag}/SourceMods/* ${caseroot}/SourceMods/
+else 
+   echo "FYI - No SourceMods for this case"
+endif
 
-# ====================================================================
+# ==============================================================================
 # build
-# ====================================================================
+# ==============================================================================
 
 echo ''
 echo 'Building the case'
 echo ''
 
-./$case.build
+./${case}.build
 
 if ( $status != 0 ) then
    echo "ERROR: Case could not be built."
-   exit 3
+   exit 4
 endif
 
-# ====================================================================
-# Stage the required parts of DART in the caseroot directory.
-# ====================================================================
+# ==============================================================================
+# IF NEED BE : Stage the restarts now that the run directory exists
+# The initial ensemble can be set by specifying the 'finidat' variable in the
+# user_nl_clm_${instance}. A FULL pathname to the file is required. This is nice
+# for two reasons - one is that you don't need to copy the files and rename them
+# (tedious), the second is that the full pathname provides a means of tracking 
+# the origin of the initial ensemble. If you choose to copy and rename them,
+# here is some code that may help.  Use at your own risk.
+# ==============================================================================
 
-if ("${reuse_existing_case}" == "false") then
-   ${MOVE} Tools/st_archive.sh Tools/st_archive.sh.orig
-endif
-${COPY} ${DARTroot}/models/clm/shell_scripts/st_archive.sh Tools/
-# ${COPY} ${DARTroot}/models/clm/shell_scripts/datm.buildnml.csh Buildconf/
+# set stagedir = /glade/scratch/afox/bptmp/MD_40_PME/run
 
-${COPY} ${DARTroot}/models/clm/work/input.nml                .
+# echo ''
+# echo "Copying the restart files from ${stagedir}"
+# echo ''
+#
+# @ n = 1
+# while ($n <= $num_instances)
+#
+#    echo "Staging restarts for instance $n of $num_instances"
+#
+#    set LANDFILE = `printf ${stagedir}/MD_40_PME.clm2_%04d.r.2000-01-31-00000.nc $n`
+#    set LND_RESTART_FILENAME = `printf "${case}.clm2_%04d.r.%04d-%02d-%02d-%05d.nc" $n $refyear $refmon $refday $run_reftod`
+#
+#    ${COPY} ${LANDFILE} ${rundir}/${LND_RESTART_FILENAME}
+#
+#    @ n++
+# end
 
-# ====================================================================
+# ==============================================================================
+# Edit the run script to reflect project, queue, and wallclock
+# ==============================================================================
+
+echo ''
+echo 'Updating the run script to set wallclock and queue.'
+echo ''
+
+${COPY} ${case}.run ${case}.run.orig
+
+source Tools/ccsm_getenv
+set BATCH = `echo $BATCHSUBMIT | sed 's/ .*$//'`
+switch ( $BATCH )
+   case bsub*:
+      # NCAR "bluefire", "yellowstone"
+      sed s/ptile=32/ptile=$ptile/ < ${case}.run >! temp
+      ${MOVE} temp  ${case}.run
+
+      set TIMEWALL=`grep BSUB ${case}.run | grep -e '-W' `
+      sed s/$TIMEWALL[3]/$timewall/ < ${case}.run >! temp
+      ${MOVE} temp  ${case}.run
+
+      set QUEUE=`grep BSUB ${case}.run | grep -e '-q' `
+      sed s/$QUEUE[3]/$queue/ < ${case}.run >! temp
+      ${MOVE} temp  ${case}.run
+   breaksw
+
+   default:
+
+   breaksw
+endsw
+
+# ==============================================================================
 # The *.run script must be modified to call the DART assimilate script.
 # The modifications are contained in a "here" document that MUST NOT
 # expand the wildcards etc., before it is run. This is achieved by
 # double-quoting the characters used to delineate the start/stop of
 # the "here" document. No kidding. It has to be "EndOfText",
 # not 'EndOfText' or EndOfText.
-# ====================================================================
+# ==============================================================================
 
 echo ''
 echo 'Adding the call to assimilate.csh to the *.run script.'
@@ -480,26 +521,29 @@
 
 set CplLogFile = `ls -1t cpl.log* | head -n 1`
 if ($CplLogFile == "") then
- echo 'ERROR: Model did not complete - no cpl.log file present - exiting'
- echo 'ERROR: Assimilation will not be attempted.'
- exit -4
+   echo 'ERROR: Model did not complete - no cpl.log file present - exiting.'
+   echo 'ERROR: Assimilation will not be attempted.'
+   exit 1
 endif
 
 grep 'SUCCESSFUL TERMINATION' $CplLogFile
 if ( $status == 0 ) then
-  ${CASEROOT}/assimilate.csh
+   ${CASEROOT}/assimilate.csh
 
-  if ( $status == 0 ) then
-     echo "`date` -- DART HAS FINISHED"
-  else
-     echo "`date` -- DART FILTER ERROR - ABANDON HOPE"
-     exit -5
-  endif
+   if ( $status == 0 ) then
+      echo "`date` -- DART HAS FINISHED"
+   else
+      echo "`date` -- DART FILTER ERROR - ABANDON HOPE"
+      exit 3
+   endif
+else
+   echo 'ERROR: Model did not complete successfully - exiting.'
+   echo 'ERROR: Assimilation will not be attempted.'
+   exit 2
 endif
 
 # END OF DART BLOCK
 # -------------------------------------------------------------------------
-
 "EndOfText"
 
 # Now that the "here" document is created,
@@ -519,85 +563,47 @@
    @ keep = $MYSTRING[1]
    @ lastlines = $origlen - $keep
 
-   mv ${case}.run ${case}.run.orig
+   head -n $keep      ${case}.run    >! temp.$$
+   cat                add_to_run.txt >> temp.$$
+   tail -n $lastlines ${case}.run    >> temp.$$
 
-   head -n $keep      ${case}.run.orig >! ${case}.run
-   cat                add_to_run.txt   >> ${case}.run
-   tail -n $lastlines ${case}.run.orig >> ${case}.run
+   ${MOVE} temp.$$ ${case}.run
 
 endif
 
-# ====================================================================
-# Edit the run script to reflect project, queue, and wallclock
-# ====================================================================
+chmod 0744 ${case}.run
 
-echo ''
-echo 'Updating the run script to set project number, wallclock, and queue.'
-echo ''
+# ==============================================================================
+# Stage the required parts of DART in the CASEROOT directory.
+# ==============================================================================
 
-set PROJ=`grep BSUB $case.run | grep -e '-P' `
-sed s/$PROJ[3]/$proj/ < $case.run >! temp
-${MOVE} temp  $case.run
+if ( ~ -e  Tools/st_archive.sh.orig ) then
+   ${MOVE} Tools/st_archive.sh      Tools/st_archive.sh.orig
+else
+   echo "a Tools/st_archive.sh backup copy already exists"
+endif
 
-set TIMEWALL=`grep BSUB $case.run | grep -e '-W' `
-sed s/$TIMEWALL[3]/$timewall/ < $case.run >! temp
-${MOVE} temp  $case.run
+${COPY} ${DARTroot}/models/clm/shell_scripts/st_archive.sh   Tools/
+${COPY} ${DARTroot}/models/clm/shell_scripts/assimilate.csh  assimilate.csh
+${COPY} ${DARTroot}/models/clm/work/input.nml                input.nml
 
-set QUEUE=`grep BSUB $case.run | grep -e '-q' `
-sed s/$QUEUE[3]/$queue/ < $case.run >! temp
-${MOVE} temp  $case.run
-
-chmod 0744 $case.run
-
-# ====================================================================
+# ==============================================================================
 # Stage the required parts of DART in the execution root directory,
 # now that EXEROOT exists.
-# ====================================================================
+# ==============================================================================
 
-foreach FILE ( filter clm_to_dart dart_to_clm input.nml )
+foreach FILE ( filter clm_to_dart dart_to_clm )
    ${COPY} ${DARTroot}/models/clm/work/${FILE} ${exeroot}/
    if ( $status != 0 ) then
       echo "ERROR: ${DARTroot}/models/clm/work/${FILE} not copied to ${exeroot}"
       echo "ERROR: ${DARTroot}/models/clm/work/${FILE} not copied to ${exeroot}"
-      exit 3
+      exit 5
    endif
 end
 
-${COPY} ${DARTroot}/models/clm/shell_scripts/assimilate.csh  assimilate.csh
-
-# ====================================================================
-# Stage the restarts now that the run directory exists
-# ====================================================================
-#
-# obs sequences files: /ptmp/yfzhang/Obs_seqs
-
-# 20000501 ... /ptmp/afox/MD_40_PME/run
-set stagedir = /glade/scratch/afox/bptmp/MD_40_PME/run
-
-# 20021101 ... /ptmp/yfzhang/inputdata_cam/lnd/clm2/initdata
-# set stagedir = /ptmp/yfzhang/inputdata_cam/lnd/clm2/initdata
-
-echo ''
-echo "Copying the restart files from ${stagedir}"
-echo ''
-
-@ n = 1
-while ($n <= $num_instances)
-
-#   echo "Staging restarts for instance $n of $num_instances"
-
-#  set LANDFILE = `printf ${stagedir}/init1998.clm2_%04d.r.2002-11-01-00000.nc $n`
-   set LANDFILE = `printf ${stagedir}/MD_40_PME.clm2_%04d.r.2000-01-31-00000.nc $n`
-   set LND_RESTART_FILENAME = `printf "${case}.clm2_%04d.r.%04d-%02d-%02d-%05d.nc" $n $refyear $refmon $refday $run_reftod`
-
-#   ${COPY} ${LANDFILE} ${exeroot}/run/${LND_RESTART_FILENAME}
-
- @ n++
-end
-
-# ====================================================================
+# ==============================================================================
 # What to do next
-# ====================================================================
+# ==============================================================================
 
 echo ''
 echo 'Time to check the case.'
@@ -605,6 +611,6 @@
 echo 'Modify what you like in input.nml, make sure the observation directory'
 echo 'names set in assimilate.csh match those on your system, and submit'
 echo 'the CESM job by running:'
-echo "./$case.submit"
+echo "./${case}.submit"
 echo ''
 

Modified: DART/branches/development/models/clm/shell_scripts/assimilate.csh
===================================================================
--- DART/branches/development/models/clm/shell_scripts/assimilate.csh	2013-01-28 23:41:57 UTC (rev 5952)
+++ DART/branches/development/models/clm/shell_scripts/assimilate.csh	2013-02-01 18:54:15 UTC (rev 5953)
@@ -15,8 +15,8 @@
 switch ("`hostname`")
    case be*:
       # NCAR "bluefire"
-# The FORCE options are not optional.
-# the VERBOSE options are useful for debugging.
+      # The FORCE options are not optional.
+      # the VERBOSE options are useful for debugging.
       set   MOVE = '/usr/local/bin/mv -fv'
       set   COPY = '/usr/local/bin/cp -fv --preserve=timestamps'
       set  FLINK = '/usr/local/bin/ln -fvs'
@@ -28,6 +28,21 @@
       set LAUNCHCMD  = mpirun.lsf
    breaksw
 
+   case ys*:
+      # NCAR "yellowstone"
+      # The FORCE options are not optional.
+      # the VERBOSE options are useful for debugging.
+      set   MOVE = 'mv -fv'
+      set   COPY = 'cp -fv --preserve=timestamps'
+      set  FLINK = 'ln -fvs'
+      set   LINK = 'ln -vs'
+      set REMOVE = 'rm -fr'
+
+      set BASEOBSDIR = /glade/p/image/Observations/FluxTower
+      set DARTDIR    = ${HOME}/svn/DART/dev
+      set LAUNCHCMD  = mpirun.lsf
+   breaksw
+
    default:
       # NERSC "hopper"
       set   MOVE = 'mv -fv'
@@ -130,7 +145,7 @@
 set  MYSTRING = `grep sampling_error_correction input.nml`
 set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
 set  MYSTRING = `echo $MYSTRING | sed -e 's#"# #g'`
-set SECSTRING = `echo $MYSTRING[2] | tr 'A-Z' 'a-z'`
+set SECSTRING = `echo $MYSTRING[2] | tr '[:upper:]' '[:lower:]'`
 
 if ( $SECSTRING == true ) then
    set SAMP_ERR_FILE = ${DARTDIR}/system_simulation/final_full_precomputed_tables/final_full.${ensemble_size}
@@ -181,31 +196,31 @@
 #=========================================================================
 
 set  MYSTRING = `grep inf_flavor input.nml`
-set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,]# #g"`
+set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
 set  PRIOR_INF = $MYSTRING[2]
 set  POSTE_INF = $MYSTRING[3]
 
 set  MYSTRING = `grep inf_initial_from_restart input.nml`
-set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,]# #g"`
-set  PRIOR_TF = `echo $MYSTRING[2] | tr [A-Z] [a-z]`
-set  POSTE_TF = `echo $MYSTRING[3] | tr [A-Z] [a-z]`
+set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
+set  PRIOR_TF = `echo $MYSTRING[2] | tr '[:upper:]' '[:lower:]'`
+set  POSTE_TF = `echo $MYSTRING[3] | tr '[:upper:]' '[:lower:]'`
 
 # its a little tricky to remove both styles of quotes from the string.
 
 set  MYSTRING = `grep inf_in_file_name input.nml`
-set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,']# #g"`
+set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
 set  MYSTRING = `echo $MYSTRING | sed -e 's#"# #g'`
 set  PRIOR_INF_IFNAME = $MYSTRING[2]
 set  POSTE_INF_IFNAME = $MYSTRING[3]
 
 set  MYSTRING = `grep inf_out_file_name input.nml`
-set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,']# #g"`
+set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
 set  MYSTRING = `echo $MYSTRING | sed -e 's#"# #g'`
 set  PRIOR_INF_OFNAME = $MYSTRING[2]
 set  POSTE_INF_OFNAME = $MYSTRING[3]
 
 set  MYSTRING = `grep inf_diag_file_name input.nml`
-set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,']# #g"`
+set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
 set  MYSTRING = `echo $MYSTRING | sed -e 's#"# #g'`
 set  PRIOR_INF_DIAG = $MYSTRING[2]
 set  POSTE_INF_DIAG = $MYSTRING[3]
@@ -214,7 +229,7 @@
 
 if ( $PRIOR_INF > 0 ) then
 
-   if ($PRIOR_TF == ".false.") then
+   if ($PRIOR_TF == false) then
       echo "ERROR: inf_flavor(1) = $PRIOR_INF, yet inf_initial_from_restart = $PRIOR_TF"
       echo "ERROR: fix input.nml to reflect whether you want prior inflation or not."
       exit 3
@@ -233,15 +248,15 @@
       echo "ERROR: expected something like ../${PRIOR_INF_OFNAME}.YYYY-MM-DD-SSSSS"
       exit 4
    endif
-   else
-   echo "Prior Inflation not requested for this assimilation."
-   endif
+else
+   echo "Prior Inflation           not requested for this assimilation."
+endif
 
 # POSTERIOR: We look for the 'newest' and use it - IFF we need it.
 
 if ( $POSTE_INF > 0 ) then
 
-   if ($POSTE_TF == ".false.") then
+   if ($POSTE_TF == false) then
       echo "ERROR: inf_flavor(2) = $POSTE_INF, yet inf_initial_from_restart = $POSTE_TF"
       echo "ERROR: fix input.nml to reflect whether you want posterior inflation or not."
       exit 5
@@ -261,7 +276,7 @@
       exit 6
    endif
 else
-   echo "Posterior Inflation not requested for this assimilation."
+   echo "Posterior Inflation       not requested for this assimilation."
 endif
 
 #=========================================================================
@@ -358,14 +373,14 @@
 ${FLINK} $LND_HISTORY_FILENAME clm_history.nc
 
 # FIXME: special for trying out non-monotonic task layouts.
-setenv ORG_PATH "${PATH}"
-setenv LSF_BINDIR /contrib/lsf/tgmpatch
-setenv PATH ${LSF_BINDIR}:${PATH}
+# setenv ORG_PATH "${PATH}"
+# setenv LSF_BINDIR /contrib/lsf/tgmpatch
+# setenv PATH ${LSF_BINDIR}:${PATH}
 
 # layout: flat
-setenv NANCY_GEOMETRY_54_1NODE \
-	"{(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)}";
-setenv LSB_PJL_TASK_GEOMETRY "${NANCY_GEOMETRY_54_1NODE}"
+# setenv NANCY_GEOMETRY_54_1NODE \
+# 	"{(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)}";
+# setenv LSB_PJL_TASK_GEOMETRY "${NANCY_GEOMETRY_54_1NODE}"
 
 ${LAUNCHCMD} ${EXEROOT}/filter || exit 7
 echo "assimilate:finished filter at "`date`
@@ -389,7 +404,7 @@
 end
 
 # FIXME: special for trying out non-monotonic task layouts.
-setenv PATH "${ORG_PATH}"
+# setenv PATH "${ORG_PATH}"
 
 #=========================================================================
 # Block 6: Update the clm restart files.

Modified: DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Precip_template
===================================================================
--- DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Precip_template	2013-01-28 23:41:57 UTC (rev 5952)
+++ DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Precip_template	2013-02-01 18:54:15 UTC (rev 5953)
@@ -16,7 +16,7 @@
              /glade/p/image/thoar/CAM_DATM/annual
          </filePath>
          <fileNames>
-             CAM_DATM.cpl_ninst.ha2x1dx6h.2000.nc
+             CAM_DATM.cpl_NINST.ha2x1dx6h.REFYEAR.nc
          </fileNames>
       </domainInfo>
       <fieldInfo>
@@ -30,12 +30,8 @@
              /glade/p/image/thoar/CAM_DATM/annual
          </filePath>
          <fileNames>
-            CAM_DATM.cpl_ninst.ha2x1dx6h.2000.nc
-            CAM_DATM.cpl_ninst.ha2x1dx6h.2001.nc
+            CAM_DATM.cpl_NINST.ha2x1dx6h.REFYEAR.nc
          </fileNames>
-         <tInterpAlgo>
-            nearest
-         </tInterpAlgo>
          <offset>
             -10800
          </offset>

Modified: DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Solar_template
===================================================================
--- DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Solar_template	2013-01-28 23:41:57 UTC (rev 5952)
+++ DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.Solar_template	2013-02-01 18:54:15 UTC (rev 5953)
@@ -16,7 +16,7 @@
              /glade/p/image/thoar/CAM_DATM/annual
          </filePath>
          <fileNames>
-             CAM_DATM.cpl_ninst.ha2x1dx6h.2000.nc
+             CAM_DATM.cpl_NINST.ha2x1dx6h.REFYEAR.nc
          </fileNames>
       </domainInfo>
       <fieldInfo>
@@ -30,12 +30,8 @@
              /glade/p/image/thoar/CAM_DATM/annual
          </filePath>
          <fileNames>
-            CAM_DATM.cpl_ninst.ha2x1dx6h.2000.nc
-            CAM_DATM.cpl_ninst.ha2x1dx6h.2001.nc
+            CAM_DATM.cpl_NINST.ha2x1dx6h.REFYEAR.nc
          </fileNames>
-         <tInterpAlgo>
-            coszen
-         </tInterpAlgo>
          <offset>
             -21600
          </offset>

Modified: DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip_template
===================================================================
--- DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip_template	2013-01-28 23:41:57 UTC (rev 5952)
+++ DART/branches/development/models/clm/shell_scripts/user_datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip_template	2013-02-01 18:54:15 UTC (rev 5953)
@@ -16,7 +16,7 @@
              /glade/p/image/thoar/CAM_DATM/annual
          </filePath>
          <fileNames>
-             CAM_DATM.cpl_ninst.ha2x1dx6h.2000.nc
+             CAM_DATM.cpl_NINST.ha2x1dx6h.REFYEAR.nc
          </fileNames>
       </domainInfo>
       <fieldInfo>
@@ -36,12 +36,8 @@
              /glade/p/image/thoar/CAM_DATM/annual
          </filePath>
          <fileNames>
-            CAM_DATM.cpl_ninst.ha2x1dx6h.2000.nc
-            CAM_DATM.cpl_ninst.ha2x1dx6h.2001.nc
+            CAM_DATM.cpl_NINST.ha2x1dx6h.REFYEAR.nc
          </fileNames>
-         <tInterpAlgo>
-            linear
-         </tInterpAlgo>
          <offset>
             -10800
          </offset>


More information about the Dart-dev mailing list