-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathJGLOBAL_WAVE_INIT
executable file
·82 lines (63 loc) · 1.92 KB
/
JGLOBAL_WAVE_INIT
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
#! /usr/bin/env bash
source "$HOMEgfs/ush/preamble.sh"
export RUN_ENVIR=${RUN_ENVIR:-"nco"}
#############################
# Source relevant config files
#############################
configs="base wave waveinit"
export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config}
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 waveinit
status=$?
[[ $status -ne 0 ]] && exit $status
# PATH for working directory
export NET=${NET:-gfs}
export RUN=${RUN:-gfs}
export COMPONENT=${COMPONENT:-wave}
# Add default errchk = err_chk
export errchk=${errchk:-err_chk}
# Create and go to DATA directory
export DATA=${DATA:-${DATAROOT:?}/${jobid}}
mkdir -p $DATA
cd $DATA
cyc=${cyc:-00}
export cycle=${cycle:-t${cyc}z}
# Set PDY
setpdy.sh
. PDY
export pgmout=OUTPUT.$$
export MP_PULSE=0
# Path to HOME Directory
export FIXwave=${FIXwave:-$HOMEgfs/fix/fix_wave_${NET}}
export PARMwave=${PARMwave:-$HOMEgfs/parm/wave}
export USHwave=${USHwave:-$HOMEgfs/ush}
export EXECwave=${EXECwave:-$HOMEgfs/exec}
# Set COM Paths and GETGES environment
if [ $RUN_ENVIR = "nco" ]; then
export ROTDIR=${COMROOT:?}/$NET/$envir
fi
export COMIN=${COMIN:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT}
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT}
[[ ! -d $COMOUT ]] && mkdir -m 775 -p $COMOUT
if [ $SENDCOM = YES ]; then
mkdir -p $COMOUT/rundata
fi
# Set mpi serial command
export wavempexec=${launcher:-"mpirun -n"}
export wave_mpmd=${mpmd:-"cfp"}
# Execute the Script
$HOMEgfs/scripts/exgfs_wave_init.sh
##########################################
# Remove the Temporary working directory
##########################################
cd $DATAROOT
[[ $KEEPDATA = "NO" ]] && rm -rf $DATA
exit 0