#! /bin/ksh # JHWRF_PRE_MASTER -- determines what storms should be run and sets needed # environment variables in $COMOUT/$stormlabel.holdvars.txt. This is # also the job step where domain center location is decided. # Last modified: Samuel Trahan, April 5, 2012. # *** Operational Workflow *** # Submitted: after GFS 6 hour forecast is available # Submits: JHWRF_PRE_ATMOS # Primary scripts: # scripts/exhwrf_pre_atmos.sh.sms -- determines which storms are to # be run and then passes control to hwrf_pre_master_start.sh # ush/hwrf_pre_master_start.sh -- simple wrapper script to # call hwrf_parse_vitals.sh to parse the message file, and # hwrf_model_config.sh to produce the holdvars file # ush/hwrf_parse_vitals.sh -- reads a message file (or a tcvitals # file in PARA mode) and uses that information to determine # the domain center location. All of the information generated # by this script is stored in the $stormlabel.vitals.in # file in the $DATA directory. # ush/hwrf_model_config.sh -- Disables ocean coupling unless the # basin is North Atlantic or East Pacific. Then produces the # $stormlabel.holdvars.txt file, using output from the # ush/hwrf_parse_vitals.sh, and parameter files from the parm/ # directory. # ush/hwrf_stream_parse.pl -- parses parm/hwrf_*.in files to # produce the $stormlabel.vitals.in and holdvars files # parm/hwrf.itals.in -- input file parsed to produce $stormlabel.vitals.in # parm/hwrf_config.in -- input file parsed to produce $stormlabel.holdvars.txt # *** EMC Suggested Job Card *** #@ job_type = serial #@ wall_clock_limit = 0:09:59 #@ resources = ConsumableCpus(1) ConsumableMemory(900MB) export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} = 'NO' ]; then $SMSBIN/smsinit $LOADL_STEP_ID fi #---------------------------------- # JHWRF_PRE_MASTER.sms #---------------------------------- set -xa export PS4='$SECONDS + ' date export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} = 'YES' ]; then export yyyymmddhh=${PDY}${cyc} export yymmdd=` echo $PDY | cut -c3-8` export yymmddhh=${yymmdd}${cyc} export jlogfile=${DATA}/jlogfile export SENDSMS=NO export SENDCOM=YES export SENDDBN=NO if [ ! -d $outdir ]; then mkdir -p $outdir; fi if [ ! -d $COMOUT ]; then mkdir -p $COMOUT; fi else export RUN_PREP_HYBRID=${RUN_PREP_HYBRID:-YES} export IOSRV_PERGRP=${IOSRV_PERGRP:-2} export IOSRV_GROUPS=${IOSRV_GROUPS:-3} export IO_SERVERS=${IO_SERVERS:-YES} export WAVEWATCH=${WAVEWATCH:-NO} export IO_FORM=${IO_FORM:-1} 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 mesagdir=/com/hur/prod/inpdata export COMINGFS=/com/gfs/prod export COMINARCH=/com/arch/prod/syndat fi ############################################### # SETUP HWRF PRE-PROCESSING VARIABLES ############################################### #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ export DATA=${DATA:-/tmpnwprd/hwrf${storm_num}_${cyc}_${envir}} if [ ${PARAFLAG} = 'NO' ]; then if [ -d $DATA ]; then rm -rf $DATA; fi fi mkdir -p $DATA cd $DATA pwd export cycle=t${cyc}z #################################### # Specify NET and RUN Name and model #################################### export NET=hur export RUN=hwrf #-------------------------------------------------------- # set model defaults for run # MODIN=GFS Global Forecasting System initialization # MODEL=COUPLED coupled atmosphere and ocean run # MODEL=ATMOS atmosphere run only # INIT=3DVAR initialize with 3DVAR # INIT=NO_3DVAR initialize without 3DVAR # CASE_ROOT=FORECAST obtain storm message from tcvitals file # CASE_ROOT=HISTORY obtain storm information from history1 file #-------------------------------------------------------- export MODIN=${MODIN:-GFS} export MODEL=${MODEL:-COUPLED} export INIT=${INIT:-YES} export GSI=${GSI:-YES} export OCEAN=${OCEAN:-POM} export GWD=${GWD:-YES} export SEASPRAY=${SEASPRAY:-NO} export HIRES=${HIRES:-NO} export RESTART=${RESTART:-NO} export AUTO_RSTART=${AUTO_RSTART:-NO} export ATLEXT=${ATLEXT:-NO} ###****************************** export AUTOSUBMIT=${AUTOSUB:-NO} ###****************************** if [ $PARAFLAG == YES ]; then export CASE_ROOT=${CASE_ROOT:-HISTORY} else export CASE_ROOT=${CASE_ROOT:-FORECAST} fi #************************************* #-------------------------------------------------------- #################################### # 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 #################################### if [ $PARAFLAG == YES ]; then export SENDSMS=${SENDSMS:-NO} export SENDDBN=${SENDDBN:-NO} else export SENDSMS=${SENDSMS:-YES} export SENDDBN=${SENDDBN:-YES} fi export SENDCOM=${SENDCOM:-YES} export COUPLED_FLAG=${COUPLED_FLAG:-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:-/nw${envir}/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:-/nwprod}/util/ush export utilities=${NWPROD:-/nwprod}/util/ush export utilexec=${NWPROD:-/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}} export COMINGFS=${COMINGFS:-/com/gfs/${envir}} export COMINARCH=${COMINARCH:-/com/arch/${envir}/syndat} mkdir -m 775 -p $COMOUT if [ $cyc -eq 00 ]; then histcyc=18 HISTDATA=${HISTDATA:-/com/${NET}/${envir}/${RUN}.${PDYm1}${histcyc}} else if [ $cyc -eq 06 ]; then histcyc=00 elif [ $cyc -eq 12 ]; then histcyc=06 else histcyc=12 fi HISTDATA=${HISTDATA:-/com/${NET}/${envir}/${RUN}.${PDY}${histcyc}} fi export mesagdir=${mesagdir:-/com/hur/${envir}/inpdata} export outdir=${outdir:-$DATA} msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" ############################################################# # Execute the script that starts the gfdl pre-processing... $EXhwrf/exhwrf_pre_master.sh.sms #if [ ${PARAFLAG} = 'YES' ] #then # $EXhwrf/exhwrf_pre_master.sh.sms #else # export MP_PRIORITY=nwprod # /nw${envir}/scripts/exhwrf_pre_master.sh.sms #fi ############################################################# msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" date if [ ${PARAFLAG} == NO ]; then $SMSBIN/endt fi