-
Notifications
You must be signed in to change notification settings - Fork 162
/
JGDAS_GLOBAL_AERO_ANALYSIS_FINALIZE
executable file
·112 lines (86 loc) · 3.11 KB
/
JGDAS_GLOBAL_AERO_ANALYSIS_FINALIZE
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
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"
#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base aeroanl aeroanlfinal"
config_path=${EXPDIR:-${NWROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
. "${config_path}/config.${config}"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
done
##########################################
# Source machine runtime environment
##########################################
. "${HOMEgfs}/env/${machine}.env" aeroanlfinal
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
##############################################
# Run setpdy and initialize PDY variables
##############################################
export cycle="t${cyc}z"
setpdy.sh
. ./PDY
##############################################
# Set variables used in the script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export COMPONENT=${COMPONENT:-chem}
##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL${job}"}
export DATA=${DATA:-${DATAROOT}/aeroanl_${CDATE}}
mkdir -p "${DATA}"
cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1)
##############################################
# Determine Job Output Name on System
##############################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile
##############################################
# Begin JOB SPECIFIC work
##############################################
GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}
export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."
export GSUFFIX=${GSUFFIX:-${SUFFIX}}
export ASUFFIX=${ASUFFIX:-${SUFFIX}}
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}}
mkdir -p "${COMOUT}"
# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/${COMPONENT}"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}/${COMPONENT}"
# Add UFSDA to PYTHONPATH
export PYTHONPATH="${HOMEgfs}/sorc/gdas.cd/ush/:${PYTHONPATH}"
###############################################################
# Run relevant script
EXSCRIPT=${GDASAEROFINALPY:-${HOMEgfs}/scripts/exgdas_global_aero_analysis_finalize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
##############################################
# End JOB SPECIFIC work
##############################################
##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi
##########################################
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || exit 1
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"
exit 0