#! /bin/ksh # JHWRF_MERGE -- merges the storm-removed large-scale fields with the # new vortex, possibly after GSI has processed the data. This job # waits for the 126hr JHWRF_NMM_REAL to complete, after which the # forecast and post-processors should be submitted # Last modified: Samuel Trahan, April 5, 2012. # *** Operational Workflow *** # Submitted: After JHWRF_NMM_GSI_D1 and JHWRF_NMM_GSI_D2 complete, # even if one or both fail. This script recovers from any failures. # Submits: The forecast and three post-processors: # # JHWRF_FORECAST -- TWO CASES: with or without ocean coupling # With ocean coupling if MODEL=COUPLED in # the $stormlabel.holdvars.txt, *AND* # the ${COMOUT}/ocean_status.${STORM}${STORMID}.${PDY}${cyc} # contains RUN_COUPLED=YES # Otherwise, # submitted without ocean coupling # See the JHWRF_FORECAST for details. # # JHWRF_TRACK_SWATH -- tracker and swath input job. # JHWRF_POST -- three copies of this job with different variables: # # 1. Non-satellite synoptic hours: # POST_FIRSTHOUR=0, POST_LASTHOUR=126 # POST_INCREMENT=6, POST_MODE=NONSAT # # 2. Non-satellite intermediate hours: # POST_FIRSTHOUR=3, POST_LASTHOUR=123 # POST_INCREMENT=6, POST_MODE=NONSAT # # 3. Satellite synoptic hours: # POST_FIRSTHOUR=0, POST_LASTHOUR=126 # POST_INCREMENT=6, POST_MODE=SAT # # See the JHWRF_POST.sms for details. # Primary scripts and parameter files: # scripts/exhwrf_merge.sh.sms -- passes control to hwrf_merge.sh # ush/hwrf_merge.sh -- performs various vortex cutting and pasting # operations on binary files to produce the final input to # the forecast job (wrfinput_d01, wrfanl_d02, wrfanl_d03) # Primary executables: # exec/hwrf_bin_io -- creates flat fortran binary files containing # data taken out of a WRF output (wrfout, wrfanl or ghost) file # exec/hwrf_diffwrf_3dvar -- para-only; needed to do the same for # WRF NetCDF output files # exec/hwrf_inter_2to1 -- inter-domain interpolation code # exec/hwrf_inter_2to2 -- inter-domain interpolation code # exec/hwrf_inter_2to6 -- inter-domain interpolation code # exec/hwrf_guess -- produces a first guess "fake" cyclone # based on a bogus storm # *** EMC Suggested Job Card *** #@ job_type = parallel #@ wall_clock_limit = 00:15:00 #@ total_tasks = 1 #@ task_affinity=core(1) #@ resources = ConsumableMemory(5 GB) #@ network.MPI = csss,shared,us export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} == NO ]; then $SMSBIN/smsinit $LOADL_STEP_ID fi #---------------------------------------------- # JHWRF_MERGE.sms #---------------------------------------------- set -xa export MP_IOAGENT_CNT=all export MP_IO_BUFFER_SIZE=8M export PS4='$SECONDS + ' date export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} = 'YES' ]; then export yymmdd=` echo $PDY | cut -c3-8` export yymmddhh=${yymmdd}${cyc} export jlogfile=${DATA}/jlogfile export SENDSMS=YES export SENDCOM=YES export SENDDBN=NO if [ ! -d $outdir ]; then mkdir -p $outdir; fi if [ ! -d $COMOUT ]; then mkdir -p $COMOUT; fi else export NWPROD=${NWPROD:-/nwprod} fi ############################################################### # This block can be modified for different Production test # environment. This is used for operational testings ############################################################### if [ ${PARAFLAG} == NO -a $envir != prod ]; then export SENDDBN=${SENDDBN:-NO} export jlogfile=${jlogfile:-/com/logs/${envir}/jlogfile} export DBN_ALERT_TYPE=TBD_PARA export DBNROOT=/nwprod/spa_util/fakedbn fi # ############################################# # SETUP HWRF FCST PROCESSING VARIABLES # ############################################# #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ export DATA=${DATA:-/tmpnwprd/hwrf${storm_num}_${cyc}_${envir}} cd $DATA export cycle=t${cyc}z #################################### # Specify NET and RUN Name and model #################################### export NET=hur export RUN=hwrf #################################### # File To Log Msgs #################################### export jlogfile=${jlogfile:-/com/logs/jlogfile} #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export pgmerr=errfile #################################### # SENDSMS - Flag Events on SMS # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls # RERUN - Rerun fcst from beginning (default no) #################################### export SENDSMS=${SENDSMS:-YES} export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-YES} #################################### # Specify HWRF version number #################################### export HWRF_VERSION=${HWRF_VERSION:-${model_ver}} #################################### # Specify Execution Areas #################################### export HOMEhwrf=${HOMEhwrf:-/nw${envir}/hwrf.$HWRF_VERSION} export EXEChwrf=${EXEChwrf:-$HOMEhwrf/exec} export FIXhwrf=${FIXhwrf:-$HOMEhwrf/fix} export PARMhwrf=${PARMhwrf:-$HOMEhwrf/parm} export STOREhwrf=${STOREhwrf:-/com/hwrf/${envir}/store} export EXhwrf=${EXhwrf:-$HOMEhwrf/scripts} export USHhwrf=${USHhwrf:-$HOMEhwrf/ush} ############################## # Set up the UTILITIES ############################## export utilscript=$NWPROD/util/ush export utilities=$NWPROD/util/ush export utilexec=$NWPROD/util/exec ############################## # Run setup to initialize working directory and utility scripts ############################## sh $utilscript/setup.sh #export PDY=20120101 ############################## # Run setpdy and initialize PDY variables ############################## sh $utilscript/setpdy.sh . PDY ############################################## # Define COM directories ############################################## export COMIN=${COMIN:-/com/${NET}/${envir}/${RUN}.${PDY}${cyc}} export COMOUT=${COMOUT:-/com/${NET}/${envir}/${RUN}.${PDY}${cyc}} mkdir -m 775 -p $COMOUT msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" ############################################################# # Execute the script ${EXhwrf}/exhwrf_merge.sh.sms #if [ ${PARAFLAG} = 'YES' ] #then # ${EXhwrf}/exhwrf_merge.sh.sms #else # /nw${envir}/scripts/exhwrf_merge.sh.sms #fi ############################################################# msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd /tmpnwprd if [ ${PARAFLAG} = 'YES' ]; then echo " " #else # rm -rf $DATA fi date if [ ${PARAFLAG} == NO ]; then $SMSBIN/endt fi