#! /bin/sh # JHMON_FORECAST - this job runs the 126hr HMON forecast, either # coupled or uncoupled. The coupled forecast requires 5 more # compute nodes (-n 640) than the uncoupled (-n 512). When the coupled # forecast failed, it will fall back to run uncoupled forecast. # # Runs in parallel with: # JHMON_POST1 # JHMON_POST2 # JHMON_HYCOM_POST (coupled only) # # Dependencies: # JHMON_HYCOM_INIT1 (coupled only) # JHMON_HYCOM_INIT2 (coupled only) # JHMON_NPS_BC # JHMON_RELOCATE # # Next Job: (above post jobs run in parallel) # date export PS4='+ $SECONDS + ' set -xu #################################### # 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 #################################### # Set threading defaults #################################### export OMP_NUM_THREADS=1 export OMP_STACKSIZE=128M export MKL_NUM_THREADS=1 #################################### # Set HMON-specific vars #################################### # Top of HMON installation tree: export HOMEhmon=${HOMEhmon:-${PACKAGEROOT:?}/hmon.${hmon_ver:?}} export USHhmon=$HOMEhmon/ush export EXhmon=$HOMEhmon/scripts export PARMhmon=$HOMEhmon/parm export FIXhmon=$HOMEhmon/fix export EXEChmon=$HOMEhmon/exec export WORKhmon=$DATA # Get PDY . ./PDY # set up cycle export CYCLE=${PDY}${cyc} # Upstream and downstream areas: export stormlabel=${stormlabel:-storm$storm_num} export COMINmsg=${COMINmsg:-$(compath.py hwrf/${hwrf_ver}/inphmon)} # HMON areas: priorymdh=$( $NDATE -6 "$PDY$cyc" ) export HISTDATA=${HISTDATA:-$(compath.py $NET/${hmon_ver})/$RUN.$priorymdh} export COMIN=${COMIN:-$(compath.py $NET/${hmon_ver})/$RUN.$PDY$cyc} export COMOUT=${COMOUT:-$(compath.py -o $NET/${hmon_ver})/$RUN.$PDY$cyc} export COM=${COM:-${COMOUT}} # Prepend $USHhmon to python package search path: export PYTHONPATH=$USHhmon${PYTHONPATH:+:$PYTHONPATH} messagefile=$COMINmsg/message$storm_num message=$( head -1 "$messagefile" ) # full message contents basin1=${message:7:1} # L # 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 env #################################### # Set/check job-specific vars if any #################################### #################################### # Pass control to ex-script #################################### #echo "$FORECAST_CONF_OVERRIDE" > "$COMOUT/storm$storm_num.forecast_override" #postmsg "$jlogfile" "Starting exhmon_forecast.py $FORECAST_CONF_OVERRIDE" #$EXhmon/exhmon_nmmb.py $FORECAST_CONF_OVERRIDE # JY - if [[ ! ( "$storm_num" -le "$nstorms" ) ]] ; then #if [[ "$basin1" == "L" ]]; then # export TOTAL_TASKS="412" # $EXhmon/exhmon_nmmb.py $TOTAL_TASKS if [ `echo $job |grep noncouple` ]; then export TOTAL_TASKS=${TOTAL_TASKS:-"412"} $EXhmon/exhmon_nmmb.py $TOTAL_TASKS else export TOTAL_TASKS=${TOTAL_TASKS:-"624"} $EXhmon/exhmon_cpl.py $TOTAL_TASKS fi #export err=$?; err_chk export err=$?; #err_chk postmsg "$jlogfile" "exhmon_forecast.py ended normally."