#!/bin/sh ######################################## # Preliminary data setup step ######################################## set -xa export PS4='$SECONDS + ' date ########################################################### # obtain unique process id (pid) and make temp directories ########################################################### export DATA=${DATA:-${DATAROOT:?}/hiresw.ungrib_${NEST:?}_${MODEL:?}_${cyc:?}_${envir:?}} # Remove old forecast data directory if it exists if [ -d $DATA ]; then rm -rf $DATA fi mkdir -p $DATA cd $DATA # Run setpdy and initialize PDY variables export cycle=${cycle:-t${cyc}z} setpdy.sh . ./PDY export SENDDBN=NO #################################### # Specify Execution Areas #################################### export HOMEhiresw=${HOMEhiresw:-${PACKAGEROOT:?}/hiresw.${hiresw_ver:?}} export EXEChiresw=${EXEChiresw:-$HOMEhiresw/exec/arw} export FIXhiresw=${FIXhiresw:-$HOMEhiresw/fix/arw} export PARMhiresw=${PARMhiresw:-$HOMEhiresw/parm/arw} export USHhiresw=${USHhiresw:-$HOMEhiresw/ush/arw} ############################### # Specify NET and RUN name ############################### export NET=${NET:-hiresw} export RUN=${RUN:-hiresw} ##################################### # Define COM directories ##################################### ### COMINgfs with be based on $PDY$cyc MINUS 6 hours PDYm6h=`$NDATE -6 $PDY$cyc | cut -c1-8` export COMOUT=${COMOUT:-$(compath.py -o $NET/${hiresw_ver})/${RUN}.${PDY}} export COMINgfs=${COMINgfs:-$(compath.py ${envir}/com/gfs/${gfs_ver}/gfs.$PDYm6h)} export COMINnam=${COMINnam:-$(compath.py ${envir}/com/nam/${nam_ver}/nam.$PDY)} export COMINnamold=${COMINnamold:-$(compath.py ${envir}/com/nam/${nam_ver}/nam.$PDYm6h)} mkdir -p -m 775 $COMOUT export pgmout="OUTPUT.$$" ######################################################## # Execute the script. ${HOMEhiresw}/scripts/arw/exhiresw_ungrib.sh ######################################################## cd $DATAROOT export KEEPDATA=YES if [ $KEEPDATA = NO ]; then rm -rf $DATA; fi date