[Dart-dev] DART/branches Revision: 11634

dart at ucar.edu dart at ucar.edu
Sat May 13 09:14:16 MDT 2017


raeder at ucar.edu
2017-05-13 09:14:15 -0600 (Sat, 13 May 2017)
1469
This is for an intermediate CESM, before the (hopefully stable) release in June 2017.
It was used for Bretherton's clouds experiment and for interfacing the developing
Manhattan release and CESM2.  
It's based on the stages {in,out}put, {pre,post}assim, but no {forecast,analysis},
and doesn't include Nancy's model_mod changes of ~2017-5-11,
or changes for running on Cheyenne.  It is a step in that direction.

There are many fixes to the st_archive tool, which hopefully will disappear
from DART when CESM2 is released with a st_archive which handles DART output.
Config_archive.xml is a replacement for the CESM version because the original
uses the wrong file name form for creating rpointer files in archive/rest/$date.
Case_st_archive.py is also a replacement due to many multi-instance errors
in the original.
There is also a section in setup* which modifies the env_archive.xml to handle
the current stages of DART output.  

The disk space management by assimilate.csh during runs has become complicated
with the stages in Manhattan.  I'm considering making it a separate script,
called by assimilate.csh.

Setup_* (test versions) and assimilate.csh were tested in cases
  setup_advanced: CAM6_test1_adv
  setup_hybrid  : CAM4_test1_hyb
which are 3 member, single day assimilations.

The 2 spinup_single* scripts should be condensed into 1.
For the moment it's useful to leave them separate, since that's what
was used for the development work of this CESM.




Modified: DART/branches/rma_trunk/models/cam-fv/shell_scripts/cesm2_0/assimilate.csh
===================================================================
--- DART/branches/rma_trunk/models/cam-fv/shell_scripts/cesm2_0/assimilate.csh	2017-05-12 22:56:09 UTC (rev 11633)
+++ DART/branches/rma_trunk/models/cam-fv/shell_scripts/cesm2_0/assimilate.csh	2017-05-13 15:14:15 UTC (rev 11634)
@@ -27,7 +27,9 @@
 set nonomatch       # suppress "rm" warnings if wildcard does not match anything
 
 setenv CASEROOT $1
-setenv cycle    $2
+# Python uses C indexing on loops; cycle = [0,....,$DATA_ASSIMILATION_CYCLES - 1]
+# "Fix" that here, so the rest of the script isn't confusing.
+@ cycle = $2 + 1
 
 # The FORCE options are not optional.
 # The VERBOSE options are useful for debugging though
@@ -79,6 +81,9 @@
 setenv RUNDIR         `./xmlquery RUNDIR      -value`
 setenv archive        `./xmlquery DOUT_S_ROOT -value`
 setenv DATA_ASSIMILATION_CYCLES        `./xmlquery DATA_ASSIMILATION_CYCLES -value`
+setenv save_all_inf TRUE
+# A switch to signal how often to save the stages' ensemble members: NONE, RESTART_TIMES, ALL
+setenv save_stages TRUE
 
 set echo verbose
 cd $RUNDIR
@@ -100,6 +105,10 @@
    rmdir ../Hide*
 endif
 
+# Make a place to store inflation restarts to protect from purging until
+# st_archive can make a home for them.
+if (! -d $archive/esp/rest && $save_all_inf =~ TRUE) mkdir -p $archive/esp/rest
+
 # Cwd is currently RUNDIR.
 set log_list = `ls -t cesm.log.*`
 echo "log_list is $log_list"
@@ -137,15 +146,27 @@
        ($sec_o_day =~ '00000' && $day_o_month % BOGUS_save_every_Mth != 0) ) then
       echo "Removing unneeded restart file set from RUNDIR: "
       echo "    $rm_date[1]"'*.{r,rs,rh0,h0,i}.*'${day_o_month}-${sec_o_day}
