#! /bin/ksh # JHWRF_OUTPUT -- copies certain files to the com directory. In # PARAFLAG=YES mode, this job also waits for data and handles # archiving. # Last modified: Samuel Trahan, April 5, 2012. # *** Operational Workflow *** # Submitted: This job should not be submitted until the # JHWRF_TPCPOST and ALL THREE of the JHWRF_POST jobs are complete. # Primary scripts: # scripts/exhwrf_output.sh.sms -- passes control to the hwrf_output.sh # hwrf_output.sh -- In PARA mode, this calls hwrf_output_wait.sh # to wait for the tpcpost and satellite post. In para and # production, this then copies all files to their destinations. # For production mode, this calls ush/hur_output_email.sh to # deliver the AFOS file. In para and production, # hwrf_check_cycle.sh is called to determine if any abnormalities # were found in the script execution. Lastly, in PARA mode, output # is archived via hwrf_output_archive.sh # hwrf_output_wait.sh -- used in PARA mode to wait for all jobs # to complete # hwrf_check_cycle.sh -- generates the *.cycle.status file, which # reports on whether various aspects of the HWRF system succeeded # or failed # hwrf_output_archive.sh -- used in PARA mode to archive output. # *** EMC Suggested Job Card *** # The wallclock limit can probably be much shorter, but we use a long # one in para mode since we archive to HPSS here. Actually, we usually # use 2:50:00 since HPSS can be quite slow at times. #@ job_type = serial #@ wall_clock_limit = 00:50:00 #@ notification = never #@ resources = ConsumableCpus(1) ConsumableMemory(900 MB) #@ job_name = wrf_output export PARAFLAG=${PARAFLAG:-NO} if [ ${PARAFLAG} == NO ]; then $SMSBIN/smsinit $LOADL_STEP_ID fi #---------------------------------------------- # JHWRF_OUTPUT.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} export SENDSDM=${SENDSDM:-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 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_output.sh.sms #if [ ${PARAFLAG} = 'YES' ] #then # ${EXhwrf}/exhwrf_output.sh.sms #else # /nw${envir}/scripts/exhwrf_output.sh.sms #fi ############################################################# msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" date if [ ${PARAFLAG} == NO ]; then $SMSBIN/endt fi