[Dart-dev] [4318] DART/trunk/observations/NCEP/prep_bufr/work: Minor improvements, more documentation on how these work.
nancy at ucar.edu
nancy at ucar.edu
Mon Mar 15 13:56:26 MDT 2010
Revision: 4318
Author: nancy
Date: 2010-03-15 13:56:26 -0600 (Mon, 15 Mar 2010)
Log Message:
-----------
Minor improvements, more documentation on how these work.
Modified Paths:
--------------
DART/trunk/observations/NCEP/prep_bufr/work/multi_prep.csh
DART/trunk/observations/NCEP/prep_bufr/work/prepbufr.csh
-------------- next part --------------
Modified: DART/trunk/observations/NCEP/prep_bufr/work/multi_prep.csh
===================================================================
--- DART/trunk/observations/NCEP/prep_bufr/work/multi_prep.csh 2010-03-15 19:52:53 UTC (rev 4317)
+++ DART/trunk/observations/NCEP/prep_bufr/work/multi_prep.csh 2010-03-15 19:56:26 UTC (rev 4318)
@@ -7,37 +7,41 @@
# $Id$
#
# Driver script for the parallel version. Submit this script
-# to your batch system and it will invoke the 'multi_body.csh'
+# to your batch system and it will invoke the 'prepbufr.csh'
# script once for each conversion day.
#
#--------------------------------------------------------------
# DESCRIPTION:
#
-# This script is used to generate daily (3:01Z to 3:00Z of next day) decoded
-# NCEP reanalysis PREPBUFR text/ascii data.
+# This script is used to generate daily (3:01Z to 3:00Z of next day)
+# decoded NCEP reanalysis PREPBUFR text/ascii data.
#
#--------------------------------------------------------------
-#BSUB -o multiprep.out
-#BSUB -e multiprep.err
+#BSUB -o prep.out
+#BSUB -e prep.err
#BSUB -J multiprep
#BSUB -q regular
-#BSUB -W 0:15
-#BSUB -P xxxxxxxx
+#BSUB -W 0:10
+#BSUB -P xxxxxxx
#BSUB -n 1
-# Set year, month is multi_body.csh, set days only here.
+# USER SETTINGS HERE
-# Only 4 inputs which need to be set in this script.
-set year = 2004
-set month = 1
-set startday = 1
-set endday = 30
+# Set year, month, days for to pass as args to prepbufr.csh
+set year = 2002
+set month = 10
+set startday = 21
+set endday = 31
# Subdirectory base name. If running multiple months at the
-# same time, must have different base names.
+# same time, must have different base names. (could add month
+# number onto tempdir names in script below.)
+
set prefix = tempdir
+# END USER SETTINGS
+
# Loop over days, first to convert, then to clean up
set day = $startday
set lastday = $endday
@@ -47,11 +51,11 @@
mkdir ${prefix}_${day}
cd ${prefix}_${day}
- cp -f ../multi_body.csh .
+ cp -f ../prepbufr.csh .
cp -f ../input.nml .
echo starting day $day
- ./multi_body.csh $year $month $day $day &
+ ./prepbufr.csh $year $month $day $day &
cd ..
@@ -67,8 +71,10 @@
# rather than do rm -fr dir, remove what we think is there
# and have it fail, intentionally, if other files still exist.
while ( $day <= $lastday )
- rm ${prefix}_${day}/input.nml ${prefix}_${day}/multi_body.csh
+
+ rm ${prefix}_${day}/input.nml ${prefix}_${day}/prepbufr.csh
rmdir ${prefix}_${day}
+
@ day++
end
Modified: DART/trunk/observations/NCEP/prep_bufr/work/prepbufr.csh
===================================================================
--- DART/trunk/observations/NCEP/prep_bufr/work/prepbufr.csh 2010-03-15 19:52:53 UTC (rev 4317)
+++ DART/trunk/observations/NCEP/prep_bufr/work/prepbufr.csh 2010-03-15 19:56:26 UTC (rev 4318)
@@ -12,11 +12,13 @@
# This script is used to generate daily (3:01Z to 3:00Z of next day) decoded
# NCEP reanalysis PREPBUFR text/ascii data.
#
-# you may need additional options to submit this job to LSF;
-# e.g. -P project charge code, different queue name, etc.
+# there are two ways to run this script - either submit it to a batch
+# system (LSF job commands are included), or this script can be called
+# as a command line executable. see the sections below for what options
+# to set at the top of the script before it is run.
#
-#--------------------------------------------------------------
-#
+# LSF batch system settings, which will certainly need to be customized
+# for your system, e.g. -P project charge code, different queue name, etc.
#BSUB -o prepbufr.out
#BSUB -e prepbufr.err
#BSUB -J prepbufr
@@ -24,13 +26,11 @@
#BSUB -W 1:00
#BSUB -P XXXXXXXX
#BSUB -n 1
-
-#--------------------------------------------------------------
+#
+# to run this from the command line, see below for a choice of whether
+# to invoke this script with 4 args: year, month, start/end day,
+# or hardcode the dates into the script and run it by name with no args.
#
-# This script is used to generate daily (3:01Z to 3:00Z of next day) decoded
-# NCEP reanalysis PREPBUFR text/ascii data.
-# It should be run only for days within a single month.
-#
#--------------------------------------------------------------
# USER SET PARAMETERS
@@ -73,11 +73,25 @@
# file from one day beyond the last day for this to finish ok (to get obs
# at exactly 3Z from the next file).
-set year = 1989
-set month = 1
-set beginday = 1
-set endday = 1
+# if this is being called by another program, and passing in the dates
+# as command line arguments (or if you just prefer to call this with args),
+# then set commline to 'yes'. otherwise, set the year, month, and days
+# directly in the variables below.
+set commline = no
+
+if ($commline == 'yes') then
+ set year = $argv[1]
+ set month = $argv[2]
+ set beginday = $argv[3]
+ set endday = $argv[4]
+else
+ set year = 2003
+ set month = 1
+ set beginday = 10
+ set endday = 20
+endif
+
# directory where the BUFR files are located. the script assumes the
# files will be located in subdirectories by month, with the names following
# the pattern YYYYMM, and then inside the subdirectories, the files are
@@ -99,8 +113,8 @@
set BUFR_dir = ../data
-# directory where DART ncep observation programs are located
-
+# directory where DART prepbufr programs are located, relative
+# to the directory where this script is going to be executed.
set DART_exec_dir = ../exe
# END USER SET PARAMETERS
@@ -122,7 +136,6 @@
set day = $beginday
set last = $endday
while ( $day <= $last )
- echo '-------------------------------------- '
# clear any old intermediate (text) files
rm -f temp_obs prepqm.in prepqm.out
@@ -263,6 +276,8 @@
mv -fv temp_obs ${BUFR_out}
endif
+ rm -f prepqm.in
+
@ day++
end
More information about the Dart-dev
mailing list