#!/bin/sh ############################################ # Set up environment for WRF BUFR JOB # Change log: # # 08/01/2007, Jun Du: Initial Implementation # 07/18/2008, Jun Du: upgraded to new mpiio wrfbufr version for # both WRF cores in order to match WRFv2.2 # # MODEL(MEMBER ...)=NMM(ctl,p01,n01,p02,n02,p03,n03) # +ARW(ctl,p01,n01,p02,n02,p03,n03) # +NMB(ctl,p01,n01,p02,n02,p03,n03) # 9/20/2009, Julia Zhu Scripts are modified to be sharable # between EMC and NCO # 3/26/2012, Geoff Manikin adapted for meanbufr # # Please note that variable "RUN_ENVIR" is set and used # in the development enviroment only. ############################################ set -xa $SMSBIN/smsinit $LOADL_STEP_ID ########################################### # Run sref_config to get input parameters ########################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then . /meso/save/$LOGNAME/sref/nwprod/parm/sref_config fi # ################################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date # # obtain unique process id (pid) and make temp directories # export pid=$$ if [ "$RUN_ENVIR" = dev ] ### For Developers then export DATA_IN=${DATA_IN:-/ptmp/$LOGNAME/tmpnwprd} else ### For Operations export DATA_IN=/tmpnwprd fi export DATA=$DATA_IN/sref_meanbufr_${cyc}_${envir} rm -rf $DATA mkdir -p $DATA cd $DATA #################################### # File To Log Msgs #################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then export jlogfile=${jlogfile:-$DATA_IN/jlogfile} else ### For Operations export jlogfile=/com/logs/jlogfile fi #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export CYC=$cyc export cycle=t${cyc}z export NET=sref export RUN=sref ################################################## # SAVEGES - Copy Files From TMPDIR to $GESdir # SENDSMS - Flag Events on SMS # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls # RERUN - Rerun fcst from beginning (default no) ################################################## if [ "$RUN_ENVIR" = dev ] ### For Developers then export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-NO} export SENDSMS=${SENDSMS:-YES} export HOMEsref=${HOMEsref:-/nw${envir}} export EXECsref=${EXECsref:-$HOMEsref/exec} export FIXsref=${FIXsref:-$HOMEsref/fix} export PARMsref=${PARMsref:-$HOMEsref/parm} export USHsref=${USHsref:-$HOMEsref/ush} else ### For Operations export SENDCOM=YES export SENDDBN=YES export SENDSMS=YES export HOMEsref=/nw${envir}/${NET}.${model_ver} export EXECsref=$HOMEsref/exec export FIXsref=$HOMEsref/fix export PARMsref=$HOMEsref/parm export USHsref=$HOMEsref/ush export HOMEnam=/nwprod export EXECnam=$HOMEnam/exec export FIXnam=$HOMEnam/fix export PARMnam=$HOMEnam/parm export USHnam=$HOMEnam/ush fi #export PARMgempak=$GEMPAK/tables/pack ################################### # 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 if [ "$RUN_ENVIR" = dev ] ### For Developers then export COMIN=$COM_IN/${RUN}.${PDY}/${cyc} export COMOUT=$COM_OUT/${RUN}.${PDY}/$cyc export COMIN_PROF=/ptmp/$LOGNAME/com/${NET}/${envir}/${RUN}.${PDY}/$cyc/bufr else ### For Operations export COMIN=/com/${NET}/${envir}/${RUN}.${PDY}/$cyc export COMOUT=/com/${NET}/${envir}/${RUN}.${PDY}/$cyc export COMIN_PROF=/com/${NET}/${envir}/${RUN}.${PDY}/$cyc/bufr fi mkdir -p $COMOUT env ################################################### # Execute the Script # $HOMEsref/scripts/exsref_meanbufr.sh.sms msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$jlogfile" "$msg" cat $pgmout cd $DATA_IN rm -rf $DATA date $SMSBIN/smscomplete