forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJGLOBAL_WAVE_POST_SBS
More file actions
executable file
·60 lines (49 loc) · 1.81 KB
/
JGLOBAL_WAVE_POST_SBS
File metadata and controls
executable file
·60 lines (49 loc) · 1.81 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
49
50
51
52
53
54
55
56
57
58
59
60
#! /usr/bin/env bash
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "wavepostsbs" -c "base wave wavepostsbs"
source "${USHgfs}/wave_domain_grid.sh"
# Add default errchk = err_chk
export errchk=${errchk:-err_chk}
export MP_PULSE=0
# Set COM Paths and GETGES environment
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMIN_WAVE_PREP:COM_WAVE_PREP_TMPL \
COMIN_WAVE_HISTORY:COM_WAVE_HISTORY_TMPL \
COMOUT_WAVE_GRID:COM_WAVE_GRID_TMPL
for out_dir in "${COMOUT_WAVE_GRID}"; do
if [[ ! -d "${out_dir}" ]]; then mkdir -p "${out_dir}"; fi
done
if [[ -n "${wavepostGRD}" || -n "${waveinterpGRD}" ]]; then
for grdID in ${wavepostGRD} ${waveinterpGRD}; do
process_grdID "${grdID}"
YMD=${PDY} HH=${cyc} GRDRESNAME=${grdNAME} declare_from_tmpl -rx \
"COMOUT_WAVE_GRID_${GRDREGION}_${GRDRES}:COM_WAVE_GRID_RES_TMPL"
out_dir_varname="COMOUT_WAVE_GRID_${GRDREGION}_${GRDRES}"
out_dir=${!out_dir_varname}
if [[ ! -d "${out_dir}" ]]; then mkdir -p "${out_dir}"; fi
done
else
echo "Both wavepostGRD and waveinterpGRD are empty. No grids to process."
fi
# Set wave model ID tag to include member number
# if ensemble; waveMEMB var empty in deterministic
# Set wave model ID tag to include member number
# if ensemble; waveMEMB var empty in deterministic
membTAG='p'
if [ "${waveMEMB}" == "00" ]; then membTAG='c'; fi
export membTAG
export WAV_MOD_TAG=${RUN}wave${waveMEMB}
export CFP_VERBOSE=1
# Execute the Script
${SCRgfs}/exgfs_wave_post_gridded_sbs.sh
err=$?
if [ ${err} -ne 0 ]; then
echo "FATAL ERROR: ex-script of GWES_POST failed!"
exit ${err}
fi
##########################################
# Remove the Temporary working directory
##########################################
cd ${DATAROOT}
[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA}
exit 0