#!/bin/ksh set -x export RUN_ENVIR=${RUN_ENVIR:-"nco"} export PS4='$SECONDS + ' date ############################# # Source relevant config files ############################# configs="base sfcprep" 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 sfcprep status=$? [[ $status -ne 0 ]] && exit $status ############################################## # 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 export SENDDBN=${SENDDBN:-NO} export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} ############################################## # Set CDATE ############################################## CDATE=${CDATE:-${PDY}${cyc}} GDATE=$($NDATE -06 $CDATE) PDY_m6hrs=$(echo $GDATE | cut -c1-8) cyc_m6hrs=$(echo $GDATE | cut -c9-10) export cycle_m6hrs=t${cyc_m6hrs}z export COMPONENT=${COMPONENT:-atmos} export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${gfs_ver}/${RUN}.${PDY})/${cyc}/$COMPONENT} if [ ! -d ${COMOUT} ]; then mkdir -p $COMOUT; fi export COMINobsproc=${COMINobsproc:-$(compath.py ${envir}/obsproc/${obsproc_ver})/${RUN}.${PDY}/${cyc}/$COMPONENT} export COMIN_m6hrs=${COMIN_m6hrs:-$(compath.py ${envir}/${NET}/${gfs_ver})/${RUN}.${PDY_m6hrs}/${cyc_m6hrs}/$COMPONENT} export IMS_FILE=${COMINobsproc}/${RUN}.${cycle}.imssnow96.grib2 export FIVE_MIN_ICE_FILE=${COMINobsproc}/${RUN}.${cycle}.seaice.5min.grib2 export AFWA_GLOBAL_FILE=${COMINobsproc}/${RUN}.${cycle}.snow.usaf.grib2 export BLENDED_ICE_FILE=${BLENDED_ICE_FILE:-${RUN}.${cycle}.seaice.5min.blend.grb} export BLENDED_ICE_FILE_m6hrs=${BLENDED_ICE_FILE_m6hrs:-${COMIN_m6hrs}/${RUN}.${cycle_m6hrs}.seaice.5min.blend.grb} ############################################################### # Run relevant script ############################################################### env echo "HAS BEGUN on `hostname`" ${EMCSFCPREPSH:-$SCRgfs/exemcsfc_global_sfc_prep.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