#!/bin/sh set -xa export MP_IOAGENT_CNT=all export MP_IO_BUFFER_SIZE=8M ######################################## # RAP Preliminary data setup step ######################################## ###################################################### # 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:-rap_p} export model=${model:-rap} ############################################################### # 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 ##################################################################################### # This block is for Developer's test run: # Run config file to get input parameters # This config file should define the following variables # DATA_IN: Location of working directory, default to /tmpnwprd # SENDSMS: If the job is to be running using SMS, default to YES # SENDDBN: Set to NO for developers, default to YES # COM_IN: Directory for input files, default to /com/$NET/${envir} # COM_OUT: Directory for output file, default to /com/$NET/${envir} # gespath: Directory for the guess or restart files, default to /nwges/${envir} ##################################################################################### if [ "$RUN_ENVIR" != prod ] ### For Developers, "group_name" is passed from the SMS script then group_name=${group_name:-meso} package_name=${package_name:-rap} . /${group_name}/save/${LOGNAME}/${package_name}/nwprod/parm/${package_name}_para_config export userid=${userid:-$LOGNAME} export DATA_IN=${DATA_IN:-/ptmp/$userid} fi if [ $SENDSMS = YES ] then $SMSBIN/smsinit $LOADL_STEP_ID fi export PS4='$SECONDS + ' date #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ export DATA_IN=${DATA_IN:-/tmpnwprd} export DATA=$DATA_IN/rap_anl_pcyc_${envir}_${cyc} mkdir -p $DATA cd $DATA export cycle=t${cyc}z export tmmark=tm00 #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" #################################### # File To Log Msgs #################################### export jlogfile=${jlogfile:-/com/logs/jlogfile} #################################### # SENDSMS - Flag Events on SMS # SENDCOM - Copy files to /com directory #################################### export SENDSMS=${SENDSMS:-YES} export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-NO} #################################### # Specify Execution Areas #################################### export HOMErap=${HOMErap:-/nw${envir}/${NET}.${model_ver}} export EXECrap=${EXECrap:-${HOMErap}/exec} export FIXrap=${FIXrap:-${HOMErap}/fix} export PARMrap=${PARMrap:-${HOMErap}/parm} export USHrap=${USHrap:-${HOMErap}/ush} ################################### # Set up the UTILITIES ################################### export utilscript=${utilscript:-/nwprod/util/ush} export utilexec=${utilexec:-/nwprod/util/exec} ############################################################### # Run setup to initialize working directory and utility scripts ############################################################### sh $utilscript/setup.sh ########################################### # Run setpdy and initialize PDY variables ########################################### sh $utilscript/setpdy.sh . PDY ############################################## # Define COM directories ############################################## export COM_IN=${COM_IN:-/com/${NET}/${envir}} export COM_OUT=${COM_OUT:-/com/${NET}/${envir}} export COM_RAD=${COM_RAD:-/com/hourly/prod} export COM=${COM:-COM_IN} export COMIN=${COMIN:-${COM_IN}/${RUN}.${PDY}} export COMOUT=${COMOUT:-${COM_OUT}/${RUN}.${PDY}} mkdir -m 775 -p $COMOUT ############################################## # Define GES directories ############################################## export gespath=${gespath:-/nwges/${envir}} export RAPBC=$gespath/${NET}/rapbc mkdir -m 775 -p $RAPBC env ######################################################## # Execute the script. ${RAP_ANALSH:-$HOMErap/scripts/exrap_updatebc_pcyc.sh.sms} ######################################################## cat $pgmout msg="ENDED NORMALLY." postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd $DATA_IN if [ ${RM_TMPDIR:-YES} = NO ] ; then rm -rf $DATA ; fi date if [ $SENDSMS = YES ]; then $SMSBIN/smscomplete; fi