#! /bin/sh # JHMON_GEMPAK - this job runs GEMPAK # # Jobs and Dependencies: # require the JHMON_POST1 and JHMON_POST2 # #################################### date export PS4='+ $SECONDS + ' set -x #################################### # Set default values if not yet set # values from ecFlow or modules will override these #################################### export DATA=${DATA:-${DATAROOT:?}/hmon${storm_num:?}_${cyc:?}_${envir:?}} export cycle=${cycle:-t${cyc}z} export jlogfile=${DATA}/jlogfile #################################### # Initialize work area and cd there #################################### mkdir -p $DATA cd $DATA #################################### # Variables for logging & DBnet #################################### export NET=hmon RUN=hmon # Get PDY if [ -s ${DATAROOT:?}/hmon${storm_num:?}_${cyc:?}_${envir:?}/PDY ]; then echo "Using PDY from HMON working directory" . ${DATAROOT}/hmon${storm_num}_${cyc}_${envir}/PDY else >&2 "WARNING: PDY not found in HMON working directory. Using current PDY." setpdy.sh . PDY fi #################################### # Set HMON-specific vars #################################### # Top of HMON installation tree: export HOMEhmon=${HOMEhmon:-${PACKAGEROOT:?}/hmon.${hmon_ver:?}} export USHhmon=$HOMEhmon/ush export PARMhmon=$HOMEhmon/parm export EXhmon=$HOMEhmon/scripts export FIXhmon=$HOMEhmon/fix export EXEChmon=$HOMEhmon/exec # Upstream and downstream areas: export COMINmsg=${COMINmsg:-$(compath.py hwrf/${hwrf_ver}/inphmon)} # HMON areas: export COMIN=${COMIN:-$(compath.py $NET/${hmon_ver})/$RUN.$PDY$cyc} #stormvars_filename=${COMIN}/${stormlabel:-storm$storm_num}.holdvars.txt #if [ -s $stormvars_filename ]; then # . $stormvars_filename # export storm_id=${STORM,,}${STORMID,,} #else # err_exit "Hurricane variables file $stormvars_filename not found." #fi messagefile=$COMINmsg/message$storm_num set +e nstorms=$( head -1 $COMINmsg/nstorms ) # number of storms: 0-5 message=$( head -1 "$messagefile" ) # full message contents set -e # If nstorms file is missing, use message contents to decide: nstorms=${nstorms:-5} storm=${message:5:3} # 93L basin1=${message:7:1} # L name=$( echo ${message:9:9} ) export storm_name=`echo ${name} | tr '[A-Z]' '[a-z]'` #export storm_id=`echo ${storm} | tr '[A-Z]' '[a-z]'` ## change for the gempak filename to include stormname export storm_id=${name,,}${storm,,} export COMOUT=${COMOUT:-$(compath.py -o $NET/${hmon_ver})/$RUN.$PDY$cyc/gempak/${storm_id:?}} mkdir -p $COMOUT $COMOUT/meta # Make sure all mandatory variables are set: cyc, storm_num set -u +x echo "Checking for mandatory variables:" echo "cyc=$cyc storm_num=$storm_num" set +u -x #################################### # Pass control to ex-script #################################### env export SENDCOM=${SENDCOM:-YES} export pgm=exhmon_nawips.sh ${EXhmon}/exhmon_nawips.sh export err=$?; err_chk #if [ "${KEEPDATA^^}" != "YES" ]; then # rm -rf $DATA #fi date