Skip to content

Commit

Permalink
modified: JGLOBAL_FORECAST to make it work for both emc and nco runni…
Browse files Browse the repository at this point in the history
…ng environments.
  • Loading branch information
yangfanglin committed Nov 30, 2020
1 parent 7283c7e commit 25a28c8
Showing 1 changed file with 53 additions and 10 deletions.
63 changes: 53 additions & 10 deletions jobs/JGLOBAL_FORECAST
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,50 @@ export RUN_ENVIR=${RUN_ENVIR:-"nco"}
export PS4='$SECONDS + '
date

#--------------------------------
if [ $RUN_ENVIR = "emc" ]; then
#--------------------------------

#############################
# Source relevant config files
#############################
configs="base fcst"
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 additional configs
if [ ${DO_WAVE:-"NO"} = "YES" ]; then
configs="wave"
for config in $configs; do
. $config_path/config.$config
status=$?
[[ $status -ne 0 ]] && exit $status
done
fi

##########################################
# Source machine runtime environment
##########################################
. $HOMEgfs/env/${machine}.env fcst
status=$?
[[ $status -ne 0 ]] && exit $status

#--------------------------------
fi
#--------------------------------

##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL$job"}
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p $DATA
cd $DATA

##############################################
# Run setpdy and initialize PDY variables
Expand Down Expand Up @@ -33,6 +77,10 @@ if [ $RUN_ENVIR = "nco" ]; then
fi


#--------------------------------
if [ $RUN_ENVIR = "nco" ]; then
#--------------------------------

#############################
# Source relevant config files
#############################
Expand All @@ -54,23 +102,18 @@ if [ ${DO_WAVE:-"NO"} = "YES" ]; then
done
fi


##########################################
# Source machine runtime environment
##########################################
if [ $RUN_ENVIR = "nco" ]; then
. $HOMEgfs/env/${machine}.env fcst
status=$?
[[ $status -ne 0 ]] && exit $status
fi


##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL$job"}
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p $DATA
cd $DATA
#--------------------------------
fi
#--------------------------------


# Set wave variables
Expand Down

0 comments on commit 25a28c8

Please sign in to comment.