[Dart-dev] DART/branches Revision: 13148

dart at ucar.edu dart at ucar.edu
Wed May 1 14:24:15 MDT 2019


raeder at ucar.edu
2019-05-01 14:24:15 -0600 (Wed, 01 May 2019)
802
setup_advanced_Rean_2017
   Changed DART root to 'reanalysis' 'from rma_recam'.
   Updated the restart set save frequency (see assimilate.csh.template notes)
setup_hybrid
   Made the DART_config file executable, so that it can be run manually
   instead of within the setup scripts.
assimilate.csh.template
 > Implement a more flexible way to specify how frequently to archive restarts;
   every_Nth_day (from the beginning of each month) or
   every specified weekday (e.g. Sunday, at 00Z).
 > Fixed the saving of inflation restart files at those times.
 > Removed 'dart' from the compression.csh call,
   since I'll need to process them at the end of each month
   and the uncompressed binary versions don't take up much space.
DART_config.template
   Fixed extra '-' in front of $VERBOSE argument.




Modified: DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/DART_config.template
===================================================================
--- DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/DART_config.template	2019-05-01 20:22:25 UTC (rev 13147)
+++ DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/DART_config.template	2019-05-01 20:24:15 UTC (rev 13148)
@@ -191,7 +191,7 @@
 # chmod 755 perfect_model.csh
 
 if (-f ${DART_SCRIPTS_DIR}/compress.csh) then
-   $COPY -f -${VERBOSE} ${DART_SCRIPTS_DIR}/compress.csh . || exit 43
+   $COPY -f ${VERBOSE} ${DART_SCRIPTS_DIR}/compress.csh . || exit 43
 else
    echo "ERROR: no compress.csh in  ${DART_SCRIPTS_DIR}"
    exit 45
@@ -361,14 +361,17 @@
    to use after the model forecast;
    assimilate.csh, no_assimilate.csh, or perfect_model.csh.
 
-3) Modify what you need to in the DART namelist file, i.e. ${CASEROOT}/input.nml
+3) Modify what you need to in the DART namelist file, i.e. 
+   ${CASEROOT}/input.nml
 
 4) If you have recompiled any part of the DART system, 'stage_dart_files'
    will copy them into the correct places.
 
 5) If you stage your own inflation files, make sure you read the "INFLATION" section
-   in ${CASEROOT}/assimilate.csh.  At the very least, copy your inflation files
-   in ${RUNDIR} into the appropriate names:
+   in ${CASEROOT}/assimilate.csh.  
+   At the very least, copy your inflation files
+   in ${RUNDIR} 
+   into the appropriate names:
       input_priorinf_mean.nc
       input_priorinf_sd.nc
       input_postinf_mean.nc 
@@ -381,8 +384,8 @@
 
 7) Submit the CESM job in the normal way.
 
-8) You can use ${CASEROOT}/stage_cesm_files to stage an ensemble of files 
-   to restart a run at a date for which you have a restart set.
+8) You can use ${CASEROOT}/stage_cesm_files 
+   to stage an ensemble of files to restart a run at a date for which you have a restart set.
 
 -------------------------------------------------------------------------
 

Modified: DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template
===================================================================
--- DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template	2019-05-01 20:22:25 UTC (rev 13147)
+++ DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template	2019-05-01 20:24:15 UTC (rev 13148)
@@ -341,7 +341,7 @@
 
    # Find the date of the oldest restart set from filenames like:
    # setup_test.cpl_0001.r.2016-12-11-21600.nc   ... or ...
-   # setup_test.cpl.r.2016-12-11-21600.nc
+   # setup_test.cpl.r.2016-12-11-21600.nc.gz
    #
    # Grab the root of the filename (removes the .nc 'extension')
    # and then the extension is the bit we need.
@@ -351,11 +351,31 @@
    set FILE = $FILE:r
    if ($FILE:e == 'nc') set FILE = $FILE:r
    set rm_date = $FILE:e
+
    set RM_DATE_PARTS = `echo $rm_date | sed -e "s#-# #g"`
    set day_o_month = $RM_DATE_PARTS[3]
    set sec_o_day   = $RM_DATE_PARTS[4]
    set day_time    = ${day_o_month}-${sec_o_day}
+   
+   # Decide whether to purge restart files at this date and time.
+   set save_rest_freq = BOGUS_save_every_Mth
+   
+   set purge = 'true'
+   # Learn whether save_rest_freq a string or a number.
+   # Character strings must be tested outside of the 'if' statement.
+   echo $save_rest_freq | grep '[a-z]'
+   if ($status == 0) then
+      set purge_date = $RM_DATE_PARTS[1]-$RM_DATE_PARTS[2]-$RM_DATE_PARTS[3]
+      set weekday = `date --date="$purge_date" +%A`
+      if ($weekday == $save_rest_freq) set purge = 'false'
 
+   # Numbers can be tested inside the 'if' statement.
+   else if (`echo $save_rest_freq | grep '[0-9]'`) then
+      if ($day_o_month == $save_rest_freq) set purge = 'false'
+
+   endif
+
+
    # Identify log files to be removed or moved.
    # [3] means the 3rd oldest restart set is being (re)moved.
    set rm_log = `echo $log_list[3] | sed -e "s/\./ /g;"`
@@ -367,7 +387,7 @@
    # The 'else' block preserves the restarts in the archive directory.
 
    if ( $sec_o_day !~ '00000' || \
-       ($sec_o_day =~ '00000' && $day_o_month % BOGUS_save_every_Mth != 0) ) then
+       ($sec_o_day =~ '00000' && $purge == 'true') ) then
 
       # Optionally save inflation restarts, even if it's not a 'save restart' time.
       if ($save_all_inf =~ TRUE) ${MOVE} ${CASE}*inf*${day_time}*  ${archive}/esp/hist
@@ -427,7 +447,7 @@


More information about the Dart-dev mailing list