forked from yangfanglin/gfs_verif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsdbjob.sh
executable file
·422 lines (368 loc) · 25.4 KB
/
vsdbjob.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
#!/bin/ksh
set -x
##---------------------------------------------------------------------------
## Modified version of vsdbjob_submit.sh for use in NCEP/EMC GFS para_config
## to do verification while forecast is running.
## Fanglin Yang, 01Jan2010
##---------------------------------------------------------------------------
## variables read in from vrfy.sh and/or para_config
export DATEST=${1:-20080701} ;#forecast starting date
export DATEND=${2:-20080801} ;#forecast ending date
export vlength=${3:-384} ;#forecast length in hour
export cycle=${4:-"00"} ;#forecast cycle
export exp1name=${5:-"pre13a"} ;#experiment names
export VSDB_START_DATE=${6:-$VSDB_START_DATE} ;#map starting date
export anl_type=${7:-${anltype:-gfs}} ;#analysis type for verification: gfs, gdas, ecmwf, manl or canl
export gfs_cyc=${8:-${gfs_cyc:-1}} ;#number of GFS cycles, 1-->00Z, 4-->00Z 06Z 12Z and 18Z
export bucket=${9:-${bucket:-6}} ;#accumulation bucket in hours. bucket=0 -- continuous accumulation
export iauf00=${10:-${iauf00:-"NO"}} ;#set pgbf00=pgbanl for forecasts with IAU
export exp1dir=${ARCDIR1:-/global/hires/glopara/archive} ;#online archive of current exp
export scppgb=${SCP_PGB:-"NO"} ;#whether of not to scp pgb files from CLIENT
export sfcvsdb=${sfcvsdb:-"YES"} ;#include the group of surface variables
export rundir0=${rundir:-$STMP/$LOGNAME/vsdb_exp}
##
##-------------------------------------------------------------------
##-------------------------------------------------------------------
MAKEVSDBDATA=${VSDB_STEP1:-NO} ;#To create VSDB date
MAKEMAPS=${VSDB_STEP2:-NO} ;#To make AC and RMS maps
CONUSPLOTS=${VSDB_STEP2:-NO} ;#To make precip verification plots
CONUSDATA=${VRFYPRCP:-NO} ;#To compute precip threat skill scores
VRFYG2OBS=${VRFYG2OBS:-NO} ;#To create grid2obs vsdb date
#----------------------------------------------------------------------
export machine=${machine:-WCOSS} ;#WCOSS, THEIA
export machine=$(echo $machine|tr '[a-z]' '[A-Z]')
export ACCOUNT=${ACCOUNT:-GFS-T2O} ;#ibm computer ACCOUNT task
export CUE2RUN=${CUE2RUN:-shared} ;#dev or devhigh or 1
export CUE2FTP=${CUE2FTP:-$CUE2RUNA} ;#queue for data transfer
export GROUP=${GROUP:-g01} ;#account group
export webhost=${webhost:-"emcrzdm.ncep.noaa.gov"} ;#host for web display
export webhostid=${webhostid:-$LOGNAME} ;#id of webhost
export ftpdir=${WEBDIR:-/home/people/emc/www/htdocs/gmb/$webhostid}/vsdb
export doftp=${SEND2WEB:-"NO"} ;#whether or not to sent maps to ftpdir
export vsdbsave=${vsdbsave:-/stmp/$LOGNAME/VSDB/vsdb_data} ;#place where vsdb database is saved
chost=`echo $(hostname) |cut -c 1-1 `
chost2=`echo $(hostname) |cut -c 1-2 `
if [ $machine = THEIA ]; then
export vsdbhome=${vsdbhome:-/scratch4/NCEPDEV/global/save/Fanglin.Yang/VRFY/vsdb} ;#script home, do not change
export GNOSCRUB=${GNOSCRUB:-/scratch4/NCEPDEV/global/noscrub} ;#archive directory
export STMP=${STMP:-/scratch4/NCEPDEV/stmp3} ;#temporary directory
export PTMP=${PTMP:-/scratch4/NCEPDEV/stmp3} ;#temporary directory
export obdata=/scratch4/NCEPDEV/global/save/Fanglin.Yang/obdata ;#observation data for making 2dmaps
export gstat=/scratch4/NCEPDEV/global/noscrub/stat ;#global stats directory
export gfsvsdb=$gstat/vsdb_data ;#operational gfs vsdb database
export canldir=$gstat/canl ;#consensus analysis directory
export ecmanldir=$gstat/ecm ;#ecmwf analysis directory
export OBSPCP=$gstat/OBSPRCP ;#observed precip for verification
export gfswgnedir=$gstat/wgne1 ;#operational gfs precip QPF scores
export gfsfitdir=$gstat/surufits ;#Suru operational model fit-to-obs database
export gdas_prepbufr_arch=$gstat/prepbufr/gdas
export ndasbufr_arch=$gstat/prepbufr/ndas
export nambufr_arch=$gstat/prepbufr/nam
export SUBJOB=$vsdbhome/bin/sub_theia ;#script for submitting batch jobs
export CUE2FTP=service ;#data transfer queue
export NWPROD=$vsdbhome/nwprod ;#common utilities and libs included in /nwprod
export GRADSBIN=/apps/grads/2.0.1a/bin ;#GrADS executables
export IMGCONVERT=/usr/bin/convert ;#image magic converter
export FC=/apps/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort ;#intel compiler
export FFLAG="-O2 -convert big_endian -FR" ;#intel compiler options
export APRUN=""
export COMROTNCO=${COMROTNCO:-/scratch4/NCEPDEV/rstprod/com}
export COMROTNAM=$COMROTNCO
elif [ $machine = HERA ]; then
export vsdbhome=${vsdbhome:-/scratch1/NCEPDEV/global/Fanglin.Yang/save/VRFY/vsdb} ;#script home, do not change
export GNOSCRUB=${GNOSCRUB:-/scratch1/NCEPDEV/global} ;#archive directory
export STMP=${STMP:-/scratch1/NCEPDEV/stmp2} ;#temporary directory
export PTMP=${PTMP:-/scratch1/NCEPDEV/stmp2} ;#temporary directory
export obdata=/scratch4/NCEPDEV/global/save/Fanglin.Yang/obdata ;#observation data for making 2dmaps
export gstat=/scratch1/NCEPDEV/global/Fanglin.Yang/stat ;#global stat dir
export gfsvsdb=$gstat/vsdb_data ;#operational gfs vsdb database
export canldir=$gstat/canl ;#consensus analysis directory
export ecmanldir=$gstat/ecm ;#ecmwf analysis directory
export OBSPCP=$gstat/OBSPRCP ;#observed precip for verification
export gfswgnedir=$gstat/wgne1 ;#operational gfs precip QPF scores
export gfsfitdir=$gstat/surufits ;#Suru operational model fit-to-obs database
export gdas_prepbufr_arch=$gstat/prepbufr/gdas
export ndasbufr_arch=$gstat/prepbufr/ndas
export nambufr_arch=$gstat/prepbufr/nam
export SUBJOB=$vsdbhome/bin/sub_theia ;#script for submitting batch jobs
export CUE2FTP=service ;#data transfer queue
export NWPROD=$vsdbhome/nwprod ;#common utilities and libs included in /nwprod
export GRADSBIN=/apps/grads/2.0.1a/bin ;#GrADS executables
export IMGCONVERT=/usr/bin/convert ;#image magic converter
export FC=/apps/intel/parallel_studio_xe_2019.4.070/compilers_and_libraries_2019/linux/bin/intel64
export FFLAG="-O2 -convert big_endian -FR" ;#intel compiler options
export APRUN=""
export COMROTNCO=${COMROTNCO:-/scratch1/NCEPDEV/rstprod/com}
export COMROTNAM=$COMROTNCO
elif [ $machine = JET ]; then
export vsdbhome=${vsdbhome:-/pan2/projects/gnmip/Fanglin.Yang/VRFY/vsdb} ;#script home, do not change
export GNOSCRUB=${GNOSCRUB:-/pan2/projects/gnmip/$LOGNAME/noscrub} ;#temporary directory
export STMP=${STMP:-/pan2/projects/gnmip/$LOGNAME/ptmp} ;#temporary directory
export PTMP=${PTMP:-/pan2/projects/gnmip/$LOGNAME/ptmp} ;#temporary directory
export obdata=/pan2/projects/gnmip/Fanglin.Yang/VRFY/obdata ;#observation data for making 2dmaps
export gstat=/pan2/projects/gnmip/Fanglin.Yang/VRFY/stat ;#global stats directory
export gfsvsdb=$gstat/vsdb_data ;#operational gfs vsdb database
export canldir=$gstat/canl ;#consensus analysis directory
export ecmanldir=$gstat/ecm ;#ecmwf analysis directory
export OBSPCP=$gstat/OBSPRCP ;#observed precip for verification
export gfswgnedir=$gstat/wgne1 ;#operational gfs precip QPF scores
export gfsfitdir=$gstat/surufits ;#Suru operational model fit-to-obs database
export gdas_prepbufr_arch=$gstat/prepbufr/gdas
export SUBJOB=$vsdbhome/bin/sub_jet ;#script for submitting batch jobs
export NWPROD=$vsdbhome/nwprod ;#common utilities and libs included in /nwprod
export GRADSBIN=/opt/grads/2.0.a2//bin/grads ;#GrADS executables
export IMGCONVERT=/usr/bin/convert ;#image magic converter
export FC=/opt/intel/Compiler/11.1/072//bin/intel64/ifort ;#intel compiler
export FFLAG="-O2 -convert big_endian -FR" ;#intel compiler options
export APRUN=""
elif [ $chost = t -o $machine = WCOSS ]; then
export vsdbhome=${vsdbhome:-/global/save/Fanglin.Yang/VRFY/vsdb} ;#script home, do not change
export GNOSCRUB=${GNOSCRUB:-/global/noscrub} ;#archive directory
export STMP=${STMP:-/stmp} ;#temporary directory
export PTMP=${PTMP:-/ptmp} ;#temporary directory
export obdata=/global/save/Fanglin.Yang/obdata ;#observation data for making 2dmaps
export gstat=/global/noscrub/Fanglin.Yang/stat ;#global stats directory
export gfsvsdb=$gstat/vsdb_data ;#operational gfs vsdb database
export canldir=$gstat/canl ;#consensus analysis directory
export ecmanldir=$gstat/ecm ;#ecmwf analysis directory
export OBSPCP=$gstat/OBSPRCP ;#observed precip for verification
export gfswgnedir=$gstat/wgne1 ;#operational gfs precip QPF scores
export gfsfitdir=$gstat/surufits ;#Suru operational model fit-to-obs database
export gdas_prepbufr_arch=/global/noscrub/Fanglin.Yang/prepbufr/gdas ;#ops gdas prepbufr archive
export ndasbufr_arch=/global/noscrub/Fanglin.Yang/prepbufr/ndas
export nambufr_arch=/global/noscrub/Fanglin.Yang/prepbufr/nam
export SUBJOB=$vsdbhome/bin/sub_wcoss ;#script for submitting batch jobs
export CUE2FTP=transfer ;#data transfer queue
export NWPROD=$vsdbhome/nwprod ;#common utilities and libs included in /nwprod
export GRADSBIN=/usrx/local/GrADS/2.0.2/bin ;#GrADS executables
export IMGCONVERT=/usrx/local/ImageMagick/6.8.3-3/bin/convert ;#image magic converter
export FC=/usrx/local/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort ;#intel compiler
export FFLAG="-O2 -convert big_endian -FR" ;#fortran compiler options
export APRUN=""
export COMROTNCO=${COMROTNCO:-/gpfs/hps/nco/ops/com}
export COMROTNAM=${COMROTNAM:-/gpfs/dell1/nco/ops/com}
elif [ $machine = WCOSS_C ]; then
export vsdbhome=${vsdbhome:-/gpfs/hps3/emc/global/noscrub/Fanglin.Yang/VRFY/vsdb} ;#script home, do not change
export GNOSCRUB=${GNOSCRUB:-/gpfs/hps3/emc/global/noscrub} ;#archive directory
export STMP=${STMP:-/gpfs/hps3/stmp} ;#temporary directory
export PTMP=${PTMP:-/gpfs/hps3/ptmp} ;#temporary directory
export obdata=/gpfs/hps3/emc/global/noscrub/Fanglin.Yang/obdata ;#observation data for making 2dmaps
export gstat=/gpfs/hps3/emc/global/noscrub/Fanglin.Yang/stat ;#global stats directory
export gfsvsdb=$gstat/vsdb_data ;#operational gfs vsdb database
export canldir=$gstat/canl ;#consensus analysis directory
export ecmanldir=$gstat/ecm ;#ecmwf analysis directory
export OBSPCP=$gstat/OBSPRCP ;#observed precip for verification
export gfswgnedir=$gstat/wgne ;#operational gfs precip QPF scores
export gfsfitdir=$gstat/fit2obs ;#Suru operational model fit-to-obs database
export gdas_prepbufr_arch=/gpfs/hps3/emc/global/noscrub/Fanglin.Yang/prepbufr/gdas ;#ops gdas prepbufr archive
export ndasbufr_arch=/gpfs/hps3/emc/global/noscrub/Fanglin.Yang/prepbufr/ndas
export nambufr_arch=/gpfs/hps3/emc/global/noscrub/Fanglin.Yang/prepbufr/nam
export SUBJOB=$vsdbhome/bin/sub_wcoss_c ;#script for submitting batch jobs
export CUE2FTP=dev_transfer ;#data transfer queue
export NWPROD=$vsdbhome/nwprod ;#common utilities and libs included in /nwprod
export GRADSBIN=/usrx/local/dev/GrADS/2.0.2/bin
export IMGCONVERT=/usr/bin/convert ;#image magic converter
export FC=/opt/intel/composer_xe_2015.3.187/bin/intel64/ifort
export FFLAG="-O2 -convert big_endian -FR" ;#fortran compiler options
export APRUN="aprun -n 1 -N 1 -j 1 -d 1"
. $MODULESHOME/init/sh
module load prod_envir
module load GrADS/2.0.2
export COMROTNCO=${COMROTNCO:-$COMROOT}
export COMROTNAM=${COMROTNAM:-$COMROOTp3}
elif [ $machine = WCOSS_DELL_P3 ]; then
export vsdbhome=${vsdbhome:-/gpfs/dell2/emc/modeling/noscrub/Fanglin.Yang/VRFY/vsdb} ;#script home, do not change
export GNOSCRUB=${GNOSCRUB:-/gpfs/dell2/emc/modeling/noscrub} ;#archive directory
export STMP=${STMP:-/gpfs/dell2/stmp} ;#temporary directory
export PTMP=${PTMP:-/gpfs/dell2/ptmp} ;#temporary directory
export obdata=/gpfs/dell2/emc/modeling/noscrub/Fanglin.Yang/obdata ;#observation data for making 2dmaps
export gstat=/gpfs/dell2/emc/modeling/noscrub/Fanglin.Yang/stat ;#global stats directory
export gfsvsdb=$gstat/vsdb_data ;#operational gfs vsdb database
export canldir=$gstat/canl ;#consensus analysis directory
export ecmanldir=$gstat/ecm ;#ecmwf analysis directory
export OBSPCP=$gstat/OBSPRCP ;#observed precip for verification
export gfswgnedir=$gstat/wgne ;#operational gfs precip QPF scores
export gfsfitdir=$gstat/fit2obs ;#Suru operational model fit-to-obs database
export gdas_prepbufr_arch=/gpfs/dell2/emc/modeling/noscrub/Fanglin.Yang/stat/prepbufr/gdas ;#ops gdas prepbufr archive
export ndasbufr_arch=/gpfs/dell2/emc/modeling/noscrub/Fanglin.Yang/stat/prepbufr/ndas
export nambufr_arch=/gpfs/dell2/emc/modeling/noscrub/Fanglin.Yang/stat/prepbufr/nam
export SUBJOB=$vsdbhome/bin/sub_wcoss_d ;#script for submitting batch jobs
export CUE2FTP=dev_transfer ;#data transfer queue
export NWPROD=$vsdbhome/nwprod ;#common utilities and libs included in /nwprod
if [ ! -z $MODULESHOME ]; then
. $MODULESHOME/init/bash
module load ips/18.0.1.163
module load impi/18.0.1
module load prod_envir/1.0.2
module use -a /usrx/local/dev/modulefiles
module load GrADS/2.2.0
module load imagemagick/6.9.9-25
module load CFP/2.0.1
fi
export GRADSBIN=/usrx/local/dev/packages/grads/2.2.0/bin
export IMGCONVERT=/usrx/local/dev/packages/ImageMagick/6.9.9-25/bin/convert
export FC=/usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/bin/intel64/ifort
export FFLAG="-O2 -convert big_endian -FR" ;#fortran compiler options
export APRUN="mpirun -n 1 " ;#affix to run batch jobs
export COMROTNCO=${COMROTNCO:-$COMROOT}
export COMROTNAM=${COMROTNAM:-$COMROOTp3}
fi
if [ $gfs_cyc = 1 ]; then
export vhrlist=${vhrlist:-"$cycle"} ;#verification hours for each day
export fcyclist="$cycle" ;#forecast cycles to be included in stats computation
export cyc2runvsdb="$cycle" ;#cycle to run vrfy which will generate vsdb data for all cycles of the day
elif [ $gfs_cyc = 2 ]; then
export vhrlist=${vhrlist:-"00 12 "} ;#verification hours for each day
export fcyclist="00 12" ;#forecast cycles to be included in stats computation
export cyc2runvsdb=00 ;#cycle to run vrfy which will generate vsdb data for all cycles of the day
elif [ $gfs_cyc = 4 ]; then
export vhrlist=${vhrlist:-"00 06 12 18"} ;#verification hours for each day
export fcyclist="00 06 12 18" ;#forecast cycles to be included in stats computation
export cyc2runvsdb=00 ;#cycle to run vrfy which will generate vsdb data for all cycles of the day
else
echo "gfs_cyc must be 1, 2 or 4, quit vsdbjob"
exit
fi
if [ $cycle != $cyc2runvsdb ]; then
MAKEVSDBDATA=NO
MAKEMAPS=NO
VRFYG2OBS=NO
fi
if [ $cycle != 00 -a $cycle != 12 ]; then
CONUSPLOTS=NO
CONUSDATA=NO
fi
### --------------------------------------------------------------
### make vsdb database
if [ $MAKEVSDBDATA = YES ] ; then
### --------------------------------------------------------------
export fcyclist="$fcyclist" ;#all fcst cycles to be included in verification
export expnlist=$exp1name ;#experiment names
export expdlist=$exp1dir ;#exp online archive directories
export complist=$(hostname) ;#computers where experiments are run
export dumplist=".gfs." ;#file format pgb${asub}${fhr}${dump}${yyyymmdd}${cyc}
export anl_type=$anl_type ;#analysis type for verification: gfs, gdas or canl
export DATEST=$DATEST ;#verification starting date
export DATEND=$DATEND ;#verification ending date
export vlength=$vlength ;#forecast length in hour
export asub=${asub:-a} ;#string in pgb anal file after pgb, say, pgbanl, pgbhnl
export fsub=${fsub:-f} ;#string in pgb fcsy file after pgb, say, pgbf06, pgbh06
if [ ! -d $vsdbhome ]; then
echo "$vsdbhome does not exist "
exit
fi
if [ ! -d $expdlist ]; then
echo "$expdlist does not exist "
exit
fi
export rundir=$rundir0/acrmse_stat
#export listvar1=fcyclist,vhrlist,expnlist,expdlist,complist,dumplist,DATEST,DATEND,vlength,rundir
#export listvar2=machine,anl_type,scppgb,sfcvsdb,canldir,ecmanldir,vsdbsave,vsdbhome,gd,NWPROD
#export listvar="$listvar1,$listvar2"
${vsdbhome}/verify_exp_step1.sh
### --------------------------------------------------------------
fi
### --------------------------------------------------------------
### --------------------------------------------------------------
### make AC and RMSE maps
if [ $MAKEMAPS = YES ] ; then
### --------------------------------------------------------------
#
export mdlist=${mdlist:-"gfs $exp1name"} ;#experiment names, up to 10
export fcyclist="$fcyclist" ;#forecast cycles to show on map
export DATEST=${VSDB_START_DATE:-$DATEST} ;#map starting date starting date to show on map
export DATEND=$DATEND ;#verification ending date to show on map
export vlength=$vlength ;#forecast length in hour to show on map
export maptop=${maptop:-10} ;#can be set to 10, 50 or 100 hPa for cross-section maps
export maskmiss=${maskmiss:-1} ;#remove missing data from all models to unify sample size, 0-->NO, 1-->Yes
set -A namelist $mdlist
export rundir=$rundir0/acrmse_map
${vsdbhome}/verify_exp_step2.sh
### --------------------------------------------------------------
fi
### --------------------------------------------------------------
### --------------------------------------------------------------
### make CONUS precip plots
if [ $CONUSPLOTS = YES ] ; then
### --------------------------------------------------------------
export expnlist=$mdlist ;#experiment names, up to 6
export expdlist=${expd_list:-"$exp1dir $exp1dir $exp1dir $exp1dir $exp1dir $exp1dir"} ;#precip stats online archive dirs
export complist=${comp_list:-"$(hostname) $(hostname) $(hostname) $(hostname) $(hostname) $(hostname) "} ;#computers where experiments are run
export cycle=$cycle ;#cycle to make QPF plots
export DATEST=$DATEST ;#forecast starting date to show on map
export DATEND=$(echo $($NWPROD/util/exec/ndate -${VBACKUP_PRCP:-00} ${DATEND}00 ) |cut -c1-8 )
export rundir=$rundir0/rain_map
export scrdir=${vsdbhome}/precip
export vhour=${vhr_rain:-${vhour:-180}} ;#verification length in hour
${scrdir}/plot_pcp.sh
### --------------------------------------------------------------
fi
### --------------------------------------------------------------
### --------------------------------------------------------------
### compute precip threat score stats over CONUS
if [ $CONUSDATA = YES ] ; then
### --------------------------------------------------------------
export cycle=$cycle ;#cycle to generate QPF stats data
export expnlist=$exp1name ;#experiment names
export expdlist=`dirname $COMROT` ;#exp online archive directories
export complist=$(hostname) ;#computers where experiments are run
export dumplist=".gfs." ;#file format pgb${asub}${fhr}${dump}${yyyymmdd}${cyc}
export DATEST=`$NWPROD/util/exec/ndate -${VBACKUP_PRCP:-00} ${DATEST}00 |cut -c 1-8 ` ;#verification starting date
export DATEND=`$NWPROD/util/exec/ndate -${VBACKUP_PRCP:-00} ${DATEND}00 |cut -c 1-8 ` ;#verification starting date
export ftyplist=${ftyplist:-"flxf"} ;#file types: pgbq or flxf
export dumplist=${dumplist:-".gfs."} ;#file format ${ftyp}f${fhr}${dump}${yyyymmdd}${cyc}
export ptyplist=${ptyplist:-"PRATE"} ;#precip types in GRIB: PRATE or APCP
export fhout=6 ;#forecast output frequency in hours
export vhour=${vhr_rain:-${vhour:-180}} ;#verification length in hour
export ARCDIR=${ARCDIR1:-$GNOSCRUB/$LOGNAME/archive} ;#directory to save stats data
export rundir=$rundir0/rain_stat
export scrdir=${vsdbhome}/precip
#export listvar1=expnlist,expdlist,complist,ftyplist,dumplist,ptyplist,bucket,fhout,cyclist,vhour
#export listvar2=machine,DATEST,DATEND,ARCDIR,rundir,scrdir,OBSPCP,mapdir,scppgb,NWPROD
#export listvar="$listvar1,$listvar2"
${scrdir}/mkup_rain_stat.sh
### --------------------------------------------------------------
fi
### --------------------------------------------------------------
### --------------------------------------------------------------
### make grid2obs vsdb database
if [ $VRFYG2OBS = YES ] ; then
### --------------------------------------------------------------
export cyclist="$fcyclist" ;#all fcst cycles to be included in verification
export expnlist="$exp1name" ;#experiment names
export expdlist="$exp1dir" ;#exp online archive directories
export complist="$(hostname)" ;#computers where experiments are run
export dumplist=".gfs." ;#file format pgb${asub}${fhr}${dump}${yyyymmdd}${cyc}
export fhoutair="6" ;#forecast output frequency in hours for raobs vrfy
export fhoutsfc="3" ;#forecast output frequency in hours for sfc vrfy
export gdtype="3" ;#pgb file resolution, 2 for 2.5-deg and 3 for 1-deg
export vsdbsfc="YES" ;#run sfc verification
export vsdbair="YES" ;#run upper-air verification
if [ $vlength -ge 168 ]; then
export vlength=168 ;#forecast length in hour
else
export vlength=$vlength ;#forecast length in hour
fi
export DATEST=`$NWPROD/util/exec/ndate -${VBACKUP_G2OBS:-00} ${DATEST}00 |cut -c 1-8 ` ;#verification starting date
export DATEND=`$NWPROD/util/exec/ndate -${VBACKUP_G2OBS:-00} ${DATEND}00 |cut -c 1-8 ` ;#verification ending date
export batch=YES
export rundir=$rundir0/grid2obs_stat
export HPSSTAR=${HPSSTAR:-/u/Fanglin.Yang/bin/hpsstar}
export hpssdirlist=${hpsslist:-"/5year/NCEPDEV/emc-global/$LOGNAME/$machine"}
export runhpss=${runhpss:-NO} ;#run hpsstar in batch mode if data are missing
if [ ! -d $vsdbhome ]; then
echo "$vsdbhome does not exist "
exit
fi
if [ ! -d $expdlist ]; then
echo "$expdlist does not exist "
exit
fi
#listvar1=vsdbhome,vsdbsave,cyclist,expnlist,expdlist,dumplist,complist,fhoutair,fhoutsfc,vsdbsfc,vsdbair,gdtype,vlength
#listvar2=NWPROD,SUBJOB,ACCOUNT,CUE2RUN,CUE2FTP,GROUP,DATEST,DATEND,rundir,HPSSTAR,gdas_prepbufr_arch,batch,runhpss,APRUN,COMROTNCO
#export listvar=$listvar1,$listvar2
${vsdbhome}/grid2obs/grid2obs.sh
### --------------------------------------------------------------
fi
### --------------------------------------------------------------
exit