#!/bin/sh ################################################################# # 9/20/2009, Julia Zhu Scripts are modified to be sharable # between EMC and NCO # Please note that variable "RUN_ENVIR" is set and used # in the development enviroment only. ################################################################# ############################################ # Set up environment for ensemble products job ############################################ $SMSBIN/smsinit $LOADL_STEP_ID set -xa ########################################### # Run sref_config to get input parameters ########################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then . /meso/save/$LOGNAME/sref/nwprod/parm/sref_config fi # #### 04/16/2001 ################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date # # obtain unique process id (pid) and make temp directories # export pid=$$ if [ "$RUN_ENVIR" = dev ] ### For Developers then export DATA_IN=${DATA_IN:-/ptmp/$LOGNAME/tmpnwprd} else ### For Operations export DATA_IN=/tmpnwprd fi export DATA=$DATA_IN/${job}.${pid} mkdir -p $DATA cd $DATA #################################### # File To Log Msgs #################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then export jlogfile=${jlogfile:-$DATA_IN/jlogfile} else ### For Operations if [ $envir != prod ]; then export jlogfile=/com/logs/${envir}/jlogfile else export jlogfile=/com/logs/jlogfile fi fi #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export cycle=t${cyc}z export NET=sref export RUN=sref if [ "$RUN_ENVIR" = dev ] ### For Developers then export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-NO} export SENDSMS=${SENDSMS:-YES} export HOMEsref=${HOMEsref:-/nw${envir}} export EXECsref=${EXECsref:-$HOMEsref/exec} export FIXsref=${FIXsref:-$HOMEsref/fix} export PARMsref=${PARMsref:-$HOMEsref/parm} export USHsref=${USHsref:-$HOMEsref/ush} else ### For Operations export SENDCOM=YES export SENDSMS=YES if [ $envir != prod ]; then export DBNROOT=/nwprod/spa_util/fakedbn else export SENDDBN=YES fi export HOMEsref=/nw${envir}/${NET}.${model_ver} export EXECsref=$HOMEsref/exec export FIXsref=$HOMEsref/fix export PARMsref=$HOMEsref/parm export USHsref=$HOMEsref/ush fi ################################### # Set up the UTILITIES ################################### export utilscript=/nwprod/util/ush export utilexec=/nwprod/util/exec # Run setup to initialize working directory and utility scripts sh $utilscript/setup.sh msg="JOB $job HAS BEGUN" postmsg "$jlogfile" "$msg" # Run setpdy and initialize PDY variables sh $utilscript/setpdy.sh . PDY if [ "$RUN_ENVIR" = dev ] ### For Developers then export com=${com:-/meso/noscrub/$LOGNAME/com/${NET}/${envir}} export COM_IN=${COM_IN:-/meso/noscrub/$LOGNAME/com/${NET}/${envir}} export COM_OUT=${COM_OUT:-/meso/noscrub/$LOGNAME/com/${NET}/${envir}} export COMIN=$COM_IN/${RUN}.${PDY}/${cyc}/ensprod export COMOUT=$COM_OUT/${RUN}.${PDY}/${cyc}/misc export pcom_in=${pcom_in:-/pcom} export pcom=$pcom_in/${RUN}.${PDY} else ### For Operations export COMIN=/com/${NET}/${envir}/${RUN}.${PDY}/${cyc}/ensprod export COMOUT=/com/${NET}/${envir}/${RUN}.${PDY}/${cyc}/misc if [ $envir != prod ]; then export pcom=/pcom/${envir}/sref else export pcom=/pcom/sref fi fi mkdir -p $COMOUT $pcom ################################################### # Execute the Script # $HOMEsref/util/ush/sref_awips.sh cat $pgmout msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$jlogfile" "$msg" cd $DATA_IN rm -rf $DATA date $SMSBIN/smscomplete