forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexgfs_prdgen_manager.sh
More file actions
executable file
·45 lines (39 loc) · 960 Bytes
/
exgfs_prdgen_manager.sh
File metadata and controls
executable file
·45 lines (39 loc) · 960 Bytes
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
#! /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 pgrb2_hours ]]; then
rm -f pgrb2_hours
fi
declare -a pgrb2_hours
while [[ "${hour}" -le "${TEND}" ]]; do
pgrb2_hours+=("${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 "${pgrb2_hours[@]}"; do
fhr3=$(sprintf "%03d" "${fhr}")
master_file="${COMIN_ATMOS_MASTER}/gfs.${cycle}.master.grb2f${fhr3}"
if ! wait_for_file "${master_file}" "${sleep_interval}" "${max_tries}"; then
export err=1
err_exit "After 2 hours of waiting for GFS POST hour ${fhr3}."
fi
ecflow_client --event "release_pgrb2_${fhr3}"
done
exit