#!/bin/ksh set -x 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 ############################################## export cycle="t${cyc}z" setpdy.sh . ./PDY ############################################## # Determine Job Output Name on System ############################################## export pgmout="OUTPUT.${pid}" export pgmerr=errfile ############################################## # Set variables used in the exglobal script ############################################## export CDATE=${CDATE:-${PDY}${cyc}} export CDUMP=${CDUMP:-${RUN:-"gfs"}} #-------------------------------- if [ $RUN_ENVIR = "nco" ]; 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 #-------------------------------- # Set wave variables if [ ${DO_WAVE:-"NO"} = "YES" ]; then # WAVE component directory export CDUMPwave=${CDUMPwave:-${CDUMP}wave} export COMINwave=${COMINwave:-$(compath.py ${envir}/${NET}/${gfs_ver})/${CDUMP}.${PDY}/${cyc}/wave} export COMOUTwave=${COMOUTwave:-$(compath.py -o ${NET}/${gfs_ver})/${CDUMP}.${PDY}/${cyc}/wave} fi ############################################## # Begin JOB SPECIFIC work ############################################## # Restart conditions for GFS cycle come from GDAS rCDUMP=$CDUMP [[ $CDUMP = "gfs" ]] && export rCDUMP="gdas" # Forecast length for GFS forecast if [ $CDUMP = "gfs" ]; then export FHMAX=$FHMAX_GFS export FHOUT=$FHOUT_GFS export FHMAX_HF=$FHMAX_HF_GFS export FHOUT_HF=$FHOUT_HF_GFS else export FHMAX_HF=0 export FHOUT_HF=0 fi ############################################################### # Run relevant exglobal script env echo "HAS BEGUN on `hostname`" $LOGSCRIPT ${FORECASTSH:-$SCRgfs/exglobal_forecast.sh} status=$? [[ $status -ne 0 ]] && exit $status ############################################## # End JOB SPECIFIC work ############################################## ############################################## # Final processing ############################################## if [ -e "$pgmout" ] ; then cat $pgmout fi echo "ENDED NORMALLY." ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA date exit 0