#!/bin/sh set -xa ###################################################### # The following two variables 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} if [ $SENDSMS = YES ] then $SMSBIN/smsinit $LOADL_STEP_ID fi ########################### # Specify NET and RUN Name ########################### export NET=${NET:-rap} echo $job | grep pcyc err=$? if [ $err = 0 ]; then export RUN=${RUN:-rap_p} # Partial cycle else export RUN=${RUN:-rap} # Full cycle fi if [ $envir = "prod" ] then export jlogfile=${jlogfile:-/com/logs/jlogfile} export DCOMROOT=${DCOMROOT:-/dcom} else export DBNROOT=/nwprod/spa_util/fakedbn export jlogfile=${jlogfile:-/com/logs/${envir}/jlogfile} export ALERTL=${ALERTL:-/com/logs/${envir}/alertlog} #used by child scr bufr_datacount.sh export EXGRBIX=${EXGRBIX:-/nwprod/util/exec} export ushscript_datacount=/nw${envir}/ush # above is path to data counting script export ushscript_remorest=/nw${envir}/ush # above is path to restricted data removal script export ushscript_avgdata=/nw${envir}/ush # above is path to data count averaging script fi ##################################### # Run config to get input parameters ##################################### if [ "$RUN_ENVIR" = dev ] ### For Developers to specify the necessary ### parameters to overwrite the default settings then . /meso/save/${LOGNAME}/..... fi ################################# # SET SHELL PROCESSING VARIABLES ################################# export PS4='$SECONDS + ' date ############################################################################# # SETUP RAP (full cyc) OR RAP_P (partial cyc) DUMP POST PROCESSING VARIABLES # LISTING AND FORMAT CONVERSION # UPDATING DATA AVERAGE TABLES (23Z FULL CYCLE RUN RAP ONLY) ############################################################################# ######################################################### # obtain unique process id (pid) and make temp directory ######################################################### export pid=$$ export DATA_IN=${DATA_IN:-/tmpnwprd} export DATA=${DATA:-${DATA_IN}/${job}.${pid}} CLEAN=${CLEAN:-YES} if [ $CLEAN = YES ]; then rm -r -f $DATA fi mkdir -p $DATA cd $DATA ################### # File To Log Msgs ################### export jlogfile=${jlogfile:-/com/logs/jlogfile} export ALERTL=${ALERTL:-/com/logs/alertlog} #used by child scr bufr_datacount.sh export cycle=t${cyc}z export tmmark=tm00 ###################################### # Determine Job Output Name on System ###################################### export outid="LL$job" [ $envir != prod ] && export outid="LL${job}_${envir}" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" ########################################################################## # SENDCOM=YES--Copy output file to /com # SENDSMS=YES--Allow to talk back to SMS # SENDDBN=YES--Alert output file to TOC, set to NO for testing # SENDSDM=YES--Send files to SDM printer # (used by child script bufr_datacount.sh) # GET_IOPROFILE - Run I/O statistics # COPY=YES--Copy today's and yesterday's dump count status files for all # cycles to $OBCNTarch to use as database for generating 30-day # dump count average tables (when PROCESS_AVGTABLES is YES) # (used by child script bufr_avgdata.sh) ########################################################################## export SENDCOM=${SENDCOM:-YES} export SENDSMS=${SENDSMS:-YES} # already defined but we'll do it again export SENDDBN=${SENDDBN:-YES} # need to set to NO for testing only export SENDSDM=${SENDSDM:-YES} export GET_IOPROFILE=${GET_IOPROFILE:-NO} export COPY=${COPY:-YES} export HOMErap=${HOMErap:-/nw${envir}} export SCRIPTSrap=${SCRIPTSrap:-${HOMErap}/scripts} ########################## # Specify Execution Areas ########################## export HOMEbufr=/nwprod export HOMEbufr=${HOMEbufr:-/nw${envir}} export EXECbufr=${EXECbufr:-${HOMEbufr}/exec} export FIXbufr=${FIXbufr:-${HOMEbufr}/fix} # used by child scr bufr_datacount.sh export HOMEarch=${HOMEarch:-/com/arch/${envir}} export AVGDarch_IN=${AVGDarch_IN:-${HOMEarch}/avgdata} # above used by child script # bufr_datacount.sh (only used when # PROCESS_DATACOUNTS=YES) export AVGDarch_OUT=${AVGDarch_OUT:-${HOMEarch}/avgdata} # above points to path to write # average tables to (only used when # PROCESS_AVGTABLES=YES) export OBCNTarch=${OBCNTarch:-${HOMEarch}/obcount_30day} # above points to path to write new # status files to and read all status # files from {used by child script # bufr_avgdata.sh, only when # PROCESS_AVGTABLES=YES, can only # WRITE to this location if COPY=YES # (usually only in production)} ####################### # Set up the UTILITIES ####################### export ushscript=${ushscript:-/nwprod/ush} export utilscript=${utilscript:-/nwprod/util/ush} export utilparm=${utilparm:-/nwprod/util/parm} export utilexec=${utilexec:-/nwprod/util/exec} export ushscript_datacount=${ushscript_datacount:-$ushscript} # above is path to data counting script export ushscript_remorest=${ushscript_remorest:-$ushscript} # above is path to restricted data removal script export ushscript_avgdata=${ushscript_avgdata:-$ushscript} # above is path to data count averaging script ################################################################ # Run setup to initialize working directory and utility scripts ################################################################ sh $utilscript/setup.sh ########################################## # Run setpdy and initialize PDY variables ########################################## sh $utilscript/setpdy.sh . $DATA/PDY ######################### # Define COM directories ######################### export COM_IN=${COM_IN:-/com/${NET}/${envir}} export COM_OUT=${COM_OUT:-/com/${NET}/${envir}} export COMIN=${COMIN:-${COM_IN}/${RUN}.${PDY}} export COMOUT=${COMOUT:-${COM_OUT}/${RUN}.${PDY}} mkdir -m 775 -p $COMOUT ######################################################### # Specify variables specific to this execution of script ######################################################### export PROCESS_DATACOUNTS=${PROCESS_DATACOUNTS:-NO} # Never processed in RAP run export PROCESS_REMOREST=${PROCESS_REMOREST:-YES} export PROCESS_UNBLKBUFR=${PROCESS_UNBLKBUFR:-NO} # Never processed in RAP run export PROCESS_LISTERS=${PROCESS_LISTERS:-YES} if [ "$RUN" = 'rap' -a "$cyc" = '23' ]; then # The 23Z RAP (full cycle) run generates data count avg tables export PROCESS_AVGTABLES=${PROCESS_AVGTABLES:-YES} else export PROCESS_AVGTABLES=${PROCESS_AVGTABLES:-NO} fi env ##################### # Execute the script ##################### if [ $GET_IOPROFILE = YES ]; then /usrx/local/mio/tools/bin/miostats -X0 \ $SCRIPTSrap/exdump_post.sh.sms err_rap_dump_post=$? else $SCRIPTSrap/exdump_post.sh.sms err_rap_dump_post=$? fi ##################### echo "`hostname` -- `date`" > $COMOUT/where_${cycle}_${RUN}_dump_post_ran ################################################# # Save the profiling data captured from miostats ################################################# if [ $GET_IOPROFILE = YES ]; then . /com/miostats/.set_IOprofile fi CLEAN=${CLEAN:-YES} if [ $CLEAN = YES ]; then cd $DATA_IN rm -rf $DATA fi date if [ $SENDSMS = YES ]; then $SMSBIN/smscomplete; fi