#!/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 EXGRBIX=${EXGRBIX:-/nwprod/util/exec} export ushscript_dump=/nw${envir}/ush # path to observational data dump scripts 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) DATA DUMP 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:-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 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 PMIC=$HOMErap/parm/prepobs_prepssmi.rap.parm #export DWSC=$HOMErap/parm/bufr_dcodwindsat.rap.parm ########################## # Specify Execution Areas ########################## export HOMEPREP=${HOMEPREP:-/nwprod} export EXECPREP=${EXECPREP:-${HOMEPREP}/exec} export FIXPREP=${FIXPREP:-${HOMEPREP}/fix} export PARMPREP=${PARMPREP:-${HOMEPREP}/parm} export TANK_GRIBFLDS=${TANK_GRIBFLDS:-${DCOMROOT}/us007003} # path to snow/ice grib field database export TANK=${TANK:-${DCOMROOT}/us007003} # path to BUFR observational database export EXGRBIX=${EXGRBIX:-/nwprod/util/exec} ####################### # 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_dump=${ushscript_dump:-$ushscript} # path to observational data dump scripts ################################################################ # 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 ######################################################### if [ $RUN = rap_p ]; then export PROCESS_GRIBFLDS=${PROCESS_GRIBFLDS:-NO} # defaults to NO in # partial cycle jobs else export PROCESS_GRIBFLDS=${PROCESS_GRIBFLDS:-YES} # defaults to YES in # full cycle jobs fi export PROCESS_DUMP=${PROCESS_DUMP:-YES} export prepssmi=NO # "spssmi" reprocessed dump no longer generated # since SSM/I instrument on F-13 has failed (11/2009) # LALO is set if doing geographic dumping # Expanded NAM domain: 0.5 degree mask nam_expdomain_halfdeg_imask.gbl export LALO="F$FIXPREP/nam_expdomain_halfdeg_imask.gbl" # POE must be set to on if running poe ###export POE=on # -- or -- BACK must be set to on if running background shells export BACK=on # "on" is default env ##################### # Execute the script ##################### if [ $GET_IOPROFILE = YES ]; then /usrx/local/mio/tools/bin/miostats -X0 \ $SCRIPTSrap/exrap_dump.sh.sms err_rap_dump=$? else $SCRIPTSrap/exrap_dump.sh.sms err_rap_dump=$? fi ##################### echo "`hostname` -- `date`" > $COMOUT/where_${cycle}_${RUN}_dump_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