#!/bin/sh ############################################ # Set up environment for ensemble products job # initial program, Jun Du, 2001 # change log: # 10/23/2003, Jun Du: use $REGPAIR (for Eta members) # and $RSMPAIR to replace $TOTALPAIR to # deal with different ensemble size in # the two components # 06/16/2005, Jun Du: (1) extend forecast lead time from 63hr # to 87hr; (2) call multiple grids in stead of # 212 one grid only # 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. # 11/15/2011, Jun Du: modified to new 2012 version of SREF (v6.0) # and added hourly output capability # 05/01/2012, Jun Du: added a new 16km grid (g132) ############################################ set -xa # # Specify whether the run is production or development # export RUN_ENVIR=${RUN_ENVIR:-prod} ##################################################################################### # Run config file to get input parameters # This config file should define the following variables # DATA_IN: Location of working directory, default to /tmpnwprd # DEV_SMS: 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 CONFIG_FILE=${CONFIG_FILE:-/meso/save/${LOGNAME}/sref/nwprod/parm/sref_para_config} . $CONFIG_FILE export userid=$LOGNAME export DATA_IN=${DATA_IN:-/ptmp/$userid} fi ############################################################### # This block can be modified for different test environment ############################################################### if [ $RUN_ENVIR = prod -a $envir != prod ]; then export DBNROOT=/nwprod/spa_util/fakedbn export jlogfile=${jlogfile:-/com/logs/${envir}/jlogfile} fi if [[ $RUN_ENVIR = prod || ${SENDSMS:-YES} = YES ]] ; then $SMSBIN/smsinit $LOADL_STEP_ID fi echo `date` $0 `date -u` begin export PS4='$SECONDS + ' ########################################################### # obtain unique process id (pid) and make temp directories ########################################################### export pid=$$ export DATA_IN=${DATA_IN:-/tmpnwprd} export DATA=$DATA_IN/${job}.${pid} rm -rf $DATA mkdir -p $DATA cd $DATA #################################### # File To Log Msgs #################################### export jlogfile=${jlogfile:-/com/logs/jlogfile} #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export cycle=t${cyc}z ############################### # Specify NET and RUN name ############################## 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) ################################################## export SENDCOM=${SENDCOM:-YES} export SENDSMS=${SENDSMS:-YES} if [ $DBNROOT = DBNROOT_OFF ]; then export SENDDBN=NO else export SENDDBN=${SENDDBN:-YES} fi export HOMEsref=${HOMEsref:-/nw${envir}/${NET}.${model_ver}} export EXECsref=${EXECsref:-$HOMEsref/exec} export FIXsref=${FIXsref:-$HOMEsref/fix} export PARMsref=${PARMsref:-$HOMEsref/parm} export USHsref=${USHsref:-$HOMEsref/ush} export SPCfix=${SPCfix:-$HOMEsref/fix} ################################### # 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 # Run setpdy and initialize PDY variables sh $utilscript/setpdy.sh . PDY ############################################# # COMIN and COMOUT ############################################# export COM_IN=${COM_IN:-/com/${NET}/${envir}} export COM_OUT=${COM_OUT:-/com/${NET}/${envir}} export COMIN=$COM_IN/${RUN}.${PDY}/${cyc}/pgrb export COMOUT=$COM_OUT/${RUN}.${PDY}/${cyc}/ensprod export COMOUT_TRACK=$COM_OUT/${RUN}.${PDY}/${cyc}/track mkdir -p -m 775 $COMOUT $COMOUT_TRACK env ####################################################### # Pass information which is needed to run the Script ####################################################### export ENDHOUR=87 export INCHOUR=3 ######################################################## # Execute the script using POE ######################################################## rm -rf $DATA/poescript # 1. Special products for EMC verification and DTRA mkdir -p $DATA/212_special echo "$HOMEsref/scripts/exsref_enspost4special.sh.sms 3hrly 212 $DATA/212_special 111 > $DATA/212_special.out" >>$DATA/poescript mkdir -p $DATA/216_special echo "$HOMEsref/scripts/exsref_enspost4special.sh.sms 3hrly 216 $DATA/216_special 111 > $DATA/216_special.out" >>$DATA/poescript mkdir -p $DATA/243_special echo "$HOMEsref/scripts/exsref_enspost4special.sh.sms 3hrly 243 $DATA/243_special 111 > $DATA/243_special.out" >>$DATA/poescript # 2. SPC combined probabilities mkdir -p $DATA/212_SPC_3hrly echo "$HOMEsref/scripts/exsref_enspost4SPC.sh.sms 3hrly 212 $DATA/212_SPC_3hrly 111 > $DATA/212_SPC_3hrly.out" >>$DATA/poescript mkdir -p $DATA/243_SPC_3hrly echo "$HOMEsref/scripts/exsref_enspost4SPC.sh.sms 3hrly 243 $DATA/243_SPC_3hrly 111 > $DATA/243_SPC_3hrly.out" >>$DATA/poescript mkdir -p $DATA/216_SPC_3hrly echo "$HOMEsref/scripts/exsref_enspost4SPC.sh.sms 3hrly 216 $DATA/216_SPC_3hrly 111 > $DATA/216_SPC_3hrly.out" >>$DATA/poescript # Turned off because it runs too slow #mkdir -p $DATA/132_SPC_3hrly #echo "$HOMEsref/scripts/exsref_enspost4SPC.sh.sms 3hrly 132 $DATA/132_SPC_3hrly 111 > $DATA/132_SPC_3hrly.out" >>$DATA/poescript # 3. Regular ensemble products mkdir -p $DATA/212_3hrly echo "$HOMEsref/scripts/exsref_enspost.sh.sms 3hrly 212 $DATA/212_3hrly 111 0 > $DATA/212_3hrly.out" >>$DATA/poescript mkdir -p $DATA/216 echo "$HOMEsref/scripts/exsref_enspost.sh.sms 3hrly 216 $DATA/216 111 0 > $DATA/216.out" >>$DATA/poescript mkdir -p $DATA/243 cd $DATA/243 echo "$HOMEsref/scripts/exsref_enspost.sh.sms 3hrly 243 $DATA/243 111 0 > $DATA/243.out" >>$DATA/poescript chmod 775 $DATA/poescript export MP_PGMMODEL=mpmd export MP_CMDFILE=$DATA/poescript # # Execute the script. /usr/bin/poe -cmdfile $DATA/poescript -pgmmodel mpmd -ilevel 3 -labelio yes -stdoutmode ordered export err=$?; err_chk ############################################# # Run run sref_trak_ave.sh to compute the # SREF ensemble mean cyclone forecast tracks. ############################################# export RUN_TCTRACK=${RUN_TCTRACK:-YES} if [ ${RUN_TCTRACK} = 'YES' ] then export cmodel=sref export srefdir=$COMOUT export COM=$COMOUT_TRACK sh $utilscript/ens_trak_ave.sh fi wait cd $DATA cat $DATA/212_3hrly.out >>$pgmout cat $DATA/216.out >>$pgmout cat $DATA/243.out >>$pgmout cat $DATA/212_special.out >>$pgmout cat $DATA/216_special.out >>$pgmout cat $DATA/243_special.out >>$pgmout cat $DATA/212_SPC_3hrly.out >>$pgmout cat $DATA/243_SPC_3hrly.out >>$pgmout cat $DATA/216_SPC_3hrly.out >>$pgmout ######################################################## cat $pgmout msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ################################ # Remove the Working Directory ################################ cd $DATA_IN if [ ${RM_TMPDIR:-YES} = YES ] ; then rm -rf $DATA ; fi date if [ $SENDSMS = YES ]; then $SMSBIN/smscomplete fi