[Dart-dev] [4184] DART/trunk/observations/gps/work: Add Ryan' s improvements for downloading either today or today and tomorrow's

nancy at ucar.edu nancy at ucar.edu
Mon Dec 7 11:06:05 MST 2009


Revision: 4184
Author:   nancy
Date:     2009-12-07 11:06:05 -0700 (Mon, 07 Dec 2009)
Log Message:
-----------
Add Ryan's improvements for downloading either today or today and tomorrow's
gps data, and cleaning up either just today or both files when done.
Add comments in the driver script to show examples of how to use these options.

Modified Paths:
--------------
    DART/trunk/observations/gps/work/convert_script.csh
    DART/trunk/observations/gps/work/cosmic_to_obsseq.csh

-------------- next part --------------
Modified: DART/trunk/observations/gps/work/convert_script.csh
===================================================================
--- DART/trunk/observations/gps/work/convert_script.csh	2009-12-04 22:30:59 UTC (rev 4183)
+++ DART/trunk/observations/gps/work/convert_script.csh	2009-12-07 18:06:05 UTC (rev 4184)
@@ -10,15 +10,22 @@
 #  - whether to download the data automatically from the cosmic web site 
 #     (downloading data requires signing up for a username/password to 
 #     access the site, and then setting the username and password here 
-#     before running this script.)  set to no if the data has already been
-#     downloaded separately before now.
+#     before running this script.)  set to 'no' if the data has already been
+#     downloaded separately before now.  set to 'both' to download both the
+#     current day plus the next day (needed to get the first N hours of the
+#     following day for assimilation windows centered on midnight).  set to
+#     'next' if the current day's data is already downloaded.
 #  - whether to delete the data automatically from the local disk after the
-#     conversion is done.
+#     conversion is done.  values are 'no', 'curr', or 'both'.  'curr' deletes
+#     the current day but leaves the following day.  'both' deletes both
+#     the current and next day's data.
 #
 
 setenv cosmic_user xxx
 setenv cosmic_pw   yyy
 
+# assumes all data predownloaded, and will be deleted afterwards
+# by hand.
 ./cosmic_to_obsseq.csh 20061101 ../cosmic no no
 ./cosmic_to_obsseq.csh 20061102 ../cosmic no no
 ./cosmic_to_obsseq.csh 20061103 ../cosmic no no
@@ -26,3 +33,10 @@
 ./cosmic_to_obsseq.csh 20061105 ../cosmic no no
 ./cosmic_to_obsseq.csh 20061106 ../cosmic no no
 ./cosmic_to_obsseq.csh 20061107 ../cosmic no no
+
+## example of using both, curr and next for on-demand download and cleanup.
+#./cosmic_to_obsseq.csh 20061101 ../cosmic both curr
+#./cosmic_to_obsseq.csh 20061102 ../cosmic next curr
+#./cosmic_to_obsseq.csh 20061103 ../cosmic next curr
+#./cosmic_to_obsseq.csh 20061104 ../cosmic next both
+

Modified: DART/trunk/observations/gps/work/cosmic_to_obsseq.csh
===================================================================
--- DART/trunk/observations/gps/work/cosmic_to_obsseq.csh	2009-12-04 22:30:59 UTC (rev 4183)
+++ DART/trunk/observations/gps/work/cosmic_to_obsseq.csh	2009-12-07 18:06:05 UTC (rev 4184)
@@ -31,8 +31,8 @@
 
 set datea   = ${1}     # target date, YYYYMMDD
 set datadir = ${2}     # where to process the files
-set downld  = ${3}     # download?  'yes' or 'no'
-set cleanup = ${4}     # delete COSMIC files at end? 'yes' or 'no'
+set downld  = ${3}     # download?  'both' (both days) 'next' (next day)
+set cleanup = ${4}     # delete COSMIC files at end? 'both' or 'curr'
 
 set assim_freq          = 6  # hours, sets centers of windows.
 set download_window     = 3  # window half-width (some users choose 2 hours)
@@ -88,12 +88,14 @@
   echo 'using data conversion program already found in data proc dir'
 endif
 
-if ( $downld == 'yes' ) then
+set date2 = `echo $datea +1d -f ccyymmdd | ${DATE_PROG}`
 
-   set dateb = `echo $datea +1d -f ccyymmdd | ${DATE_PROG}`
-   ./cosmic_download.csh ${datea} ${datadir}
-   ./cosmic_download.csh ${dateb} ${datadir}
+if ( $downld == 'both' || $downld == 'next' ) then
 
+   if ( $downld == 'both' )  ./cosmic_download.csh ${datea} ${datadir}
+
+   ./cosmic_download.csh ${date2} ${datadir}
+
 endif
 
 echo 'changing dir to data proc directory'
@@ -126,10 +128,11 @@
 
     set    yyyy = `echo $datef | cut -b1-4`
     set      hh = `echo $datef | cut -b9-10`
+    set yyyymmdd = `echo $datef | cut -b1-8` 
     set jyyyydd = `echo $datef 0 -j | ./${DATE_PROG}`
     @ mday = $jyyyydd[2] + 1000  ;  set mday = `echo $mday | cut -b2-4`
 
-    /bin/ls ${dates}/*.${yyyy}.${mday}.${hh}.*_nc >>! flist
+    /bin/ls ${yyyymmdd}/*.${yyyy}.${mday}.${hh}.*_nc >>! flist
 
     if ( $chatty == 'yes' ) then
       echo $datea ' hour ' $hh
@@ -162,7 +165,7 @@
 
 end
 
-if ( $cleanup == 'yes' ) then
+if ( $cleanup == 'both' || $cleanup == 'curr' ) then
 
    if ( $chatty == 'yes' ) then
       echo 'cleaning up files at ' `date`
@@ -179,14 +182,16 @@
   rm -f ${dates}/atmPrf_CHAM*
   rm -f ${dates}/atmPrf_*
 
-  rm -f ${dateb}/atmPrf_C001*
-  rm -f ${dateb}/atmPrf_C002*
-  rm -f ${dateb}/atmPrf_C003*
-  rm -f ${dateb}/atmPrf_C004*
-  rm -f ${dateb}/atmPrf_C005*
-  rm -f ${dateb}/atmPrf_C006*
-  rm -f ${dateb}/atmPrf_CHAM*
-  rm -f ${dateb}/atmPrf_*
+  if ( $cleanup == 'both' ) then
+    rm -f ${date2}/atmPrf_C001*
+    rm -f ${date2}/atmPrf_C002*
+    rm -f ${date2}/atmPrf_C003*
+    rm -f ${date2}/atmPrf_C004*
+    rm -f ${date2}/atmPrf_C005*
+    rm -f ${date2}/atmPrf_C006*
+    rm -f ${date2}/atmPrf_CHAM*
+    rm -f ${date2}/atmPrf_*
+  endif
 
 endif
 


More information about the Dart-dev mailing list