-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathrun_gfsmos_master.sh.dell
executable file
·765 lines (686 loc) · 21.6 KB
/
run_gfsmos_master.sh.dell
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
#!/bin/sh
#######################################################################
# run_gfsmos.sh
#
# History:
# 03/29/13 Scallion Created (Adapted from Eric Engle's
# "master" scripts)
# 12/03/13 Scallion Added ptype/wxgrid
#
# Purpose:
# To run the GFS-MOS operational suite
#
#######################################################################
set -x
if (( $# > 1 )); then
echo "Incorrect number of arguments."
echo "Syntax: $0 [PDYCYC (optional)]"
echo "Exiting..."
exit 1
fi
##export PATH=./:$PATH
#######################################################################
# Only run on the dev machine
#######################################################################
#/u/Scott.Scallion/bin/run-on-dev.sh
#[[ $? -eq 1 ]] && exit 1
#######################################################################
# Source bash_profile to run with proper modules on cron
#######################################################################
#elim . ~/.bash_profile 1> /dev/null 2>&1
#. ~/.bash_profile
#######################################################################
# Check the host to determine whether tide or gyre is prod
#######################################################################
#chkhost=`hostname | cut -c1`
if [[ $SITE == "GYRE" ]] || [[ $SITE == "SURGE" ]] || [[ $SITE == "VENUS" ]]; then
gort="g"
elif [[ $SITE == "TIDE" ]] || [[ $SITE == "LUNA" ]] || [[ $SITE == "MARS" ]]; then
gort="t"
fi
#######################################################################
# Set global variables neede in the run script and/or each individual
# job script.
#######################################################################
. $MODULESHOME/init/bash
#module purge 2>/dev/null
module load EnvVars/1.0.2 2>/dev/null
module load ips/18.0.1.163 2>/dev/null
module load impi/18.0.1 2>/dev/null
module load lsf/10.1 2>/dev/null
module load prod_envir/1.0.3 2>/dev/null
module load prod_util/1.1.4 2>/dev/null
module load CFP/2.0.1 2>/dev/null
module use -a /gpfs/dell1/nco/ops/nwpara/modulefiles/compiler_prod/ips/18.0.1
module load grib_util/1.1.1 2>/dev/null
export FORT_BUFFERED=TRUE
export KMP_AFFINITY=disabled
export envir=prod
export RUN_ENVIR=${RUN_ENVIR:-""}
#export QUEUE=dev
#------------------
export SENDCOM=YES
export SENDCOM_SAVE=$SENDCOM
#------------------
#--------------------------------
# COMDATEROOT defined by module prod_util
##export PTMPROOT=/gpfs/dell2/ptmp/$USER
##export STMPROOT=/gpfs/dell2/stmp/$USER
##export MODELROOT=/gpfs/dell2/mdl/mdlstat/noscrub/usr/$USER/nwprod
##export MODELDIR=$MODELROOT/gfsmos.v5.0.6
##export CODEDIR=$MODELROOT/mos_shared.v2.6.1
export PTMPROOT=$ROTDIR/gfsmos.$PDY
export STMPROOT=$RUNDIR/gfsmos.$PDY
export DATAROOT=$STMPROOT
##export MODELROOT=/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/gfsmos
export MODELROOT=/gpfs/dell2/mdl/mdlstat/noscrub/usr/Scott.Scallion/gfsv16
#export MODELDIR=$MODELROOT/gfsmos.v5.2.0.1
export MODELDIR=$MODELROOT/gfsmos.v5.2.0.1-restructure
export CODEDIR=/gpfs/dell1/nco/ops/nwpara/mos_shared.v2.6.5
#--------------------------------
#--------------------------------
##export PDY=20180419
##export PDY=`date -u +%Y%m%d`
##export prevday=`date -u --date="${PDY} 0000 UTC 24 hours ago" +%Y%m%d`
dateIn=$1
#if [ $REALTIME = "YES" ]; then
# GDATE=`$NDATE -24 $dateIn`
# dateIn=$GDATE
#fi
export PDY=`echo $dateIn | cut -c 1-8`
export cyc=`echo $dateIn | cut -c 9-10`
export prevday=`$NDATE -24 ${PDY}00 | cut -c1-8`
#--------------------------------
#--------------------------------
##let hour=`date -u +"%-H"`
##if [[ $hour -ge 4 && $hour -lt 10 ]]; then
## export cyc=00
## export range=both
##elif [[ $hour -ge 10 && $hour -lt 16 ]]; then
## export cyc=06
## export range=both
##elif [[ $hour -ge 16 && $hour -lt 22 ]]; then
## export cyc=12
## export range=both
##elif [[ $hour -ge 22 && $hour -le 23 ]]; then
## export cyc=18
## export range=both
##else
## export cyc=18
## export PDY=$prevday
## export range=both
##fi
##
##cyc_list="00 06 12 18"
##if [[ $# == 1 ]] && [[ $cyc_list =~ $1 ]]; then
## export cyc=$1
## if [ "$cyc" == "00" -o "$cyc" == "12" ]; then
## export range=both
## else
## export range=both
## fi
##elif [[ $# == 1 ]]; then
## echo "$1 is not a valid cycle (choose 00 or 12)"
## exit 1
##fi
# ERIC ENGLE 05/30/2018 - PATCH FOR FV3GFS WINTER 17/18 PARALLEL
export range=${range:-"both"}
#if [ $cyc -eq 00 -o $cyc -eq 12 ]; then
# if [ $cyc -eq 00 ]; then
# export range=both
# else
# export range=short
# fi
# ERIC ENGLE 05/30/2018 - PATCH FOR FV3GFS WINTER 17/18 PARALLEL
export stnonly='Y'
export skipmodel=n
export skipprep=n
export cycle="t${cyc}z"
export pid="gfs_qprod.$$"
export dailylog=$PTMPROOT/dailylog/log.$PDY
export jlogfile=$dailylog/jlogfile_gfsmos
mkdir -p $dailylog
export SENDDBN=NO
export SENDDBN_NTC=NO
export GET_IOPROFILE=NO
# Specify Execution Areas
export HOMEmdl=$MODELDIR
export HOMEcode=$CODEDIR
#export utilscript=/gpfs/hps/mdl/mdlstat/noscrub/usr/Scott.Scallion/ush
if [ ! -d $HOMEmdl ]; then
echo "$HOMEmdl does not exist"
exit 1
fi
if [ ! -d $HOMEcode ]; then
echo "$HOMEcode does not exist"
exit 1
fi
#-------------------------------------
# Define COMOUT (COMIN will vary by job)
#export GFSDIR=$COMROOThps/gfs/prod/gfs.$PDY
##export GFSDIR=$COMROOThps/gfs/prod/gfs.$PDY
##export COMINgfs=$GFSDIR
##export COMOUT=$PTMPROOT/qprod/gfsmos.$PDY
export GFSDIR=$COMROOT/gfs/prod/gfs.${PDY}
if [[ "$RUN_ENVIR" = "emc" ]] ; then
export GFSDIR=$ROTDIR/gfs.${PDY}
fi
export COMINgfs=$GFSDIR
export COMOUT=$ROTDIR/gfsmos.$PDY
#export COMINm1=$PTMPROOT/gfsmos.$prevday
#export COMINm1=$PTMPROOT/qprod/gfsmos_gmos_pre-nbmv2.$prevday
#export COMINm1=$PTMPROOT/qprod/gfsmos.$prevday
if [[ ! -d $PTMPROOT/qprod ]]; then
mkdir -p $PTMPROOT/qprod
fi
if [[ ! -d $COMOUT ]]; then
mkdir -p $COMOUT
fi
export COMOUTwmo=$PTMPROOT/wmo
if [[ ! -d $COMOUTwmo ]]; then
mkdir -p $COMOUTwmo
fi
# NOTE: On WCOSS_DELL_P3 the directory from which bsub
# is executed must exist when the submitted job
# begins. Otherwise, the submitted job fails
# with TERM_CWD_NOTEXIST error.
mkdir -p $DATAROOT
cd $DATAROOT
if [ "$range" == "short" -o "$range" == "both" ]; then
########################################################################
########################################################################
# SHORT-RANGE JOBS
########################################################################
########################################################################
########################################################################
# Wait for 1 degree model data
########################################################################
##if [ "$skipmodel" != "y" ]; then
##let attempts=1
##while [[ $attempts -le 120 ]]
##do
## if [[ -f $GFSDIR/gfs.$cycle.pgrb2.1p00.f096 ]]; then
## echo "Model file found. Proceeding..."
## break
## else
## if [[ $attempts -le 60 ]]; then
## sleep 60
## else
## sleep 180
## fi
## attempts=$((attempts+1))
## fi
##done
##
##if [[ $attempts -gt 120 ]]; then
## echo "Waited 4 hours for model file, but it did not appear."
## echo "Exiting..."
## exit 1
##fi
##
##fi #endif for skipmodel
########################################################################
# Wait for 1/4 degree model data
########################################################################
##if [ "$skipmodel" != "y" ]; then
##let attempts=1
##while [[ $attempts -le 120 ]]
##do
## if [[ -f $GFSDIR/gfs.$cycle.pgrb2.0p25.f096 ]]; then
## echo "Model file found. Proceeding..."
## break
## else
## if [[ $attempts -le 60 ]]; then
## sleep 60
## else
## sleep 180
## fi
## attempts=$((attempts+1))
## fi
##done
##if [[ $attempts -gt 120 ]]; then
## echo "Waited 4 hours for model file, but it did not appear."
## echo "Exiting..."
## exit 1
##fi
##
##fi #endif for skipmodel
########################################################################
# Wait for 1.0 degree GFS model files before running (Pacific MOS)
########################################################################
##if [ "$skipmodel" != "y" ]; then
##let attempts=1
##while [[ $attempts -le 120 ]]
##do
## if [[ -f $GFSDIR/gfs.$cycle.pgrb2.1p00.f096 ]]; then
## echo "1.0 degree model file found. Proceeding..."
## break
## else
## if [[ $attempts -le 60 ]]; then
## sleep 60
## else
## sleep 180
## fi
## attempts=$((attempts+1))
## fi
##done
##
##if [[ $attempts -gt 120 ]]; then
## echo "Waited 4 hours for model file, but it did not appear."
## echo "Exiting..."
## exit 1
##fi
##
##fi #endif for skipmodel
########################################################################
# JGFSMOS_PREP47
########################################################################
if [[ "$skipprep" != "y" ]]; then
export job=gfsmos_prep_${cyc}_${pid}
export COMIN=$GFSDIR
jobCard=$HOMEmdl/jobs/JGFSMOS_STN_PREP
# Define DATA and create directory
export DATA=$STMPROOT/qprod/gfsmos_prep_${cyc}
export logfile=$dailylog/$job.out
export out_dir=$dailylog
export NTASK=3
export PTILE=3
export OMP_NUM_THREADS=1
bsub -J $job \
-o $logfile \
-q $QUEUE \
-x \
-n $NTASK \
-R "span[ptile=$PTILE]" \
-W 0:25 \
-P $ACCOUNT \
$jobCard
fi #end for skipprep
########################################################################
# JGFSMOS_FORECAST
########################################################################
if [[ ! -d /gpfs/dell1/nco/ops/com/mos/prod/hry_mos.$PDY ]]; then
export ROTATE=/gpfs/dell2/mdl/mdlstat/noscrub/rotate
export COMINhry_mos=$PTMPROOT/hourly.$PDY
if [[ ! -d $COMINhry_mos ]]; then
mkdir -p $COMINhry_mos
fi
\cp $ROTATE/hry/${PDY}03 $COMINhry_mos/sfctbl.03
\cp $ROTATE/hry/${PDY}09 $COMINhry_mos/sfctbl.09
\cp $ROTATE/hry/${PDY}15 $COMINhry_mos/sfctbl.15
\cp $ROTATE/hry/${PDY}21 $COMINhry_mos/sfctbl.21
fi
# Change COMIN to get files from user's PTMP "qprod" area
export COMIN=$COMOUT
export job=gfsmos_fcst_${cyc}_${pid}
jobCard=$HOMEmdl/jobs/JGFSMOS_STN_FORECAST
export DATA=$STMPROOT/qprod/gfsmos_fcst_${cyc}
export logfile=$dailylog/$job.out
export out_dir=$dailylog
# Set dependencies
if [[ "$skipprep" != "y" ]]; then
deps="done(gfsmos_prep_${cyc}_${pid})"
else
deps=""
fi
if [[ $cyc == "00" || $cyc == "12" ]] && [[ "$stnonly" != "Y" ]]; then
complist="metar pac cooprfcmeso goe higoe akgoe tstms"
complist2="copopo3 coptype akpopo3 akptype"
else
complist="metar cooprfcmeso tstms"
complist2=""
fi
if [[ $cyc == "00" || $cyc == "12" ]] && [[ "$stnonly" != "Y" ]]; then
export NTASK=11
export PTILE=1
export OMP_NUM_THREADS=1
elif [[ $cyc == "00" || $cyc == "12" ]] && [[ "$stnonly" == "Y" ]]; then
export NTASK=5
export PTILE=5
export OMP_NUM_THREADS=1
else
export NTASK=4
export PTILE=4
export OMP_NUM_THREADS=1
fi
bsub -J ${job} \
-o $logfile \
-q ${QUEUE} \
-x \
-n $NTASK \
-R "span[ptile=$PTILE]" \
-W 0:20 \
-P $ACCOUNT \
-w "$deps" \
$jobCard
########################################################################
# JGFSMOS_PRDGEN
########################################################################
jobCard=$HOMEmdl/jobs/JGFSMOS_STN_PRDGEN
export job=gfsmos_prdgen_${cyc}_${pid}
# Change COMIN back to COMOUT
export COMIN=$COMOUT
# Define DATA and create directory
export DATA=$STMPROOT/qprod/gfsmos_prdgen_${cyc}
export logfile=$dailylog/$job.out
export out_dir=$dailylog
# Set dependencies
deps="done(gfsmos_fcst_${cyc}_${pid})"
# Set Nodes
if [ $cyc -eq 00 -o $cyc -eq 12 ] && [[ "$stnonly" != "Y" ]]; then
#nodes='1*{select[craylinux && !vnode]} + 168*{select[craylinux && vnode]span[ptile=24]}'
export NTASK=1
export PTILE=1
export OMP_NUM_THREADS=20
else
#nodes='1*{select[craylinux && !vnode]} + 24*{select[craylinux && vnode]span[ptile=24]}'
export NTASK=1
export PTILE=1
export OMP_NUM_THREADS=1
fi
bsub -J ${job} \
-o $logfile \
-q ${QUEUE} \
-x \
-n $NTASK \
-R "span[ptile=$PTILE]" \
-W 0:30 \
-P $ACCOUNT \
-w "$deps" \
$jobCard
########################################################################
# JGFSMOS_WX_PRDGEN (00z and 12z only)
########################################################################
#if [ $cyc -eq 00 -o $cyc -eq 12 ]; then
# jobCard=$HOMEmdl/jobs/JGFSMOS_WX_PRDGEN
# export job=gfsmos_wx_prdgen_${cyc}_${pid}
# # Change COMIN back to COMOUT
# export COMIN=$COMOUT
# # Define DATA and create directory
# export DATA=$STMPROOT/qprod/gfsmos_wx_prdgen_${cyc}
# export logfile=$dailylog/$job.out
# export out_dir=$dailylog
# # Set dependencies
# deps="done(gfsmos_prdgen_${cyc}_${pid})"
#
# export NTASK=2
# export PTILE=1
# export OMP_NUM_THREADS=20
#
# #bsub -J ${job} -oo $logfile -q ${QUEUE} -P MDLST-T2O \
# # -W 1:00 -M 1000 \
# # -extsched 'CRAYLINUX[]' \
# # -R '1*{select[craylinux && !vnode]} + 48*{select[craylinux && vnode]span[ptile=24]}' \
# # -w "$deps" \
# # $jobCard
#
# bsub -J ${job} \
# -o $logfile \
# -q ${QUEUE} -x \
# -n $NTASK \
# -R "span[ptile=$PTILE]" \
# -W 1:00 \
# -M 3000 \
# -P $ACCOUNT \
# -w "$deps" \
# $jobCard
#fi
fi #endif short
########################################################################
########################################################################
# EXTENDED-RANGE JOBS
########################################################################
########################################################################
if [ "$range" == "ext" -o "$range" == "both" ]; then
########################################################################
# Wait for 1/4 degree model data
########################################################################
#if [ "$skipmodel" != "y" ]; then
#let attempts=1
#proj_list=`seq -f %03g 252 12 384`
#for tau in $proj_list
#do
# while [[ $attempts -le 120 ]]
# do
# if [[ -f $GFSDIR/gfs.$cycle.pgrb2.0p25.f${tau} && -f $GFSDIR/gfs.$cycle.pgrb2.0p50.f${tau} ]]; then
# echo "Model file found. Proceeding to next..."
# break
# else
# if [[ $attempts -le 60 ]]; then
# sleep 60
# else
# sleep 180
# fi
# attempts=$((attempts+1))
# fi
# done
#done
#
#if [[ $attempts -gt 120 ]]; then
# echo "Waited 4 hours for model file, but it did not appear."
# echo "Exiting..."
# exit 1
#fi
#fi #endif for skipmodel
########################################################################
# Wait for 1.0/2.5 degree GFS model files before running (Pacific GFS)
########################################################################
#if [ "$skipmodel" != "y" ]; then
#let attempts1deg=1
#proj_list=`seq -f %03g 204 12 384`
#for tau in $proj_list
#do
# while [[ $attempts1deg -le 120 ]]
# do
## ERIC ENGLE 05/30/2018 - PATCH FOR FV3GFS WINTER 17/18 PARALLEL
# #if [[ -f $GFSDIR/gfs.$cycle.pgrb2.1p00.f384 && -f $GFSDIR/gfs.$cycle.pgrb2.2p50.f240 ]]; then
# if [ $cyc -eq 00 ]; then
# waitfile=$GFSDIR/gfs.$cycle.pgrb2.1p00.f384
# else
# waitfile=$GFSDIR/gfs.$cycle.pgrb2.1p00.f180
# fi
# if [[ -f $waitfile ]]; then
## ERIC ENGLE 05/30/2018 - PATCH FOR FV3GFS WINTER 17/18 PARALLEL
# #echo "1.0/2.5 degree model files found. Proceeding to next..."
# echo "1.0 degree model files found. Proceeding to next..."
# break
# else
# if [[ $attempts1deg -le 60 ]]; then
# sleep 60
# else
# sleep 180
# fi
# attempts1deg=$((aattempts1deg+1))
# fi
# done
#done
#
#if [[ $attempts1deg -gt 120 ]]; then
# echo "Waited 4 hours for 1.0 degree model file, but it did not appear."
# echo "Exiting..."
# exit 1
#fi
#fi #endif for skipmodel
########################################################################
# JGFSMOS_EXT_PREP47
########################################################################
if [[ "$skipprep" != "y" ]]; then
export job=gfsmos_extprep_${cyc}_${pid}
export COMIN=$GFSDIR
jobCard=$HOMEmdl/jobs/JGFSMOS_EXT_STN_PREP
# Define DATA and create directory
export DATA=$STMPROOT/qprod/gfsmos_extprep_${cyc}
export logfile=$dailylog/$job.out
export out_dir=$dailylog
export NTASK=2
export PTILE=2
export OMP_NUM_THREADS=1
# bsub -J $job \
# -o $logfile \
# -q $QUEUE \
# -W 2:00 \
# -M 2500 \
# -P MDLST-T2O \
# -extsched 'CRAYLINUX[]' \
# -R '1*{select[craylinux && !vnode]} + 24*{select[craylinux && vnode]span[ptile=24]}' \
# $jobCard
bsub -J ${job} \
-o $logfile \
-q ${QUEUE} \
-n $NTASK \
-R "span[ptile=$PTILE]" \
-W 2:00 \
-P $ACCOUNT \
$jobCard
fi #end for skipprep
# Skip EXT_FORECAST for 06/18
if [ $cyc -eq 00 -o $cyc -eq 12 ]; then
########################################################################
# JGFSMOS_EXT_FORECAST
########################################################################
if [[ ! -d /gpfs/dell1/nco/ops/com/mos/prod/hry_mos.$PDY ]]; then
export ROTATE=/gpfs/dell2/mdl/mdlstat/noscrub/rotate
export COMINhry_mos=$PTMPROOT/hourly.$PDY
if [[ ! -d $COMINhry_mos ]]; then
mkdir -p $COMINhry_mos
fi
\cp $ROTATE/hry/${PDY}03 $COMINhry_mos/sfctbl.03
\cp $ROTATE/hry/${PDY}09 $COMINhry_mos/sfctbl.09
\cp $ROTATE/hry/${PDY}15 $COMINhry_mos/sfctbl.15
\cp $ROTATE/hry/${PDY}21 $COMINhry_mos/sfctbl.21
fi
# Change COMIN to get files from user's PTMP "qprod" area
export COMIN=$COMOUT
export job=gfsmos_extfcst_${cyc}_${pid}
jobCard=$HOMEmdl/jobs/JGFSMOS_EXT_STN_FORECAST
export DATA=$STMPROOT/qprod/gfsmos_extfcst_${cyc}
export logfile=$dailylog/$job.out
export out_dir=$dailylog
# Set dependencies
if [[ "$skipprep" != "y" && "$range" == "both" ]]; then
deps="done(gfsmos_extprep_${cyc}_${pid}) && done(gfsmos_fcst_${cyc}_${pid})"
elif [[ "$skipprep" != "y" && "$range" == "ext" ]]; then
deps="done(gfsmos_extprep_${cyc}_${pid})"
elif [[ "$skipprep" == "y" && "$range" == "ext" ]]; then
deps=""
else
deps="done(gfsmos_fcst_${cyc}_${pid})"
fi
if [[ $stnonly != "Y" ]]; then
export NTASK=10
export PTILE=1
export OMP_NUM_THREADS=1
else
export NTASK=3
export PTILE=3
export OMP_NUM_THREADS=1
fi
#bsub -J ${job} -oo $logfile -q $QUEUE -P MDLST-T2O \
# -W 1:00 -M 2000 \
# -extsched 'CRAYLINUX[]' \
# -R '1*{select[craylinux && !vnode]} + 24*{select[craylinux && vnode]span[ptile=24]}' \
# -w "$deps" \
# $jobCard
bsub -J ${job} \
-o $logfile \
-q ${QUEUE} \
-x \
-n $NTASK \
-R "span[ptile=$PTILE]" \
-W 1:00 \
-P $ACCOUNT \
-w "$deps" \
$jobCard
fi #endif for skipping 06/18 ext_fcst
########################################################################
# JGFSMOS_EXT_PRDGEN
########################################################################
jobCard=$HOMEmdl/jobs/JGFSMOS_EXT_STN_PRDGEN
export job=gfsmos_extprdgen_${cyc}_${pid}
# Change COMIN back to COMOUT
export COMIN=$COMOUT
# Define DATA and create directory
export DATA=$STMPROOT/qprod/gfsmos_extprdgen_${cyc}
export logfile=$dailylog/$job.out
export out_dir=$dailylog
# Set dependencies
if [[ "$cyc" == "06" || "$cyc" == "18" ]]; then
deps="done(gfsmos_prdgen_${cyc}_${pid})"
elif [[ "$range" == "both" ]]; then
deps="done(gfsmos_extfcst_${cyc}_${pid}) && done(gfsmos_prdgen_${cyc}_${pid})"
else
deps="done(gfsmos_extfcst_${cyc}_${pid})"
fi
# Set Nodes
if [ $cyc -eq 00 -o $cyc -eq 12 ] && [[ "$stnonly" != "Y" ]]; then
#nodes='1*{select[craylinux && !vnode]} + 168*{select[craylinux && vnode]span[ptile=24]}'
export NTASK=1
export PTILE=1
export OMP_NUM_THREADS=20
else
#nodes='1*{select[craylinux && !vnode]} + 24*{select[craylinux && vnode]span[ptile=24]}'
export NTASK=1
export PTILE=1
export OMP_NUM_THREADS=1
fi
#bsub -J ${job} -oo $logfile -q ${QUEUE} -P MDLST-T2O \
# -W 1:00 -M 2000 \
# -extsched 'CRAYLINUX[]' \
# -R "$nodes" \
# -w "$deps" \
# $jobCard
bsub -J ${job} \
-o $logfile \
-q ${QUEUE} \
-x \
-n $NTASK \
-R "span[ptile=$PTILE]" \
-W 1:00 \
-P $ACCOUNT \
-w "$deps" \
$jobCard
# Exit here with $cyc is 06 or 18
if [ $cyc -eq 06 -o $cyc -eq 18 ]; then
exit 0
fi
########################################################################
# JGFSMOS_WX_EXT_PRDGEN
########################################################################
#jobCard=$HOMEmdl/jobs/JGFSMOS_WX_EXT_PRDGEN
#export job=gfsmos_wx_extprdgen_${cyc}_${pid}
## Change COMIN back to COMOUT
#export COMIN=$COMOUT
## Define DATA and create directory
#export DATA=$STMPROOT/qprod/gfsmos_wx_extprdgen_${cyc}
#export logfile=$dailylog/$job.out
#export out_dir=$dailylog
## Set dependencies
#if [[ "$range" == "both" ]]; then
# deps="done(gfsmos_extprdgen_${cyc}_${pid}) && done(gfsmos_wx_prdgen_${cyc}_${pid})"
#else
# deps="done(gfsmos_extprdgen_${cyc}_${pid})"
#fi
#
#export NTASK=1
#export PTILE=1
#export OMP_NUM_THREADS=20
##bsub -J ${job} -oo $logfile -q ${QUEUE} -P MDLST-T2O \
## -W 1:00 -M 1000 \
## -extsched 'CRAYLINUX[]' \
## -R '1*{select[craylinux && !vnode]} + 48*{select[craylinux && vnode]span[ptile=24]}' \
## -w "$deps" \
## $jobCard
#bsub -J ${job} \
# -o $logfile \
# -q ${QUEUE} -x \
# -n $NTASK \
# -R "span[ptile=$PTILE]" \
# -W 1:00 \
# -M 3000 \
# -P $ACCOUNT \
# -w "$deps" \
# $jobCard
fi #endif for ext/both
#---------------------
export SENDCOM=$SENDCOM_SAVE
exit 0