-
Notifications
You must be signed in to change notification settings - Fork 11
/
enkf_run.sh.new
226 lines (208 loc) · 8.89 KB
/
enkf_run.sh.new
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
#!/bin/sh
ulimit -s
ulimit -s unlimited
if [ $machine == 'orion' ]; then
module purge
module load intel/2018.4
module load impi/2018.4
module load mkl/2018.4
module load python
module list
fi
export nprocs=`expr $cores \/ $enkf_threads`
export mpitaskspernode=`expr $corespernode \/ $enkf_threads`
export OMP_NUM_THREADS=$enkf_threads
export OMP_STACKSIZE=2048M
export HOSTFILE=$datapath2/machinefile_enkf
iaufhrs2=`echo $iaufhrs | sed 's/,/ /g'`
for nfhr in $iaufhrs2; do
charfhr="fhr"`printf %02i $nfhr`
# check output files.
nanal=1
filemissing='no'
while [ $nanal -le $nanals ]; do
charnanal="mem"`printf %03i $nanal`
analfile="${datapath2}/sanl_${analdate}_${charfhr}_${charnanal}"
if [ ! -s $analfile ]; then
filemissing='yes'
fi
nanal=$((nanal+1))
done
done
if [ $lupd_satbiasc == ".true." ]; then
satbiasc=".true."
else
satbiasc=".false."
fi
if [ $satbiasc == ".true." ] && [ ! -s $ABIAS ]; then
filemissing='yes'
fi
if [ $filemissing == 'yes' ]; then
echo "computing enkf update..."
date
cd ${datapath2}
cat <<EOF > enkf.nml
&nam_enkf
datestring="$analdate",datapath="$datapath2",
analpertwtnh=$analpertwtnh,analpertwtsh=$analpertwtsh,analpertwttr=$analpertwttr,
analpertwtnh_rtpp=$analpertwtnh_rtpp,analpertwtsh_rtpp=$analpertwtsh_rtpp,analpertwttr_rtpp=$analpertwttr_rtpp,
covinflatemax=$covinflatemax,covinflatemin=$covinflatemin,pseudo_rh=$pseudo_rh,
corrlengthnh=$corrlengthnh,corrlengthsh=$corrlengthsh,corrlengthtr=$corrlengthtr,
nlons=$LONA,nlats=$LATA,smoothparm=$SMOOTHINF,letkf_bruteforce_search=${letkf_bruteforce_search},
saterrfact=$saterrfact,numiter=$numiter,
sprd_tol=$sprd_tol,paoverpb_thresh=$paoverpb_thresh,denkf=$denkf,
getkf_inflation=$getkf_inflation,save_inflation=.false.,
reducedgrid=${reducedgrid},nlevs=$LEVS,nanals=$nanals,imp_physics=$imp_physics,
write_spread_diag=.false.,
nhr_anal=$iaufhrs,nhr_state=$enkfstatefhrs,getkf=$getkf,
use_correlated_oberrs=${use_correlated_oberrs},use_gfs_ncio=.true.,letkf_rtps=$letkf_rtps
adp_anglebc=.true.,angord=4,newpc4pred=.true.,use_edges=.false.,emiss_bc=.true.,biasvar=-500,nobsl_max=$nobsl_max,use_qsatensmean=.true.
/
&satobs_enkf
sattypes_rad(1) = 'amsua_n15', dsis(1) = 'amsua_n15',
sattypes_rad(2) = 'amsua_n18', dsis(2) = 'amsua_n18',
sattypes_rad(3) = 'amsua_n19', dsis(3) = 'amsua_n19',
sattypes_rad(4) = 'amsub_n16', dsis(4) = 'amsub_n16',
sattypes_rad(5) = 'amsub_n17', dsis(5) = 'amsub_n17',
sattypes_rad(6) = 'amsua_aqua', dsis(6) = 'amsua_aqua',
sattypes_rad(7) = 'amsua_metop-a', dsis(7) = 'amsua_metop-a',
sattypes_rad(8) = 'airs_aqua', dsis(8) = 'airs281SUBSET_aqua',
sattypes_rad(9) = 'hirs3_n17', dsis(9) = 'hirs3_n17',
sattypes_rad(10)= 'hirs4_n19', dsis(10)= 'hirs4_n19',
sattypes_rad(11)= 'hirs4_metop-a', dsis(11)= 'hirs4_metop-a',
sattypes_rad(12)= 'mhs_n18', dsis(12)= 'mhs_n18',
sattypes_rad(13)= 'mhs_n19', dsis(13)= 'mhs_n19',
sattypes_rad(14)= 'mhs_metop-a', dsis(14)= 'mhs_metop-a',
sattypes_rad(15)= 'goes_img_g11', dsis(15)= 'imgr_g11',
sattypes_rad(16)= 'goes_img_g12', dsis(16)= 'imgr_g12',
sattypes_rad(17)= 'goes_img_g13', dsis(17)= 'imgr_g13',
sattypes_rad(18)= 'goes_img_g14', dsis(18)= 'imgr_g14',
sattypes_rad(19)= 'goes_img_g15', dsis(19)= 'imgr_g15',
sattypes_rad(20)= 'avhrr_n18', dsis(20)= 'avhrr3_n18',
sattypes_rad(21)= 'avhrr_metop-a', dsis(21)= 'avhrr3_metop-a',
sattypes_rad(22)= 'avhrr_n19', dsis(22)= 'avhrr3_n19',
sattypes_rad(23)= 'amsre_aqua', dsis(23)= 'amsre_aqua',
sattypes_rad(24)= 'ssmis_f16', dsis(24)= 'ssmis_f16',
sattypes_rad(25)= 'ssmis_f17', dsis(25)= 'ssmis_f17',
sattypes_rad(26)= 'ssmis_f18', dsis(26)= 'ssmis_f18',
sattypes_rad(27)= 'ssmis_f19', dsis(27)= 'ssmis_f19',
sattypes_rad(28)= 'ssmis_f20', dsis(28)= 'ssmis_f20',
sattypes_rad(29)= 'sndrd1_g11', dsis(29)= 'sndrD1_g11',
sattypes_rad(30)= 'sndrd2_g11', dsis(30)= 'sndrD2_g11',
sattypes_rad(31)= 'sndrd3_g11', dsis(31)= 'sndrD3_g11',
sattypes_rad(32)= 'sndrd4_g11', dsis(32)= 'sndrD4_g11',
sattypes_rad(33)= 'sndrd1_g12', dsis(33)= 'sndrD1_g12',
sattypes_rad(34)= 'sndrd2_g12', dsis(34)= 'sndrD2_g12',
sattypes_rad(35)= 'sndrd3_g12', dsis(35)= 'sndrD3_g12',
sattypes_rad(36)= 'sndrd4_g12', dsis(36)= 'sndrD4_g12',
sattypes_rad(37)= 'sndrd1_g13', dsis(37)= 'sndrD1_g13',
sattypes_rad(38)= 'sndrd2_g13', dsis(38)= 'sndrD2_g13',
sattypes_rad(39)= 'sndrd3_g13', dsis(39)= 'sndrD3_g13',
sattypes_rad(40)= 'sndrd4_g13', dsis(40)= 'sndrD4_g13',
sattypes_rad(41)= 'sndrd1_g14', dsis(41)= 'sndrD1_g14',
sattypes_rad(42)= 'sndrd2_g14', dsis(42)= 'sndrD2_g14',
sattypes_rad(43)= 'sndrd3_g14', dsis(43)= 'sndrD3_g14',
sattypes_rad(44)= 'sndrd4_g14', dsis(44)= 'sndrD4_g14',
sattypes_rad(45)= 'sndrd1_g15', dsis(45)= 'sndrD1_g15',
sattypes_rad(46)= 'sndrd2_g15', dsis(46)= 'sndrD2_g15',
sattypes_rad(47)= 'sndrd3_g15', dsis(47)= 'sndrD3_g15',
sattypes_rad(48)= 'sndrd4_g15', dsis(48)= 'sndrD4_g15',
sattypes_rad(49)= 'iasi_metop-a', dsis(49)= 'iasi616_metop-a',
sattypes_rad(50)= 'seviri_m08', dsis(50)= 'seviri_m08',
sattypes_rad(51)= 'seviri_m09', dsis(51)= 'seviri_m09',
sattypes_rad(52)= 'seviri_m10', dsis(52)= 'seviri_m10',
sattypes_rad(53)= 'amsua_metop-b', dsis(53)= 'amsua_metop-b',
sattypes_rad(54)= 'hirs4_metop-b', dsis(54)= 'hirs4_metop-b',
sattypes_rad(55)= 'mhs_metop-b', dsis(55)= 'mhs_metop-b',
sattypes_rad(56)= 'iasi_metop-b', dsis(56)= 'iasi616_metop-b',
sattypes_rad(57)= 'avhrr_metop-b', dsis(57)= 'avhrr3_metop-b',
sattypes_rad(58)= 'atms_npp', dsis(58)= 'atms_npp',
sattypes_rad(59)= 'cris_npp', dsis(59)= 'cris_npp',
sattypes_rad(60)= 'msu_n14', dsis(60)= 'msu_n14',
sattypes_rad(61)= 'hirs2_n14', dsis(61)= 'hirs2_n14',
sattypes_rad(62)= 'hirs3_n15', dsis(62)= 'hirs3_n15',
sattypes_rad(63)= 'hirs3_n16', dsis(63)= 'hirs3_n16',
sattypes_rad(64)= 'ssu_n14', dsis(64)= 'ssu_n14',
sattypes_rad(65)= 'sndr_g08', dsis(65)= 'sndr_g08',
sattypes_rad(66)= 'sndr_g09', dsis(66)= 'sndr_g09',
sattypes_rad(67)= 'sndr_g10', dsis(67)= 'sndr_g10',
sattypes_rad(68)= 'sndr_g11', dsis(68)= 'sndr_g11',
sattypes_rad(69)= 'sndr_g12', dsis(69)= 'sndr_g12',
sattypes_rad(70)= 'avhrr_n14', dsis(70)= 'avhrr3_n14',
sattypes_rad(71)= 'avhrr_n15', dsis(71)= 'avhrr3_n15',
sattypes_rad(72)= 'avhrr_n16', dsis(72)= 'avhrr3_n16',
sattypes_rad(73)= 'avhrr_n17', dsis(73)= 'avhrr3_n17',
sattypes_rad(74)= 'amsua_n16', dsis(74)= 'amsua_n16'
sattypes_rad(75)= 'amsub_n15', dsis(75)= 'amsub_n15',
sattypes_rad(76)= 'avhrr_n14', dsis(76)= 'avhrr2_n14',
sattypes_rad(77)= 'atms_n20', dsis(77)= 'atms_n20',
sattypes_rad(78)= 'cris-fsr_npp', dsis(78)= 'cris-fsr_npp',
sattypes_rad(79)= 'cris-fsr_n20', dsis(79)= 'cris-fsr_n20',
sattypes_rad(80)= 'gmi_gpm', dsis(80)= 'gmi_gpm',
sattypes_rad(81)= 'saphir_meghat', dsis(81)= 'saphir_meghat',
sattypes_rad(82)= 'amsua_metop-c', dsis(82)= 'amsua_metop-c',
sattypes_rad(83)= 'mhs_metop-c', dsis(83)= 'mhs_metop-c',
sattypes_rad(84)= 'ahi_himawari8', dsis(84)= 'ahi_himawari8',
sattypes_rad(85)= 'abi_g16', dsis(85)= 'abi_g16',
/
&END
&ozobs_enkf
sattypes_oz(1) = 'sbuv2_n11',
sattypes_oz(2) = 'sbuv2_n14',
sattypes_oz(3) = 'sbuv2_n16',
sattypes_oz(4) = 'sbuv2_n17',
sattypes_oz(5) = 'sbuv2_n18',
sattypes_oz(6) = 'sbuv2_n19',
sattypes_oz(7) = 'omi_aura',
sattypes_oz(8) = 'gome_metop-a',
sattypes_oz(9) = 'gome_metop-b',
sattypes_oz(10) = 'mls30_aura',
sattypes_oz(11) = 'ompsnp_npp',
sattypes_oz(12) = 'ompstc8_npp',
/
&END
EOF
cat enkf.nml
/bin/rm -f ${datapath2}/vlocal_eig.dat
cp ${enkfscripts}/vlocal_eig.dat ${datapath2}
/bin/rm -f ${datapath2}/enkf.log
/bin/mv -f ${current_logdir}/ensda.out ${current_logdir}/ensda.out.save
export PGM=$enkfbin
# use srun
export OMP_NUM_THREADS=$enkf_threads
export OMP_STACKSIZE=256M
export nprocs=`expr $cores \/ $OMP_NUM_THREADS`
export mpitaskspernode=`expr $corespernode \/ $OMP_NUM_THREADS`
echo "running with $OMP_NUM_THREADS threads ..."
${enkfscripts}/runmpi > ${current_logdir}/ensda.out 2>&1
if [ ! -s ${datapath2}/enkf.log ]; then
echo "no enkf log file found"
exit 1
fi
if [ $satbiasc == '.true.' ]; then
/bin/cp -f ${datapath2}/satbias_out $ABIAS
fi
else
echo "enkf update already done..."
fi # filemissing='yes'
# check output files again.
nanal=1
filemissing='no'
while [ $nanal -le $nanals ]; do
charnanal="mem"`printf %03i $nanal`
analfile=${datapath2}/sanl_${analdate}_${charfhr}_${charnanal}
if [ ! -s $analfile ]; then
filemissing='yes'
fi
nanal=$((nanal+1))
done
if [ $satbiasc == ".true." ] && [ ! -s $ABIAS ]; then
filemissing='yes'
fi
if [ $filemissing == 'yes' ]; then
echo "there are output files missing!"
exit 1
else
echo "all output files seem OK `date`"
fi
exit 0