forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexgfs_pmgr.sh
More file actions
executable file
·48 lines (42 loc) · 1.02 KB
/
exgfs_pmgr.sh
File metadata and controls
executable file
·48 lines (42 loc) · 1.02 KB
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
#! /usr/bin/env bash
#
# Script name: exgfs_pmgr.sh.sms
#
# This script monitors the progress of the gfs_fcst job
#
hour=0
TEND=384
if [[ -e posthours ]]; then
rm -f posthours
fi
declare -a posthours
while [[ "${hour}" -le "${TEND}" ]]; do
posthours+=("${hour}")
if [[ ${hour} -lt 240 ]]; then
if [[ ${hour} -lt 120 ]]; then
hour=$((hour + 1))
else
hour=$((hour + 3))
fi
else
hour=$((hour + 12))
fi
done
#
# Wait for all fcst hours to finish
#
sleep_interval=10
max_tries=1000
for fhr in "${posthours[@]}"; do
fhr3=$(sprintf "%03d" "${fhr}")
log_file="${COMIN_ATMOS_HISTORY}/${RUN}.${cycle}.atm.logf${fhr3}.txt"
if ! wait_for_file "${log_file}" "${sleep_interval}" "${max_tries}"; then
msg="FATAL ERROR: After 2 hours of waiting for GFS FCST hour ${fhr3}."
err_exit "${msg}"
fi
if [[ ${fhr} -eq 0 ]]; then
ecflow_client --event release_postanl
fi
ecflow_client --event "release_post${fhr3}"
done
exit