-
Notifications
You must be signed in to change notification settings - Fork 11
/
global_cycle_driver.sh
executable file
·89 lines (70 loc) · 2.68 KB
/
global_cycle_driver.sh
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
#!/bin/sh
set -ax
#-------------------------------------------------------------------------------------------------
# Update surface fields in FV3 restart files on the cubed-sphere grid
# George Gayno, 09/XX/2017
# Rahul Mahajan, 10/11/2017
#-------------------------------------------------------------------------------------------------
export machine=${machine:-"WCOSS_C"}
export CASE=${CASE:-C768} # resolution of tile: 48, 96, 192, 384, 768, 1152, 3072
export CDATE=${CDATE:-${cdate:-2017031900}} # format yyyymmddhh yyyymmddhh ...
export CDUMP=${CDUMP:-gfs} # gfs or gdas
pwd=$(pwd)
export NWPROD=${NWPROD:-$pwd}
export DMPDIR=${DMPDIR:-$NWPROD}
export BASE_GSM=${BASE_GSM:-$NWPROD/global_shared}
export FIXgsm=${FIXgsm:-$BASE_GSM/fix/fix_am}
export FIXfv3=${FIXfv3:-$BASE_GSM/fix/fix_fv3_gmted2010}
ntiles=${ntiles:-6}
DONST=${DONST:-"NO"}
COMIN=${COMIN:-$pwd}
COMOUT=${COMOUT:-$pwd}
CYCLESH=${CYCLESH:-$BASE_GSM/ush/global_cycle.sh}
export CYCLEXEC=${CYCLEXEC:-$BASE_GSM/exec/global_cycle}
export OMP_NUM_THREADS_CY=${OMP_NUM_THREADS_CY:-24}
export APRUNCY=${APRUNCY:-"time"}
export VERBOSE=${VERBOSE:-"YES"}
export FHOUR=${FHOUR:-0}
export DELTSFC=${DELTSFC:-6}
PDY=$(echo $CDATE | cut -c1-8)
cyc=$(echo $CDATE | cut -c9-10)
export FNTSFA=${FNTSFA:-$DMPDIR/$CDATE/$CDUMP/${CDUMP}.t${cyc}z.rtgssthr.grb}
export FNSNOA=${FNSNOA:-$DMPDIR/$CDATE/$CDUMP/${CDUMP}.t${cyc}z.snogrb_t1534.3072.1536}
export FNACNA=${FNACNA:-$DMPDIR/$CDATE/$CDUMP/${CDUMP}.t${cyc}z.seaice.5min.blend.grb}
export FSNOL=${FSNOL:-0}
export FSNOS=${FSNOS:-99999}
export CYCLVARS=${CYCLVARS:-"FSNOL=$FSNOL,FSNOS=$FSNOS,"}
if [ $DONST = "YES" ]; then
export GSI_FILE=${GSI_FILE:-$COMOUT/dtfanl.nc}
export ADJT_NST_ONLY=${ADJT_NST_ONLY:-".false."}
else
export GSI_FILE="NULL"
export ADJT_NST_ONLY=".false."
fi
CRES=$(echo $CASE | cut -c 2-)
JCAP_CASE=$((2*CRES-2))
LONB_CASE=$((4*CRES))
LATB_CASE=$((2*CRES))
export JCAP=${JCAP:-$JCAP_CASE}
export LONB=${LONB:-$LONB_CASE}
export LATB=${LATB:-$LATB_CASE}
export MAX_TASKS_CY=${MAX_TASKS_CY:-99999}
# Temporary rundirectory
export DATA=${DATA:-$pwd/rundir$$}
rm -fr $DATA
mkdir -p $DATA
for n in $(seq 1 $ntiles); do
#ln -fs $COMIN/$PDY.${cyc}0000.sfc_data.tile${n}.nc $DATA/fnbgsi.00$n
#ln -fs $COMOUT/$PDY.${cyc}0000.sfcanl_data.tile${n}.nc $DATA/fnbgso.00$n
ln -fs $COMIN/sfc_data.tile${n}.nc $DATA/fnbgsi.00$n
ln -fs $COMOUT/sfcanl_data.tile${n}.nc $DATA/fnbgso.00$n
ln -fs $FIXfv3/C${CRES}/C${CRES}_grid.tile${n}.nc $DATA/fngrid.00$n
ln -fs $FIXfv3/C${CRES}/C${CRES}_oro_data.tile${n}.nc $DATA/fnorog.00$n
done
$CYCLESH
rc=$?
if [[ $rc -ne 0 ]] ; then
echo "***ERROR*** rc= $rc"
exit $rc
fi
exit 0