#! /bin/ksh # JHWRF_PREP_HYBRID -- interpolates GFS data to the WRF-NMM grid. # This job is run twice, with two sets of environment variables. # The first time, it processes only the first twelve hours of the # GFS data. The second time, it processes hours 18-126. In both # cases, the output is read in by JHWRF_NMM_REAL's hwrf_nmm_real # program to produce the input or boundary conditions for the # hwrf_wrf program. # # HOURS 0-12: set FIRST_PREP=0 and LAST_PREP=2 before calling # JHWRF_PREP_HYBRID. That will tell it to process hours 0-12 # # HOURS 18-126: set FIRST_PREP=3 and LAST_PREP=21 before calling # JHWRF_PREP_HYBRID. That will tell it to process hours 18-126 # Last modified: Samuel Trahan, April 5, 2012. # *** Operational Workflow *** # JHWRF_PREP_HYBRID Step 1 (hours 0-12): # Submitted by: JHWRF_PRE_ATMOS # Submits: JHWRF_NMM_REAL 12hr job # # JHWRF_PREP_HYBRID Step 2 (hours 0-126): # Submitted by: JHWRF_RELOCATE # Submits: JHWRF_NMM_REAL 126hr job # Primary scripts: # scripts/exhwrf_prep_hybrid.sh.sms -- passes control to hwrf_prep_hybrid.sh # ush/hwrf_prep_hybrid.sh -- launches multiple copies of the hwrf_mkbnd.sh # script, one for each forecast hour that is to be processed # ush/hwrf_mkbnd.sh -- runs the hwrf_prep program to produce # input or boundary conditions # Primary executable: # hwrf_prep -- reads gfs.tHHz.sfFHR files in from fort.11, geographic data # from hwrf_geogrid from "geogrid.out" and writes output to # fort.52 for boundary conditions or fort.53 for initial # conditions. Other script-generated (via hwrf_mkbnd.sh) # parameter files are also used. # *** EMC Suggested Job Cards *** # There MUST be one MPI rank per GFS input time being processed. # Step 1: HOURS 0-12: #@ job_type = parallel #@ wall_clock_limit = 00:20:00 #@ total_tasks = 3 #@ task_affinity=core(1) #@ resources = ConsumableMemory(5 GB) #@ node = 1 # Step 2: HOURS 18-126 #@ job_type = parallel #@ wall_clock_limit = 00:20:00 #@ total_tasks = 19 #@ task_affinity=core(1) #@ resources = ConsumableMemory(5 GB) #@ node = 1 export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} == NO ]; then $SMSBIN/smsinit $LOADL_STEP_ID fi #---------------------------------------------- # JHWRF_PREP_HYBRID.sms #---------------------------------------------- set -xa 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 export COMINGFS=/com/gfs/prod 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 USHhwrf=${USHhwrf:-$HOMEhwrf/ush} export EXhwrf=${EXhwrf:-$HOMEhwrf/scripts} ############################## # Set up the UTILITIES ############################## export utilscript=$NWPROD/util/ush export utilities=$NWPROD/util/ush ############################## # 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}} export COMINGFS=${COMINGFS:-/com/gfs/${envir}/gfs.${PDY}} mkdir -m 775 -p $COMOUT msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" ############################################################# # Execute the script ${EXhwrf}/exhwrf_prep_hybrid.sh.sms #if [ ${PARAFLAG} = 'YES' ] #then # ${EXhwrf}/exhwrf_prep_hybrid.sh.sms #else # /nw${envir}/scripts/exhwrf_prep_hybrid.sh.sms #fi ############################################################# msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" date if [ ${PARAFLAG} == NO ]; then $SMSBIN/endt fi