-      # Remove member restarts (but not DART output)
+      # Optionally save inflation restarts, even if it's not a 'save restart' time.
+      if ($save_all_inf =~ TRUE) $MOVE $rm_date[1]*inf*${day_o_month}-${sec_o_day}*  $archive/esp/rest
+
+      # Remove intermediate member restarts (but not DART means, sd, obs_seq, inflation restarts output)
       # Note that *cpl.ha.* is retained, and any h#, #>0.
       #        $CASE                          DD          -SSSSS
-      $REMOVE  $rm_date[1]*.{r,rs,rh0,h0,i}.*${day_o_month}-${sec_o_day}* &
-      $REMOVE  $rm_date[1].*[0-9].{input,preassim,postassim}*${day_o_month}-${sec_o_day}* &
+      $REMOVE  $rm_date[1]*.{r,rs,rh0,h0}.*${day_o_month}-${sec_o_day}* &
+      # Handle .i. separately to avoid sweeping up .input_{mean,sd,...} files.
+      $REMOVE $rm_date[1]*.i.*${day_o_month}-${sec_o_day}*  &
+      if ($save_stages =~ NONE || $save_stages =~ RESTART_TIMES) then
+         $REMOVE  $rm_date[1].*[0-9].{input,preassim,postassim}*${day_o_month}-${sec_o_day}* &
+      endif
+   else
+      # Optionally COPY inflation restarts to the same place as the other inflation restarts.
+      if ($save_all_inf =~ TRUE) $COPY $rm_date[1]*inf*${day_o_month}-${sec_o_day}*  $archive/esp/rest
 
-      # Remove log files: *YYMMDD-HHMMSS.  
-      $REMOVE  *$rm_log[$rm_slot]*  &
-   else
+      # Optionally REMOVE stages' ensemble members (not means and sds).
+      if ($save_stages =~ NONE ) then
+         $REMOVE  $rm_date[1].*[0-9].{input,preassim,postassim}*${day_o_month}-${sec_o_day}* &
+      endif
+
       # Save the restart set to archive/rest/$datename, where it will be safe
       # from removes of $component/rest and ${case}.locked/archive.
       set save_date = `echo $re_list[3] | sed -e "s/\./ /g;"`
@@ -153,14 +174,17 @@
       set save_root = $archive/rest/$save_date[$piece]
       if (! -d $save_root) then
          mkdir -p $save_root
-         $MOVE $rm_date[1]*.{r,rs,rh0,h0,i}.*${day_o_month}-${sec_o_day}*  $save_root &
-         $MOVE                         *inf*${day_o_month}-${sec_o_day}*  $save_root &
+         $MOVE $rm_date[1]*.{r,rs,rh0,h0}.*${day_o_month}-${sec_o_day}*  $save_root &
+         # Handle .i. separately to avoid sweeping up .input_{mean,sd,...} files.
+         $MOVE $rm_date[1]*.i.*${day_o_month}-${sec_o_day}*  $save_root &
+         $COPY            *inf*${day_o_month}-${sec_o_day}*  $save_root &
+         # Save a few log files
+         $MOVE *0001*$rm_log[$rm_slot]*                      $save_root 
 
       endif
-
-      # Remove log files: *YYMMDD-HHMMSS*.  
-      $REMOVE  *$rm_log[$rm_slot]*  &
    endif
+   # Remove log files: *YYMMDD-HHMMSS*.  Except not da.log files
+   $REMOVE  [^d]*$rm_log[$rm_slot]*  &
 
    # I'd like to remove the CAM .r. files, since we always use the .i. files to do a hybrid start,
    # but apparently CESM needs them to be there, even though it doesn't read fields from them.
@@ -168,7 +192,6 @@
 
    # During the last cycle, hide the 2nd newest restart set 
    # so that it's not archived, but is available for debugging.
-   # If it's the last cycle, hide the restart set.
    # This is assuming that DATA_ASSIMILATION_CYCLES has not been changed in env_run.xml
    # since the start (not submission) of this job.
    # (Requested by Karspeck for coupled assims, which need to keep 4 atmospheric


More information about the Dart-dev mailing list