[Dart-dev] [4182] DART/trunk/observations/gps/work: Add a README to explain the scripts in this directory.

nancy at ucar.edu nancy at ucar.edu
Fri Dec 4 14:49:24 MST 2009


Revision: 4182
Author:   nancy
Date:     2009-12-04 14:49:24 -0700 (Fri, 04 Dec 2009)
Log Message:
-----------
Add a README to explain the scripts in this directory.
Link to an input.nml in cosmic_download so the advance_time program
doesn't complain.  Have it only download a single day's worth of data.
Set the cosmic_to_obsseq so if you ask it to download and convert in
one go, that it downloads 2 days worth of data, and deletes the same at
the end if you ask it to.

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

Added Paths:
-----------
    DART/trunk/observations/gps/work/README

-------------- next part --------------
Added: DART/trunk/observations/gps/work/README
===================================================================
--- DART/trunk/observations/gps/work/README	                        (rev 0)
+++ DART/trunk/observations/gps/work/README	2009-12-04 21:49:24 UTC (rev 4182)
@@ -0,0 +1,66 @@
+The intent for the scripts in this directory are:
+
+Summary:  
+1) Run ./quickbuild.csh to compile everything.  
+2) Edit cosmic_download.csh and cosmic_to_obsseq.csh once to set DART_DIR.
+3) Edit ./download_script.csh to set the cosmic name, pw, and dates.  Run it.
+4) Edit ./convert_script.csh to set the cosmic name, pw, and dates.  Run it.
+5) For additional days repeat steps 3 and 4.
+
+
+More details:
+
+1) quickbuild.csh:
+
+Make sure your $DART/mkmf/mkmf.template is one that matches the
+platform and compiler for your system.  It should be the same as
+how you have it set to build the other DART executables.
+
+Run quickbuild.csh and it should compile all the executables needed
+to do the GPS conversion into DART obs_sequence files.
+
+
+2) download_script.csh (and cosmic_download.csh):
+
+Edit cosmic_download.csh once to set the DART_DIR to where you have
+downloaded the DART distribution.  (There are a few additional options
+in this script, but the distribution version should be good for most users.)
+After this you should be able to ignore this script.
+
+Edit and run the download_script.csh.  You will need to set your
+cosmic web site user name and password, and set the days for which you 
+want to download data.
+
+
+3) convert_script.csh (and cosmic_to_obsseq.csh):
+
+Edit cosmic_to_obsseq.csh once to set the DART_DIR to where you have
+downloaded the DART distribution.  (There are a few additional options
+in this script, but the distribution version should be good for most users.)
+After this you should be able to ignore this script.
+
+Edit and run the convert_script.csh.  You will need to set your
+cosmic web site user name and password, and set the days for which you 
+want to convert data into DART obs_sequence files.
+
+There are options on the convert_script.csh to bypass step 2 and do both
+the download and convert in a single step. For one or two days this
+might be a good option, but it is common to have problems during the download.
+It is easier to restart the download separately from the conversion
+if you're using the separate download script.  Also, the conversion needs
+3 hours from the following day to create a file which has all obs within
+the window (usually 3 hours) from the center time (usually 0Z).  So if the
+download is done as a part of the script it must download 2 days, do the
+conversion, and then move on to the next day.  The script is currently
+not smart enough to avoid redownloading data, so if you are converting
+multiple consecutive days it will redownload the next day's data anyway
+and will not realize you already have it.  It cannot simply look for the
+existance of a directory since that complicates restarting failed or
+partial downloads.  It is also risky to automatically delete the data files
+in the script, since if there are errors (full file system, etc) that
+don't cause the script to exit, you will delete the data files and not
+have the converted obs files.  This is all only a consideration because
+currently it is slow to download the data.  If that becomes faster, then
+most of the discussion in this paragraph is moot.
+
+

Modified: DART/trunk/observations/gps/work/cosmic_download.csh
===================================================================
--- DART/trunk/observations/gps/work/cosmic_download.csh	2009-12-04 16:33:46 UTC (rev 4181)
+++ DART/trunk/observations/gps/work/cosmic_download.csh	2009-12-04 21:49:24 UTC (rev 4182)
@@ -46,9 +46,7 @@
 
 # should only have to set the DART_DIR and the rest should be in the
 # right place relative to it.
-setenv DART_DIR      /home/user/dart
-setenv cosmic_user   xxx
-setenv cosmic_pw     yyy
+setenv DART_DIR      /home/user/DART
 
 setenv DART_WORK_DIR  ${DART_DIR}/observations/gps/work
 setenv CONV_PROG      convert_cosmic_gps_cdf
@@ -123,6 +121,7 @@
 endif
 
 cd ${datea}
+ln -sf ../input.nml .
 
 echo $datea
 set jyyyydd = `echo $datea 0 -j | ../${DATE_PROG}` 
@@ -131,15 +130,8 @@
 ${get} ${gps_repository_path}/cosmic/level2/atmPrf/${yyyy}.${mday}/
 rm -f *.html *.txt
 ${get} ${gps_repository_path}/champ/level2/atmPrf/${yyyy}.${mday}/
-rm -f *.html *.txt
+rm -f *.html *.txt input.nml
 
-set jyyyydd = `echo $datea 24 -j | ../${DATE_PROG}`
-@ mday = $jyyyydd[2] + 1000  ;  set mday = `echo $mday | cut -b2-4` 
-${get} ${gps_repository_path}/cosmic/level2/atmPrf/${yyyy}.${mday}/
-rm -f *.html *.txt
-${get} ${gps_repository_path}/champ/level2/atmPrf/${yyyy}.${mday}/
-rm -f *.html *.txt
-
 if ( $chatty == 'yes' ) then
    # the ls arg list line gets too long in some cases
    echo `/bin/ls | grep _nc | wc -l` 'raw files'

Modified: DART/trunk/observations/gps/work/cosmic_to_obsseq.csh
===================================================================
--- DART/trunk/observations/gps/work/cosmic_to_obsseq.csh	2009-12-04 16:33:46 UTC (rev 4181)
+++ DART/trunk/observations/gps/work/cosmic_to_obsseq.csh	2009-12-04 21:49:24 UTC (rev 4182)
@@ -43,7 +43,7 @@
 # verify the dirs all exist, the input.nml is in place.
 if ( ! -d ${DART_WORK_DIR} ) then
   echo 'work directory not found: ' ${DART_WORK_DIR}
-  exit
+  exit 1
 endif
 
 echo 'current dir is ' `pwd`
@@ -90,7 +90,9 @@
 
 if ( $downld == 'yes' ) then
 
+   set dateb = `echo $datea +1d -f ccyymmdd | ${DATE_PROG}`
    ./cosmic_download.csh ${datea} ${datadir}
+   ./cosmic_download.csh ${dateb} ${datadir}
 
 endif
 
@@ -177,6 +179,15 @@
   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_*
+
 endif
 
 if ( $chatty == 'yes' ) then


More information about the Dart-dev mailing list