#! /bin/ksh # JHWRF_POST -- post-processes wrfout files from either the ATMOS_FCST # or COUPLED_FCST directory. Which files are processed, and how # they are processed depends on four environment variables. This # job is launched three times, with three different sets of # variables: # # POST_FIRSTHOUR -- first hour to process # POST_INCREMENT -- increment every Nth hour after the first # POST_LASTHOUR -- last hour to process # (so first=0, increment=6, last=126 would mean every six hours from # 0hr to 126hr) # POST_MODE -- SAT for synthetic satellite products, NONSAT for # all other products # *** Operational Workflow *** # Submits: The HWRF_OUTPUT and HWRF_ARCHIVE jobs should not be submitted # until ALL THREE of the HWRF_POST jobs AND the HWRF_TPCPOST have # completed. # # Submitted: three times, by the JHWRF_MERGE, with three different sets # of envioronment variable settings: # # 1. Non-satellite synoptic hours (0, 6, ... 126): # POST_FIRSTHOUR=0, POST_LASTHOUR=126 # POST_INCREMENT=6, POST_MODE=NONSAT # # 2. Non-satellite intermediate hours (3, 9, 15, ... 123): # POST_FIRSTHOUR=3, POST_LASTHOUR=123 # POST_INCREMENT=6, POST_MODE=NONSAT # # 3. Satellite synoptic hours (0, 6, ... 126): # POST_FIRSTHOUR=0, POST_LASTHOUR=126 # POST_INCREMENT=6, POST_MODE=SAT # # Splitting of the non-satellite post into two jobs was necessary due # to both the more expensive GRIB2 encoding (complex encoding with # second-order differences) and due to the presence of a third domain. # The satellite post does not need to be split since it is not # bogged down by expensive serial programs. # Primary scripts files: # exhwrf_post.sh.sms -- passess control to hwrf_post_master.sh # hwrf_post_master.sh -- loops over all output files, calling the # hwrf_post_process.sh script on each one, with arguments # appropriate to the post-processor mode (satellite or non-) # hwrf_post_process.sh -- post-processes wrfout files for all # three atmospheric domains for a single time. This script # can also handle one or two domains, and is used by the # JHWRF_GFS_TRACK0 job for that purpose. # hwrf_file_complete.pl -- waits for a file to be "complete" # (older than a certain age, larger than a certain size) # # Primary parameter files: # hwrf_cntrl.nonsat -- non-satellite post-processor control file # hwrf_cntrl.satC -- Central Pacific satellite post control file # hwrf_cntrl.satE -- East Pacific satellite post control file # hwrf_cntrl.satL -- North Atlantic satellite post control file # hwrf_cntrl.sat_other -- satellite post control file for other # basins. Only C, E and L are supported. This is experimental. # Primary executables: # hwrf_post -- the NCEP Unified Post-Processor (UPP) # *** EMC Suggested Job Cards *** # ** Both of the non-satellite jobs (POST_MODE=NONSAT): # Core affinity is pretty critical due to the large copygb calls. #@ wall_clock_limit = 01:39:00 #@ total_tasks = 2 #@ task_affinity=core(1) #@ node_resources = ConsumableMemory(8 GB) #@ network.MPI = csss,shared,us #@ bulkxfer = yes # ** The one satellite post job (POST_MODE=SAT): # Core affinity is unnecessary since the serial programs (copygb and # cnvgrib) are virtually instantaneous due to the small GRIB1/2 file # sizes. However, the satellite post-processing is more # CPU-intensive, so more cpus are needed. #@ job_type = parallel #@ wall_clock_limit = 01:39:00 #@ total_tasks = 24 #@ node_usage = shared #@ task_affinity=cpu(1) #@ node_resources = ConsumableMemory(33 GB) #@ network.MPI = csss,shared,us #@ bulkxfer = yes export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} == NO ]; then $SMSBIN/smsinit $LOADL_STEP_ID fi #---------------------------------------------- # JHWRF_POST.sms #---------------------------------------------- set -xa 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=20110731 ############################## # 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_post.sh.sms #if [ ${PARAFLAG} = 'YES' ] #then # ${EXhwrf}/exhwrf_post.sh.sms #else # /nw${envir}/scripts/exhwrf_post.sh.sms #fi ############################################################# msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" date if [ ${PARAFLAG} == NO ]; then $SMSBIN/endt fi