-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJREFS_PREPROC_FV3
executable file
·276 lines (214 loc) · 7.25 KB
/
JREFS_PREPROC_FV3
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
#!/bin/sh
#############################################################
# 02/02/2015 Binbin Zhou, create for run all scripts
# 08/11/2022 Jun Du, added a variable "region"
# 03/20/2023 Jun Du, the package name changed to rrfs_enspost
# 04/10/2023 Jun Du, added variable "name" to rearrange member's order
# by naming ctl run as mem01 rather than mem00
# 04/25/2023 Jun Du, added a version of time-lag ensemble (type=single or timelag)
# 02/06/2024 M. Pyle Switch to REFS
#############################################################
########################################
# Preliminary data setup step
########################################
set -xa
export PS4='$SECONDS + '
date
###################################
# Specify NET and RUN Name and model
####################################
export NET=${NET:-refs}
export RUN=${RUN:-refs}
export IOBUF_PARAMS='*:size=8M:count=8'
###############################################################
# This block can be modified for different Production test
# environment. This is used for operational testings
###############################################################
## PDY not included here as pull data from PDYm1 as well
# without timelagging maybe should include PDY here?
# this should definitely be COMINrrfs
export COMINrrfs=${COMINrrfs:-$(compath.py ${envir}/com/rrfs/${rrfs_ver}/rrfs)}
export HOMErefs=${HOMErefs:-$NWROOT/refs.${refs_ver}}
export EXECrefs=${EXECrefs:-$HOMErefs/exec}
export PARMrefs=${PARMrefs:-$HOMErefs/parm}
export USHrefs=${USHrefs:-$HOMErefs/ush}
export FIXrefs=${FIXrefs:-$HOMErefs/fix}
export SCRIPTSrefs=${SCRIPTSrefs:-$HOMErefs/scripts}
# CLEAN
export ndate=/apps/ops/prod/nco/core/prod_util.v2.0.8/exec/ndate
###########################################################
# obtain unique process id (pid) and make temp directories
###########################################################
echo here with DATA $DATA
echo here with DATAROOT $DATAROOT
export pid=$$
export DATA=${DATA:-${DATAROOT}/${jobid}.${pid}}
echo now have DATA $DATA
mkdir -p $DATA
rm -rf $DATA/*
cd $DATA
####################################
# Determine Job Output Name on System
####################################
export pgmout="OUTPUT.$$"
export cycle=${cycle:-t${cyc}z}
##################################################
# SENDCOM - Copy Files From TMPDIR to $COMOUT
# SENDDBN - Issue DBNet Client Calls
##################################################
export SENDCOM=${SENDCOM:-YES}
export SENDECF=${SENDECF:-YES}
export SENDDBN=${SENDDBN:-YES}
export SENDDBN_NTC=${SENDDBN_NTC:-NO}
###################################
# Set up the UTILITIES
###################################
msg="JOB $job HAS BEGUN"
postmsg "$msg"
#
# Run setpdy and initialize PDY variables
#
export cycle=${cycle:-t${cyc}z}
setpdy.sh
. ./PDY
echo have PDY as $PDY
##############################################
# Define running directory and COM directories
##############################################
export COMOUT=${COMOUT:-$(compath.py -o $NET/${refs_ver})/${RUN}.${PDY}}
if [ ! -d $COMOUT ] ; then
mkdir -p $COMOUT/ensprod
mkdir -p $COMOUT/verf_g2g
fi
export GESOUT=${GESOUT:-${GESROOT}/${RUN}}
# if [ ! -e ${GESIN}.${PDY} ] ; then
# mkdir -p ${GESIN}.${PDY}
# fi
#######################################################
# Pass information which is needed to run the Script
#######################################################
# export VERBOSE=YES
###################################################
hrlist="00 01 02 03 04 05 06 07 08 09 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"
mems="01 02 03 04 05 06"
region=${NEST}
echo defined region $region
if [ -e poe.fv3 ]
then
rm poe.fv3
fi
for mem in $mems
do
if [ $type = single ]; then
if [ $mem = 01 ]; then name=00; fi
if [ $mem = 02 ]; then name=01; fi
if [ $mem = 03 ]; then name=02; fi
if [ $mem = 04 ]; then name=03; fi
if [ $mem = 05 ]; then name=04; fi
if [ $mem = 06 ]; then name=05; fi
if [ $mem = 07 ]; then name=06; fi
if [ $mem = 08 ]; then name=07; fi
if [ $mem = 09 ]; then name=08; fi
if [ $mem = 10 ]; then name=09; fi
else
if [ $mem = 01 ]; then name=00; fi
if [ $mem = 02 ]; then name=01; fi
if [ $mem = 03 ]; then name=02; fi
if [ $mem = 04 ]; then name=03; fi
if [ $mem = 05 ]; then name=04; fi
if [ $mem = 06 ]; then name=05; fi
if [ $mem = 07 ]; then name=00; fi
if [ $mem = 08 ]; then name=01; fi
if [ $mem = 09 ]; then name=02; fi
if [ $mem = 10 ]; then name=03; fi
if [ $mem = 11 ]; then name=04; fi
if [ $mem = 12 ]; then name=05; fi
fi
for hr in $hrlist
do
if [ $type = timelag ]; then
if [ $mem = 07 -o $mem = 08 -o $mem = 09 -o $mem = 10 -o $mem = 11 -o $mem = 12 ];then
backdate=`$ndate -06 $PDY$cyc`
backday=`echo $backdate | cut -c1-8`
backcyc=`echo $backdate | cut -c9-10`
echo "$USHrefs/enspost_preprocess_fv3_1h.sh ${backday} ${backcyc} ${mem} ${name} $hr ${region}" >> poe.fv3
else
echo "$USHrefs/enspost_preprocess_fv3_1h.sh $PDY ${cyc} ${mem} ${name} $hr ${region}" >> poe.fv3
fi
else
echo "$USHrefs/enspost_preprocess_fv3_1h.sh $PDY ${cyc} ${mem} ${name} $hr ${region}" >> poe.fv3
fi
done
done
chmod 775 poe.fv3
mpiexec -n $NTASK -ppn $PTILE --cpu-bind verbose,core cfp ./poe.fv3
export err=$?; err_chk
# need to generate 3 h QPF
if [ -e poe.3hqpf ]
then
rm poe.3hqpf
fi
if [ -e poe.3hqpf.tlb ]
then
rm poe.3hqpf.tlb
fi
for mem in $mems
do
echo " calling preprocess_fv3_3hapcp.sh for mem " $mem
if [ $type = single ]; then
if [ $mem = 01 ]; then name=00; fi
if [ $mem = 02 ]; then name=01; fi
if [ $mem = 03 ]; then name=02; fi
if [ $mem = 04 ]; then name=03; fi
if [ $mem = 05 ]; then name=04; fi
if [ $mem = 06 ]; then name=05; fi
if [ $mem = 07 ]; then name=06; fi
if [ $mem = 08 ]; then name=07; fi
if [ $mem = 09 ]; then name=08; fi
if [ $mem = 10 ]; then name=09; fi
else
if [ $mem = 01 ]; then name=00; fi
if [ $mem = 02 ]; then name=01; fi
if [ $mem = 03 ]; then name=02; fi
if [ $mem = 04 ]; then name=03; fi
if [ $mem = 05 ]; then name=04; fi
if [ $mem = 06 ]; then name=05; fi
if [ $mem = 07 ]; then name=00; fi
if [ $mem = 08 ]; then name=01; fi
if [ $mem = 09 ]; then name=02; fi
if [ $mem = 10 ]; then name=03; fi
if [ $mem = 11 ]; then name=04; fi
if [ $mem = 12 ]; then name=05; fi
fi
#
if [ $type = timelag ]; then
if [ $mem = 07 -o $mem = 08 -o $mem = 09 -o $mem = 10 -o $mem = 11 -o $mem = 12 ];then
backdate=`$ndate -06 $PDY$cyc`
backday=`echo $backdate | cut -c1-8`
backcyc=`echo $backdate | cut -c9-10`
echo "$USHrefs/enspost_preprocess_fv3_3hapcp.sh ${region} ${backday} ${backcyc} ${mem} ${name}" >> poe.3hqpf.tlb
else
echo "$USHrefs/enspost_preprocess_fv3_3hapcp.sh ${region} ${PDY} ${cyc} ${mem} ${name}" >> poe.3hqpf
fi
else
echo "$USHrefs/enspost_preprocess_fv3_3hapcp.sh ${region} ${PDY} ${cyc} ${mem} ${name}" >> poe.3hqpf
fi
done
nproc=`cat poe.3hqpf | wc -l`
chmod 775 poe.3hqpf
# mpiexec -n $nproc -ppn $nproc --cpu-bind verbose,core cfp ./poe.3hqpf
mpiexec -n $nproc -ppn 2 --cpu-bind verbose,core cfp ./poe.3hqpf
export err=$?; err_chk
if [ -e poe.3hqpf.tlb ]
then
nproc=`cat poe.3hqpf.tlb | wc -l`
chmod 775 poe.3hqpf.tlb
mpiexec -n $nproc -ppn $nproc --cpu-bind verbose,core cfp ./poe.3hqpf.tlb
export err=$?; err_chk
fi
# end QPF
cd $DATAROOT
if [ $KEEPDATA = NO ]; then rm -rf $DATA; fi
date