[Dart-dev] [6395] DART/trunk/models/CESM/shell_scripts/st_archive.sh: according to alicia it's better to archive restarts for days 10, 20, 30

nancy at ucar.edu nancy at ucar.edu
Mon Aug 12 11:36:21 MDT 2013


Revision: 6395
Author:   nancy
Date:     2013-08-12 11:36:20 -0600 (Mon, 12 Aug 2013)
Log Message:
-----------
according to alicia it's better to archive restarts for days 10,20,30
instead of days 1,10,20 because of some interaction between restarting
on day 1 of a month and the history file mechanism.  it's saving 3 days
a month either way and if it's better somehow i'm happy to change the
script.  for simplicity we always archive the 30th even in months with
31 days, and for feb archive day 28 whether it's a leap year or not.

Modified Paths:
--------------
    DART/trunk/models/CESM/shell_scripts/st_archive.sh

-------------- next part --------------
Modified: DART/trunk/models/CESM/shell_scripts/st_archive.sh
===================================================================
--- DART/trunk/models/CESM/shell_scripts/st_archive.sh	2013-08-12 16:22:18 UTC (rev 6394)
+++ DART/trunk/models/CESM/shell_scripts/st_archive.sh	2013-08-12 17:36:20 UTC (rev 6395)
@@ -329,19 +329,29 @@
 cp ${sta}/rest/${dname}/* .
 
 
-# now possibly delete the current contents of the rest dir so 
-# it won't be picked up by the long term archiver.  save every Nth day.
+# now possibly delete the current contents of the restart dir so 
+# it won't be picked up by the long term archiver.  the diagnostic
+# files are saved for all times, but these are the restart files
+# needed to start a new model advance. if you try to save every
+# set of restart files you will be archiving a very very very 
+# large amount of data.
 
-year=`echo $dname | cut -b1-4`
+# dname: YYYY-MM-DD-SSSSS
+#   col: 1234567890123456
+
+ year=`echo $dname | cut -b1-4`
 month=`echo $dname | cut -b6-7`
-day=`echo $dname | cut -b9-10`
-secs=`echo $dname | cut -b12-16`
+  day=`echo $dname | cut -b9-10`
+ secs=`echo $dname | cut -b12-16`
 
+# if you want to save more often (or less) alter the test here
+# using the time variables from immediately above.
 
-# if you want to save more often (or less) alter the test here.
-# using the time variables immediately above.
+# approximately the last day of each month: all months except feb have 30 days, 
+# and all febs have a 28th.  save the 10th, 20th, and "last" day of each month.
+if [[ $month == 02 ]]; then lastday=28; else lastday=30; fi
 
-if [[ $secs == 00000 && ($day == 01 || $day == 10 || $day == 20) ]]; then
+if [[ $secs == 00000 && ($day == 10 || $day == 20 || $day == $lastday) ]]; then
   echo "st_archive: PRESERVING contents of restart ${dname}"
 else
   echo "st_archive: DELETING contents of restart ${dname}"
@@ -349,7 +359,7 @@
   touch ${sta}/rest/${dname}_removed
 fi
 
-#ALICIA... rm the .hv files because they have no unique time stamp.
+# rm the .hv files because they have no unique time stamp.
 rm -rf ${sta}/ocn/hist/${CASE}.pop.*.hv.nc
 
 


More information about the Dart-dev mailing list