#!/bin/sh set -xa ############################################################# # NARRE getnam # 10/17/2011 Binbin Zhou, modified from Jun Du's SREF job # 12/15/2011 Xiaoxue Wang, modified to NCO/EMC template ############################################################# ###################################################### # The following two variable could be defined in the # loadleveler submission script (the sms script), if # not they will take the default values which is set # for the NCO running enviroment ####################################################### export RUN_ENVIR=${RUN_ENVIR:-prod} export SENDSMS=${SENDSMS:-YES} ################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-rap} export RUN=${RUN:-narre} ############################################################### # This block can be modified for different Production test # environment. This is used for operational testings ############################################################### if [ "$RUN_ENVIR" = prod -a $envir != prod ]; then export jlogfile=${jlogfile:-/com/logs/${envir}/jlogfile} export DBNROOT=/nwprod/spa_util/fakedbn fi if [ $SENDSMS = YES ]; then $SMSBIN/smsinit $LOADL_STEP_ID fi # ################################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date # # obtain unique process id (pid) and make temp directories # export pid=$$ export DATA=/tmpnwprd/narre_${cyc}_${envir} if [ -d $DATA ]; then rm -rf $DATA; fi mkdir -m 775 $DATA mkdir -m 775 $DATA/getnam export DATA_IN=/tmpnwprd/narre_${cyc}_${envir}/misc mkdir $DATA_IN # #set flag here to avoid three narre jobs making the working diretory at the same time # $SMSBIN/setev release_getrap cd $DATA/getnam export cycle=t${cyc}z export MP_HOLDTIME=1000 export MP_LABELIO=YES #################################### # 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}" #################################### # SENDSMS - Flag Events on SMS # SENDCOM - Copy files to /com directory #################################### export SENDSMS=${SENDSMS:-YES} export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-YES} #################################### # Specify Execution Areas #################################### export HOMEnarre=${HOMEnarre:-/nw${envir}/${RUN}.${model_ver}} export EXECnarre=${EXECnarre:-${HOMEnarre}/exec} export FIXnarre=${FIXnarre:-$HOMEnarre/fix} export PARMnarre=${PARMnarre:-$HOMEnarre/parm} export USHnarre=${USHnarre:-$HOMEnarre/ush} export SCRIPTSnarre=${SCRIPTSnarre:-$HOMEnarre/scripts} ################################### # 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 ############################################## # Define NAM COMIN directories ############################################## export NAMprod=/com/nam/prod ####################################################### # Pass information which is needed to run the Script ####################################################### export VERBOSE=YES env ################################################### # Execute the Scripts # get NAM data $SCRIPTSnarre/exnarre_getnam.sh.sms 130 >$DATA/getnam130.out 2>&1 & $SCRIPTSnarre/exnarre_getnam.sh.sms 242 >$DATA/getnam242.out 2>&1 & wait set +x echo "######################################" echo " GETNAM130.OUT " echo "######################################" set -x cat $DATA/getnam130.out set +x echo "######################################" echo " GETNAM242.OUT " echo "######################################" set -x cat $DATA/getnam242.out msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$jlogfile" "$msg" date $SMSBIN/smscomplete