#!/bin/sh ############################################################# # 9/20/2009, Julia Zhu Scripts are modified to be sharable # between EMC and NCO # Please note that variable "RUN_ENVIR" is set and used # in the development enviroment only. # ############################################################# ######################################## # Runs SREF gempak from pgrb212 up to 87 hours ######################################## $SMSBIN/smsinit $LOADL_STEP_ID set -xa ########################################### # Run sref_config to get input parameters ########################################### if [ "$RUN_ENVIR" = dev ] ### For Developers then . /meso/save/$LOGNAME/sref/nwprod/parm/sref_config fi # #### 08/25/1999 ################### # 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/${job}.${pid} mkdir $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 cycle=t${cyc}z if [ "$RUN_ENVIR" = dev ] ### For Developers then export SENDCOM=${SENDCOM:-YES} export SENDSMS=${SENDSMS:-YES} export SENDDBN=${SENDDBN:-NO} else ### For Operations export SENDCOM=YES export SENDDBN=YES export SENDSMS=YES fi # # Set up model and cycle specific variables # export NET=sref export RUN=sref export fend=00 export finc=03 export fstart=00 export GRIB= export EXT="" export HOMEsref=/nw${envir}/${NET}.${model_ver} export GEMPAksref=$HOMEsref/gempak # # Now set up GEMPAK/NTRANS environment # . /nwprod/gempak/.gempak # # Copy special table wmogrib2.tbl into $DATA # cp $GEMPAksref/fix/sref_wmogrib2.tbl wmogrib2.tbl cp $GEMPAksref/fix/sref_ncepgrib2.tbl ncepgrib2.tbl ################################### # Set up the UTILITIES ################################### export utilscript=/nwprod/util/ush export utilities=/nwprod/util/ush export 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 if [ "$RUN_ENVIR" = dev ] ### For Developers then export com_in=${com_in:-/com/${NET}/${envir}} export com=$com_in export COM_IN=${COM_IN:-/com/${NET}/${envir}} export COM_AWIPS=${COM_AWIPS:-/com/nawips/${envir}} export com=${com_in:-/com/${NET}/${envir}} export COMIN=$COM_IN/${RUN}.${PDY}/${cyc}/pgrb export RUN=spcsref export COMOUT=$COM_AWIPS/${RUN}.${PDY} else ### For Operations export com=/com/${NET}/${envir} export COMIN=/com/${NET}/${envir}/${RUN}.${PDY}/${cyc}/pgrb export RUN=spcsref export COMOUT=/com/nawips/${envir}/${RUN}.${PDY} fi if [ ! -f $COMOUT ] ; then mkdir -p -m 775 $COMOUT fi env ######################################################## # Execute the script. cd $COMIN for file in `ls sref_*.${cycle}.pgrb212.*.f${gempak_time}` do export model=`echo $file | cut -d. -f1 | cut -c6- ` export ens_mem=`echo $file | cut -d. -f4` cd $DATA for member in $ens_mem do export member if test "$model" = "em" -o "$model" = "nmm" -o "$model" = "nmb" then export DBN_ALERT_TYPE=`echo ${RUN}_${model}_GEMPAK | tr [a-z] [A-Z]` else export DBN_ALERT_TYPE=`echo ${RUN}_GEMPAK | tr [a-z] [A-Z]` fi # produce the sref gempak for each member $HOMEsref/scripts/exsref_nawips.sh.sms done done cat $pgmout cd $DATA_IN rm -rf $DATA date $SMSBIN/smscomplete