#!/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 environment ###################################################### 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/${envir}/jlogfile} export DBNROOT=/nwprod/spa_util/fakedbn export envir_getges=prod export USHGETGES=/nwprod/util/ush fi ################################# # SET SHELL PROCESSING VARIABLES ################################# export PS4='$SECONDS + ' date ############################################################################ # SETUP RAP (full cycle) OR RAP_P (partial cycle) PREP PROCESSING VARIABLES ############################################################################ ######################################################### # 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:-NO} # save output in $DATA 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 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 # GET_IOPROFILE - Run I/O statistics ############################################################### 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 GET_IOPROFILE=${GET_IOPROFILE:-NO} export HOMErap=${HOMErap:-/nw${envir}/${NET}.${model_ver}} export SCRIPTSrap=${SCRIPTSrap:-${HOMErap}/scripts} export EXECrap=${EXECrap:-${HOMErap}/exec} export PARMrap=${PARMrap:-${HOMErap}/parm} export FIXrap=${FIXrap:-${HOMErap}/fix} ########################## # Specify Execution Areas ########################## export HOMEPREP=${HOMEPREP:-/nwprod} export EXECPREP=${EXECPREP:-${HOMEPREP}/exec} export FIXPREP=${FIXPREP:-${HOMEPREP}/fix} export PARMPREP=${PARMPREP:-${HOMEPREP}/parm} export DICTPREP=${DICTPREP:-${HOMEPREP}/dictionaries} export HOMEUTIL=${HOMEUTIL:-/nwprod/util} export EXECUTIL=${EXECUTIL:-${HOMEUTIL}/exec} #export specific rap OBSPROC variables here export PRPC=$PARMrap/prepobs_prepdata.rap.parm export CQCC=$PARMrap/prepobs_cqcbufr.rap.parm export AQCC=$PARMrap/prepobs_prepacqc.rap.parm export PQCC=$PARMrap/prepobs_profcqc.rap.parm ####################### # 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 utilities=${utilities:-/nwprod/util/ush} ################################################################ # Run setup to initialize working directory and utility scripts ################################################################ sh $utilscript/setup.sh cp /usr/bin/timex $DATA/timex chmod 755 $DATA/timex ########################################## # 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 COM=${COM:-${COM_IN}} 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 ######################################################### # NPROCS indicates the number of POE tasks # {Applies only when PREPDATA=YES below and POE=YES (default)} export NPROCS=$(($(echo $LOADL_PROCESSOR_LIST|wc -w)+0)) # NSPLIT indicates the number of tasks for running PREPDATA # (PREPDATA processing will be split into this many parts) # {Applies only when PREPDATA=YES below and POE=YES (default)} # (must be .le. $NPROCS) export NSPLIT=$NPROCS # BUFRLIST indicates the list of BUFR data dump file names to process export BUFRLIST=${BUFRLIST:-"adpupa proflr aircar aircft satwnd adpsfc \ sfcshp vadwnd goesnd msonet gpsipw rassda ascatw wdsatr"} # VARIABLES THAT CONTROL PROCESSING OF INDIVIDUAL PROGRAMS # -------------------------------------------------------- # -- These can individually be switched to NO without affecting the # success of other programs and the success of the complete job # (all should normally be set to YES unless otherwise specified; # if job fails in one of these programs, set offending program # to NO and resubmit to "work-around" problem) export SYNDATA=${SYNDATA:-NO} # Execute program SYNDAT_SYNDATA if YES # SHOULD ALWAYS BE SET TO "NO" export PREPACQC=${PREPACQC:-YES} # Execute PREPACQC script processing if YES export PROCESS_ACQC=${PROCESS_ACQC:-YES} # Execute program PREPOBS_PREPACQC # if YES export PROCESS_ACPF=${PROCESS_ACPF:-YES} # Execute program PREPOBS_PREPACPF # if YES export PROFCQC=${PROFCQC:-YES} # Execute program PREPOBS_PROFCQC if YES export CQCVAD=${CQCVAD:-YES} # Execute program PREPOBS_CQCVAD if YES export CQCBUFR=${CQCBUFR:-YES} # Execute program PREPOBS_CQCBUFR if YES export OIQCBUFR=${OIQCBUFR:-NO} # Execute program PREPOBS_OIQCBUFR if YES # SHOULD ALWAYS BE SET TO "NO" # -- If any of these are switched to NO it will affect the success of # other programs and the success of the complete job # (these are set-up only for CHECKOUT runs - they should always # be set to YES for operational runs) export PREPDATA=${PREPDATA:-YES} # Execute programs PREPOBS_MPCOPYBUFR, PREPOBS_PREPDATA, # PREPOBS_LISTHEADERS and PREPOBS_MONOPREPBUFR if YES export GETGUESS=${GETGUESS:-YES} # Encode first guess (background) values interpolated to # observation locations in the PREPBUFR file for use by # the q.c. programs. If the center PREPBUFR processing # date/time is a multiple of 3-hrs, this guess is always # from a global sigma guess file valid at the center # PREPBUFR processing date/time. Otherwise, this guess # is created by a linear interpolation of spectral # coefficients from global sigma guess files that span # the PREPBUFR processing date/time. This is necessary # because global sigma guess files are valid only at # hours which are a multiple of 3. export DO_QC=${DO_QC:-YES} # IF NO, programs PREPOBS_PREPACQC, PREPOBS_PREPACPF, # PREPOBS_PROFCQC, PREPOBS_CQCVAD, PREPOBS_CQCBUFR and # PREPOBS_OIQCBUFR will NEVER execute regardless of # switches above - # should be set to NO only as a last resort!!! env ##################### # Execute the script ##################### if [ $GET_IOPROFILE = YES ]; then /usrx/local/mio/tools/bin/miostats -X0 \ $SCRIPTSrap/exrap_makeprepbufr.sh.sms err_rap_prep=$? else $SCRIPTSrap/exrap_makeprepbufr.sh.sms err_rap_prep=$? fi ################################################# # 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