#!/bin/ksh set -x ################################################################# # 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 environment only. ################################################################# # ################################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date export machine=${machine:-wcoss} export RUN_ENVIR=${RUN_ENVIR:-nco} export SENDECF=${SENDECF:-YES} ################################################################# # Notes for dev: # # 'export SENDEDF' above is added by prod, likely something to do # with ECF. It replaces the old 'SENDSMS'. Its usage is not visible # to dev. # # verf_precip_config contains exports such as # # export HOMEverf_precip=/nw{envir} (for prod; dev defines this in ecf script) # export EXECverf_precip=$HOMEverf_precip/exec # ... # export SENDCOM= ... # export SENDDBN= ... # export SENDRZDM= ... # ... # # End of notes for dev user # ################################################################# # To locate job output quickly: echo 'Actual output starts here:' if [ "$RUN_ENVIR" = dev ] ### For Developers then # PARMverf_precip is set in the ecf/sms script. It is either 'parm' or # parm.dev, under $HOMEverf_precip. # . $PARMverf_precip/verf_precip_config # export DATAROOT=${DATAROOT:-/tmpnwprd2} export SENDDBN=NO if [ $debug = N ]; then KEEPDATA=NO else KEEPDATA=YES fi fi ############################################################### # This block can be modified for different Production test # environment. This is used for operational testings ############################################################### if [ $RUN_ENVIR = "nco" -a $envir != "prod" ] ### For Operations then export SENDDBN=${SENDDBN:-YES} export DBNLOG=${DBNLOG:-YES} fi ########################################################### # obtain unique process id (pid) and make temp directories ########################################################### export pid=$$ export DATA=$DATAROOT/${jobid} mkdir -p $DATA cd $DATA export pgmout="OUTPUT.$$" export cycle=t${cyc}z ############################### # Specify NET and RUN name ############################### export NET=verf_precip export RUN=precip ################################################################ # SENDCOM=YES--Copy output file to /com # SENDECF=YES--Allow to talk back to ECF # SENDDBN=YES--Alert output file to TOC, set to NO for testing ################################################################ export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-YES} # need to set to NO for testing only export SENDECF=${SENDECF:-YES} export SENDRZDM=${SENDRZDM:-NO} # for daily side-by-side plots ################################################################ # Specify Execution Areas # Non-dev uses the follwing block instead of parm/verf_precip_config ################################################################ export HOMEverf_precip=${HOMEverf_precip:-${PACKAGEROOT}/verf_precip.${verf_precip_ver}} export EXECverf_precip=${EXECverf_precip:-$HOMEverf_precip/exec} export PARMverf_precip=${PARMverf_precip:-$HOMEverf_precip/parm} export USHverf_precip=${USHverf_precip:-$HOMEverf_precip/ush} export FIXverf_precip=${FIXverf_precip:-$HOMEverf_precip/fix} ################################### # Set up the UTILITIES ################################### # WGRIBpath is needed in ush/verf_precip_ywgrib.pl: export WGRIBpath=`echo $WGRIB | sed 's/\/wgrib//'` # ----------------- Note for Dev ----------------------------------- # set 'bsubnext' to 'N' unless specified in the ECF script. This is one of # parameters (used only in dev mode) telling the script whether to bsub # verfgen24 and verfgen03. export bsubnext=${bsubnext:-N} # If the calling script specifies a $vday value, then PDY=$vday+1. if [ "$vday" != "" ]; then PDY=`date -d "$vday + 1 day" +%Y%m%d` fi # /com/date is maintained by NCO on WCOSS, but it does not exist # on Theia. Do not use setpdy on Theia. if [ $machine = theia ]; then PDYm1=`date +%Y%m%d -d "1 day ago"` else # Run setpdy and initialize PDY variables setpdy.sh . $DATA/PDY fi export vday=${vday:-$PDYm1} ################################################# # Set up the INPUT and OUTPUT directories ################################################# export COMIN=${COMIN:-$(compath.py -o $NET/$verf_precip_ver/$RUN)} export COMOUT=${COMOUT:-$(compath.py -o $NET/$verf_precip_ver/$RUN)} export COMINpcpanl=${COMINpcpanl:-$(compath.py $envir/com/pcpanl/${pcpanl_ver})} # don't create verf/v4.5/precip/. It's always empty. #if [ ! -d $COMOUT ]; then # mkdir -p -m 775 $COMOUT #fi env echo Actual output starts here ################################################ # Get the config variable from the config file: ################################################ if [ $retro = Y ]; then . $PARMverf_precip/verf_precip_ppt_config.retro else . $PARMverf_precip/verf_precip_ppt_config fi ####################################################################### # Execute the script. $HOMEverf_precip/scripts/exverf_precip_getppt.sh ####################################################################### msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$jlogfile" "$msg" cd $DATAROOT if [ "$KEEPDATA" != "YES" ] ; then cd $DATAROOT rm -rf $DATA fi date