#! /bin/sh date export PS4=' $SECONDS + ' set -xue #################################### # Set default values if not yet set # values from ecFlow or modules will override these #################################### export DATA=${DATA:-${DATAROOT}/${jobid}} export jlogfile=${jlogfile:-${DATA}/jlogfile.${jobid}} export cycle=${cycle:-t${cyc}z} #################################### # Initialize work area and cd there #################################### mkdir -p $DATA cd $DATA #################################### # Set HWRF version number if unset #################################### export HWRF_VERSION=${HWRF_VERSION:-${hwrf_ver/v/}} #################################### # Variables for logging & DBnet #################################### export NET=hwrf RUN=hwrf export EMAIL_SDM=${EMAIL_SDM:-YES} #################################### # Set threading defaults #################################### export OMP_NUM_THREADS=1 export OMP_STACKSIZE=128M export MKL_NUM_THREADS=1 #################################### # Set HWRF-specific vars #################################### # Top of HWRF installation tree: export HOMEhwrf=${HOMEhwrf:-${OPSROOT:?}/hwrf.$hwrf_ver} # source $HOMEhwrf/versions/run.ver # Do not source the holdvars for the launch job since the holdvars # does not exist yet! # We do need to set these variables that holdvars normally sets: export USHhwrf=$HOMEhwrf/ush export EXhwrf=$HOMEhwrf/scripts export PARMhwrf=$HOMEhwrf/parm # Initialize PDY for future jobs: setpdy.sh # Get PDY . ./PDY # Upstream and downstream areas: # JY export stormlabel=${stormlabel:-storm$storm_num} COMROOTnhc=${COMROOTnhc:-${DCOMROOT/nhc}} export COMINobs=${COMINobs:-$(compath.py ${envir}/obsproc/${obsproc_ver})} export COMINgfs=${COMINgfs:-$(compath.py ${envir}/gfs/${gfs_ver})} export COMINgdas=${COMINgdas:-$(compath.py ${envir}/gfs/${gfs_ver})} export COMINarch=${COMINarch:-$(compath.py ${envir}/gfs/${gfs_ver})/syndat} #export COMINrtofs=${COMINrtofs:-$(compath.py ${envir}/rtofs/$rtofs_ver)} export COMINmsg=${COMINmsg:-$(compath.py ${envir}/hafs/${hafs_ver})/inphfsa} # HWRF areas: YYYY=`echo $PDY |cut -c1-4` priorymdh=$( $NDATE -6 "$PDY$cyc" ) pre_YMD=`echo $priorymdh |cut -c1-8` pre_H=`echo $priorymdh |cut -c9-10` export HISTDATA=${HISTDATA:-$(compath.py ${envir}/${NET}/${hwrf_ver})/$RUN.$pre_YMD/$pre_H} export COMIN=${COMIN:-$(compath.py ${envir}/${NET}/${hwrf_ver})/$RUN.$PDY/$cyc} export COMOUT=${COMOUT:-$(compath.py ${envir}/${NET}/${hwrf_ver})/$RUN.$PDY/$cyc} export COMINnhc=${DCOMROOT}/nhc/atcf/ncep export COMINjtwc=${DCOMROOT}/${PDY}/wtxtbul/storm_data # Prepend $USHhwrf to python package search path: export PYTHONPATH=$USHhwrf${PYTHONPATH:+:$PYTHONPATH} # Make sure all mandatory variables are set: cyc set -u +x echo "Checking for mandatory variables:" echo "cyc=$cyc " set +u -x #################################### # Set/check job-specific vars if any #################################### #################################### # Ensure aprun works #################################### #aprun -n 1 -d 1 -j 1 -N 1 /bin/echo Aprun Test env #################################### # Pass control to ex-script #################################### postmsg "$jlogfile" "Starting exhwrf_emailalert.py." cday=`echo $PDY | cut -c3-8` $EXhwrf/exhwrf_emailalert.py "$cday" "$cyc" # $EXhwrf/exhwrf_emailalert.py "$PDY" "$cyc" export err=$? err_chk postmsg "$jlogfile" "exhwrf_emailalert.py ended normally."