#!/bin/sh # JHWRF_ARCHIVE -- not an EMC script. This script handles product # delivery for the Operational HWRF. # 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. $SMSBIN/smsinit $LOADL_STEP_ID set -xa export MP_IOAGENT_CNT=all export MP_IO_BUFFER_SIZE=8M export PS4='$SECONDS + ' date export HPSS_HOSTNAME=`hostname -s`p export HPSS_PFTPC_PORT_RANGE=ncacn_ip_tcp[38000-38999] export HPSS_NDCG_SERVERS=10.198.22.5/8001 export PARAFLAG=${PARAFLAG:-NO} export NWPROD=${NWPROD:-/nwprod} #TSM VARIABLES########################## export SCP=/opt/freeware/bin/scp export SCP_CONFIG='-oNoneEnabled=yes -oNoneSwitch=yes -F /home$NWPROD/.ossh/ssh_config' # Default is NO: output to HPSS; YES for output to TSM export TSM_FLAG=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 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 # #### 06/06/2007 ############################### # SETUP HWRF ENVIRONMENTAL VARIABLES # This job is just for archiving the HWRF # forecast data. # ############################################### #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ export DATA=${DATA:-/tmpnwprd/${job}${pid}} mkdir -p $DATA cd $DATA export cycle=t${cyc}z #################################### # Specify NET and RUN Name and model #################################### export NET=hur export RUN=hwrf export model=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/hur/${envir}/store} export EXhwrf=${EXhwrf:-$HOMEhwrf/ush} export EXSCRhwrf=${EXSCRhwrf:-$HOMEhwrf/scripts} export HOMEbulls=$NWPROD/util export EXECbulls=$HOMEbulls/exec export FIXbulls=$HOMEbulls/fix export PARMbulls=$HOMEbulls/parm export EXbulls=$HOMEbulls/ush export HOMEutil=$NWPROD/util export EXECutil=$HOMEutil/exec export FIXutil=$HOMEutil/fix export PARMutil=$HOMEutil/parm export USHutil=$HOMEutil/ush ############################## # 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 ############################## # Run setpdy and initialize PDY variables ############################## #export PDY=20120824 sh $utilscript/setpdy.sh . PDY env ############################################## # Define COM directories ############################################## export COMIN=${COMIN:-/com/${NET}/${envir}/${RUN}.${PDY}${cyc}} export COMOUT=${COMOUT:-/com/${NET}/${envir}/${RUN}.${PDY}${cyc}} export RST_PHASE3_DIR=${RST_PHASE3_DIR:-/com/${NET}/${envir}/${RUN}.${PDY}00} mkdir -m 775 -p $COMOUT #################################### # Specify Special Fcst Vars #################################### export NCARG_ROOT=/usrx/local/ncar411 export PATH=$PATH:$NWPROD/ftplib:$NCARG_ROOT/bin:. msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env ############################################################# # Execute the script if [ ${PARAFLAG} = 'YES' ] then $EXhur/exgfdl_arch.sh.sms else export MP_PRIORITY=nwprod $EXSCRhwrf/exhwrf_arch.sh.sms cat $pgmout fi ############################################################# cd /tmpnwprd 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