-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathexgfs_prdgen_manager.sh
executable file
·74 lines (63 loc) · 1.22 KB
/
exgfs_prdgen_manager.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
#! /usr/bin/env bash
#
# Script name: exgfs_pmgr.sh.sms
#
# This script monitors the progress of the gfs_fcst job
#
source "$HOMEgfs/ush/preamble.sh"
hour=00
TEND=384
TCP=385
if [ -e pgrb2_hours ]; then
rm -f pgrb2_hours
fi
while [ $hour -lt $TCP ];
do
hour=$(printf "%02d" $hour)
echo $hour >>pgrb2_hours
if [ 10#$hour -lt 240 ]
then
if [ 10#$hour -lt 120 ]
then
let "hour=hour+1"
else
let "hour=hour+3"
fi
else
let "hour=hour+12"
fi
done
pgrb2_jobs=$(cat pgrb2_hours)
#
# Wait for all fcst hours to finish
#
icnt=1
while [ $icnt -lt 1000 ]
do
for fhr in ${pgrb2_jobs}
do
if [ -s ${COMIN}/gfs.${cycle}.master.grb2if${fhr} ]
then
# if [ $fhr -eq 0 ]
# then
# ecflow_client --event release_pgrb2_anl
# fi
ecflow_client --event release_pgrb2_${fhr}
# Remove current fhr from list
pgrb2_jobs=$(echo ${pgrb2_jobs} | sed "s/${fhr}//")
fi
done
result_check=$(echo ${pgrb2_jobs} | wc -w)
if [ $result_check -eq 0 ]
then
break
fi
sleep 10
icnt=$((icnt + 1))
if [ $icnt -ge 720 ]
then
msg="ABORTING after 2 hours of waiting for GFS POST hours ${pgrb2_jobs}."
err_exit $msg
fi
done
exit