forked from NOAA-EMC/EVS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJEVS_CAM_PREP
executable file
·143 lines (105 loc) · 3.94 KB
/
JEVS_CAM_PREP
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
#!/bin/bash
########################################
# Preliminary data setup step
########################################
set -x
##################################################
# SENDMAIL - Send Email Alerts When Missing Data
# SENDECF - Flag Events on ecFLOW
# SENDCOM - Copy Files From TMPDIR to $COMOUT
# SENDDBN - Issue DBNet Client Calls
##################################################
export SENDMAIL=${SENDMAIL:-NO}
export SENDCOM=${SENDCOM:-YES}
export SENDDBN=${SENDDBN:-YES}
export SENDECF=${SENDECF:-YES}
####################################
# SET SHELL PROCESSING VARIABLES
####################################
export PS4='$SECONDS + '
date
###########################################################
# obtain unique LSF id (jobid) and make temp directories
###########################################################
export pid=$$
export DATA=${DATA:-${DATAROOT:?}/${jobid:?}}
rm -rf $DATA
mkdir -p $DATA
cd $DATA
####################################
# Determine Job Output Name on System
####################################
####################################
# Set EVS directories
####################################
export HOMEevs=${HOMEevs:-${PACKAGEROOT}/${NET}.${evs_ver}}
export EXECevs=${EXECevs:-$HOMEevs/exec}
export FIXevs=${FIXevs:-$HOMEevs/fix}
export PARMevs=${PARMevs:-$HOMEevs/parm}
export SCRIPTSevs=${SCRIPTSevs:-$HOMEevs/scripts}
export USHevs=${USHevs:-$HOMEevs/ush}
####################################
# Run setpdy and initialize PDY variables
####################################
export cycle=${cycle:-t${vhr}z}
setpdy.sh 8
. ./PDY
if [ $VERIF_CASE = grid2obs ] ; then
export VDATE=${VDATE:-$PDYm1}
elif [ $VERIF_CASE = precip ] ; then
export VDATE=${VDATE:-$PDYm1}
elif [ $VERIF_CASE = radar ] ; then
export VDATE=${VDATE:-$PDYm1}
elif [ $VERIF_CASE = severe ] ; then
# Set verification date for severe job
export VDATE=${VDATE:-$PDYm7}
# Set correct date for SPC report data (must be relative to VDATE)
export REP_DATE=$(finddate.sh $VDATE d-1)
# Set correct date for SPC outlook data
export OTLK_DATE=${OTLK_DATE:-$PDYm1}
# Set initialization date (only for forecast prep step)
export IDATE=${IDATE:-$PDYm1}
else
err_exit "The provided VERIF_CASE, $VERIF_CASE, is not supported for the $COMPONENT $STEP step"
fi
####################################
# Define NET/RUN variables
####################################
export NET=${NET:-evs}
export STEP=${STEP:-prep}
export COMPONENT=${COMPONENT:-cam}
export RUN=${RUN:-atmos}
####################################
# Define METplus variables
####################################
export MET_PLUS_CONF="${PARMevs}/metplus_config/${STEP}/${COMPONENT}/${VERIF_CASE}"
####################################
# Define COMIN/COMOUT variables
####################################
export COMIN=${COMIN:-$(compath.py ${envir}/com/$NET/$evs_ver)}
export COMINccpa=${COMINccpa:-$(compath.py ${envir}/com/ccpa/$ccpa_ver)}
export COMINhiresw=${COMINhiresw:-$(compath.py ${envir}/com/hiresw/${hiresw_ver})}
export COMINhrrr=${COMINhrrr:-$(compath.py ${envir}/com/hrrr/${hrrr_ver})}
export COMINnam=${COMINnam:-$(compath.py ${envir}/com/nam/${nam_ver})}
export COMINobsproc=${COMINobsproc:-$(compath.py ${envir}/com/obsproc/${obsproc_ver})}
export DCOMINmrms=${DCOMINmrms:-$DCOMROOT/ldmdata/obs/upperair/mrms}
export DCOMINspc=${DCOMINspc:-$DCOMROOT}
export COMOUT=${COMOUT:-$(compath.py -o $NET/$evs_ver/$STEP/$COMPONENT)}
mkdir -p $COMOUT
export COMOUTmrms=${COMOUT}/mrms.${VDATE}
if [ $VERIF_CASE = severe ] ; then
export COMOUTlsr=${COMOUT}/spc_lsr.${REP_DATE}
export COMOUTotlk=${COMOUT}/spc_otlk.${OTLK_DATE}
elif [ $VERIF_CASE = grid2obs ] ; then
export mPINGToken=${mPINGToken:-9999}
fi
####################################
# Execute the script
####################################
$HOMEevs/scripts/$STEP/$COMPONENT/exevs_${MODELNAME}_${VERIF_CASE}_${STEP}.sh
export err=$?; err_chk
if [ "$KEEPDATA" != "YES" ]; then
cd $DATAROOT
rm -rf $DATA
fi
date