-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathJGDAS_ATMOS_GEMPAK
executable file
·120 lines (95 loc) · 3.3 KB
/
JGDAS_ATMOS_GEMPAK
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
113
114
115
116
117
118
119
#! /usr/bin/env bash
source "$HOMEgfs/ush/preamble.sh"
############################################
# GDAS GEMPAK PRODUCT GENERATION
############################################
##########################################################
# obtain unique process id (pid) and make temp directory
##########################################################
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p $DATA
cd $DATA
######################################
# Set up the cycle variable
######################################
export cycle=${cycle:-t${cyc}z}
###########################################
# Run setpdy and initialize PDY variables
###########################################
setpdy.sh
. PDY
################################
# Set up the HOME directory
################################
export HOMEgfs=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}}
export EXECgfs=${EXECgfs:-$HOMEgfs/exec}
export PARMgfs=${PARMgfs:-$HOMEgfs/parm}
export PARMwmo=${PARMwmo:-$HOMEgfs/parm/wmo}
export PARMproduct=${PARMproduct:-$HOMEgfs/parm/product}
export FIXgempak=${FIXgempak:-$HOMEgfs/gempak/fix}
export USHgempak=${USHgempak:-$HOMEgfs/gempak/ush}
export SRCgfs=${SRCgfs:-$HOMEgfs/scripts}
export UTILgfs=${UTILgfs:-$HOMEgfs/util}
############################################
# Set up model and cycle specific variables
############################################
export fend=09
export finc=3
export fstart=00
export GRIB=pgrb2f
export EXT=""
export DBN_ALERT_TYPE=GDAS_GEMPAK
export SENDDBN=${SENDDBN:-NO}
export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn}
###################################
# Specify NET and RUN Name and model
####################################
export NET=${NET:-gfs}
export RUN=${RUN:-gdas}
export model=${model:-gdas}
export COMPONENT=${COMPONENT:-atmos}
##############################################
# Define COM directories
##############################################
export COMIN=${COMIN:-$(compath.py ${NET}/${envir}/${RUN}.${PDY})/${cyc}/$COMPONENT}
export COMOUT=${COMOUT:-${COMROOT}/${NET}/${envir}/${RUN}.${PDY}/${cyc}/$COMPONENT/gempak}
if [ $SENDCOM = YES ] ; then
mkdir -m 775 -p $COMOUT
fi
export pgmout=OUTPUT.$$
if [ -f $DATA/poescrip ]; then
rm $DATA/poescript
fi
########################################################
# Execute the script.
echo "$SRCgfs/exgdas_atmos_nawips.sh gdas 009 GDAS_GEMPAK " >> poescript
########################################################
########################################################
# Execute the script for quater-degree grib
echo "$SRCgfs/exgdas_atmos_nawips.sh gdas_0p25 009 GDAS_GEMPAK " >>poescript
########################################################
cat poescript
chmod 775 $DATA/poescript
export MP_PGMMODEL=mpmd
export MP_CMDFILE=$DATA/poescript
ntasks=${NTASKS_GEMPAK:-$(cat $DATA/poescript | wc -l)}
ptile=${PTILE_GEMPAK:-4}
threads=${NTHREADS_GEMPAK:-1}
export OMP_NUM_THREADS=$threads
APRUN="mpirun -n $ntasks cfp "
APRUN_GEMPAKCFP=${APRUN_GEMPAKCFP:-$APRUN}
APRUNCFP=$(eval echo $APRUN_GEMPAKCFP)
$APRUNCFP $DATA/poescript
export err=$?; err_chk
############################################
# print exec I/O output
############################################
if [ -e "$pgmout" ] ; then
cat $pgmout
fi
###################################
# Remove temp directories
###################################
if [ "$KEEPDATA" != "YES" ] ; then
rm -rf $DATA
fi