#!/bin/ksh set -x export RUN_ENVIR=${RUN_ENVIR:-"nco"} export PS4='$SECONDS + ' date ############################# # Source relevant config files ############################# configs="base prep" 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 prep 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 ############################################## # Set variables used in the exglobal script ############################################## export CDATE=${CDATE:-${PDY}${cyc}} export CDUMP=${CDUMP:-${RUN:-"gfs"}} if [ $RUN_ENVIR = "nco" ]; then export ROTDIR=${COMROOT:?}/$NET/$envir fi ############################################## # Begin JOB SPECIFIC work ############################################## export PROCESS_TROPCY=${PROCESS_TROPCY:-YES} # Turn on tropical cyclone tcvitals QC proc. if YES export DO_RELOCATE=${DO_RELOCATE:-NO} # Turn on tropical cyclone relocation proc. if YES export tmmark=tm00 if [ $RUN_ENVIR = "nco" ]; then export ARCHSYND=$COMROOTp1/arch/${envir}/syndat else export ARCHSYND=${ROTDIR}/syndat fi if [ ! -d ${ARCHSYND} ]; then mkdir -p $ARCHSYND; fi export HOMENHC=${HOMENHC:-/gpfs/?p1/nhc/save/guidance/storm-data/ncep} # JY export TANK_TROPCY=${TANK_TROPCY:-${DCOMROOT}/${envir}} # path to tropical cyclone record database export TANK_TROPCY=${TANK_TROPCY:-${DCOMROOT}/prod} # path to tropical cyclone record database ############################################## # Define COM directories ############################################## export COMIN=${ROTDIR}/${RUN}.${PDY}/${cyc} export COMOUT=${ROTDIR}/${RUN}.${PDY}/${cyc} if [ ! -d ${COMOUT} ]; then mkdir -p $COMOUT; fi #export COMINgdas=${ROTDIR}/gdas.${PDY}/${cyc} #export COMINgfs=${ROTDIR}/gfs.${PDY}/${cyc} export CRES=$(echo $CASE | cut -c2-) export LATB=$((CRES*2)) export LONB=$((CRES*4)) export BKGFREQ=1 # for hourly relocation ############################################## # Run relevant script ############################################## env msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" $LOGSCRIPT ${TROPCYQCRELOSH:-$SCRgfs/extropcy_qc_reloc.sh.ecf} status=$? [[ $status -ne 0 ]] && exit $status ############################################## # Final processing ############################################## if [ -e "$pgmout" ] ; then cat $pgmout fi msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA date exit 0