#!/bin/ksh echo "$(date -u) begin ${.sh.file}" set -xa if [[ ${STRICT:-NO} == "YES" ]]; then # Turn on strict bash error checking set -eu fi export PS4='$SECONDS + $(basename ${.sh.file})[$LINENO] ' #################################### # Determine Job Output Name on System #################################### export jobid=${jobid:-"$job.$PBS_JOBID"} export pgmout="OUTPUT.${PBS_JOBID}" export pgmerr=errfile #################################### # Specify and create working directory #################################### export DATA=${DATA:-${DATAROOT}/${jobid}} mkdir -p $DATA cd $DATA ###################################### # Set up compute resources ###################################### export total_tasks=${total_tasks:-1} export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} export APRUN=${gefsmpexec:-"mpiexec -n $total_tasks"} #################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-gefs} export envir=${envir:-prod} export RUN=${RUN:-gefs} ###################################### # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls # SENDECF - Flag Events on ECF # VERBOSE - Specify Verbose Output ###################################### export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-YES} export VERBOSE=${VERBOSE:-YES} export SENDDBN_NTC=${SENDDBN_NTC:-YES} ###################################### # Set up the date information ###################################### export cycle=t${cyc}z setpdy.sh source PDY if [ ${FORECAST_SEGMENT} = lr ]; then export cyc=00 export cycle=t${cyc}z fi #################################### # Specify Execution Areas #################################### export HOMEgefs=${HOMEgefs:-${PACKAGEROOT}/gefs.${gefs_ver}} export EXECgefs=${EXECgefs:-$HOMEgefs/exec} export USHgefs=${USHgefs:-$HOMEgefs/ush} export FIXgefs=${FIXgefs:-$HOMEgefs/fix/fix_gefs} export PARMgefs=${PARMgefs:-$HOMEgefs/parm} ############################################## # Define COM directories ############################################## export COMPONENT=${COMPONENT:-atmos} ver=${ver:-$(echo ${gefs_ver}|cut -c1-5)} export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc} export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/$cyc} export COMOUTwmo=${COMOUTwmo:-${COMOUT}/${COMPONENT}/wmo} ############################# # Source relevant config files ############################# configs="gefs gefs_awips" config_path=$PARMgefs for config in $configs; do . $config_path/$config.parm export err=$? if [[ $err != 0 ]]; then echo "FATAL ERROR in ${.sh.file}: Error while loading parm file $config_path/$config.parm" exit $err fi done mkdir -m 775 -p $COMOUTwmo echo "Environment before calling script" env | sort ############################################################# # Execute the script $HOMEgefs/scripts/exgefs_atmos_awips.sh export err=$? if [[ $err == 0 ]]; then echo "$job completed normally!" else echo "FATAL ERROR in ${.sh.file}: $job failed!" exit $err fi ############################################################# ############################## # Remove the Temporary working directory ############################## cd $DATAROOT if [ ${KEEPDATA:-NO} = NO ] ; then rm -rf $DATA ; fi echo "$(date -u) end ${.sh.file}" exit $err