forked from NOAA-EMC/CFSv2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJCFS_CDAS_VRFYFITS
More file actions
executable file
·166 lines (133 loc) · 4.62 KB
/
JCFS_CDAS_VRFYFITS
File metadata and controls
executable file
·166 lines (133 loc) · 4.62 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/bin/ksh
set -xa
####################################
# Specify NET and RUN Name and model
####################################
export NET=cfs
export RUN=cdas
export RUN1=cdas1
export host=${host:-`hostname | cut -c1`}
export jlogfile=${jlogfile:-/dev/null}
date
export PS4='$SECONDS + '
# #############################################
# SETUP FITS TO OBS PROCESSING VARIABLES
# ##############################################
##########################################################
# obtain unique process id (pid) and make temp directory
##########################################################
export pid=$$
export DATA=$DATAROOT/$job.$pid
mkdir -p $DATA
cd $DATA
####################################
# Determine Job Output Name on System
####################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile
export cycle=t${cyc}z
####################################
# VERBOSE - Specify Verbose Output
####################################
export VERBOSE=${VERBOSE:-YES}
##########################################################
# define cfs directories/scripts/executables
##########################################################
export EXECcfs=$HOMEcfs/exec
export PARMcfs=$HOMEcfs/parm
export USHcfs=$HOMEcfs/ush
export FIXcfs=$HOMEcfs/fix
###############################################
# Define the config file
###############################################
export CDAS_CONFIG_FILE=${CDAS_CONFIG_FILE:-$PARMcfs/cfs_parm_am/cfs_cdas_config}
##############################
# Run setpdy and initialize PDY variables
##############################
sh setpdy.sh
. ./PDY
export CDATE=${CDATE:-${PDY}$cyc}
export YYYY=`echo $PDY |cut -c1-4`
##############################################
# Define COM directories
##############################################
export COMROT=$COMROOT/${NET}/${envir}
export COMIN=$COMROOT/${NET}/${envir}/${RUN}.${PDY}
export COMOUT=$COMROOT/${NET}/${envir}/${RUN}.${PDY}
mkdir -m775 -p $COMOUT
export COMINIC=$COMROT/cdas.$PDYm1
##############################################
# Define GES directories
##############################################
export gespath=${gespath:-${GESROOT}/${envir}}
export GESdir=$gespath/cdas.${PDY}
export RESDIR=${RESDIR:-$GESdir}
mkdir -p $RESDIR
env
#############################################################
# execute the updated fit script for cfs and gfs
#############################################################
HOMEf2o=$HOMEcfs/Fit2Obs
EXECf2o=$HOMEf2o/exec
fitdir=$HOMEf2o/batrun
TMPDIR=$DATAROOT/fit2obs.$$; mkdir -p $TMPDIR
export OMP_NUM_THREADS=${FITOMP:-1}
export MPIRUN="mpirun -n 3"
export KMP_AFFINITY=disabled
export KEEPDATA=${KEEPDATA:-NO}
export NEMS=${NEMS:-YES}
export PRVT=${PRVT:-$HOMEcfs/fix/cfs_fix_cdas/prepobs_errtable.global}
export HYBLEVS=${HYBLEVS:-$HOMEcfs/fix/cfs_fix_am/global_hyblev.l65.txt}
################################################################
# Run the fits for this time for the CFS and the GFS models
# --------------------------------------------------------------
# The vars COM_INA and COM_INF are quoted strings which evaluate
# at runtime in Fit2Obs processing. They are
# pathname templates which may need to be changed. Also the tags
# which cycle EXPNAM are preset configs for different models
# and they might be adjusted too.
#################################################################
expnams=${expnams:-'GFS16 CFS22'}
for EXPNAM in $expnams ; do
if [[ $EXPNAM = GFS16 ]] ; then
COM_INA='$COMROOT/gfs/prod/gdas.$PDY/$cyc/atmos'
COM_INF='$COMROOT/gfs/prod/gfs.$fdy/$fzz/atmos'
COMFIT=$COMROOT/gfs/prod
OMP_NUM_THREADS=1
RUN_ENVIR=netcdf
ACPROFit=YES
CONVNETC=YES
fi
if [[ $EXPNAM = CFS22 ]] ; then
COM_INA='$COMROOT/cfs/prod/cdas.$PDY'
COM_INF='$COMROOT/cfs/prod/cfs/cfs.$fdy/$fzz/6hrly_grib_01'
COMFIT=$COMROOT/cfs/prod
OMP_NUM_THREADS=9
RUN_ENVIR=cfs
ACPROFit=NO
CONVNETC=NO
fi
ARCDIR=$DATA/$EXPNAM.fits
time $fitdir/runfits $EXPNAM $CDATE $COMFIT
err=$?; err_chk
# tar up the fits and save in COMROT/fit2obs
cd $ARCDIR
EXP=$(echo $EXPNAM|cut -c 1-3)
FITARC=$COMROT/fit2obs/${EXP}.fits/${YYYY}; mkdir -p $FITARC
tar -cf $FITARC/$EXP.fits.$CDATE *
chgrp rstprod $FITARC/$EXP.fits.$CDATE
chmod 640 $FITARC/$EXP.fits.$CDATE
err=$?; err_chk
done
###################################################
# msg end of job and clean up temperary directory
###################################################
cat $pgmout
msg="ENDED NORMALLY."
postmsg "$jlogfile" "$msg"
########################################
# Remove the Temporary working directory
########################################
cd $DATAROOT
if [ ${KEEPDATA:-NO} = NO ] ; then rm -rf $DATA ; fi
date