#!/bin/bash ###### 12/05/2013 ############################## # Downscale NCEP Ensemble Precipitation Forecast ################################################ #################################################### # 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 SENDECF=${SENDECF:-YES} set -xa export MP_IOAGENT_CNT=all export MP_IO_BUFFER_SIZE=8M #################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-gens} export RUN=${RUN:-gefs} ######################################### # Run config file to get input parameters ######################################### if [ "$RUN_ENVIR" != prod ] ### For Developers then . /ensemble/save/${LOGNAME}/cqpf_nwdev/parm/gefs_ndgd_cqpf_config fi export PS4='$SECONDS + ' date ######################################################## # obtain unique process id (pid) and make temp directory ######################################################## #export job=ndgd_cqpf export pid=$$ export DATA_IN=${DATA_IN:-/tmpnwprd2} #export DATA=$DATA_IN/${job}.${pid} export DATA=$DATA_IN/${job} mkdir -p $DATA cd $DATA export cycle=t${cyc}z #################################### # File To Log Msgs #################################### if [ "$envir" = 'prod' ] || [ "$envir" = 'para' ] || [ "$envir" = 'test' ] then # NCO if [ $envir = "prod" ] then export jlogfile=/com/logs/jlogfiles/jlogfile.${job}.${pid} else export jlogfile=/com/logs/${envir}/jlogfile #export DBNROOT=/nwprod/spa_util/para_dbn export DBNROOT=/nwprod/spa_util/fakedbn fi else # DEV export jlogfile=/dev/null fi ##################################### # Determine Job Output Name on System ##################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export pgmerr=errfile ############################################## # SENDECF - Flag Events on SMS # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls ############################################## export SENDCOM=${SENDCOM:-YES} export SENDECF=${SENDECF:-YES} export SENDDBN=${SENDDBN:-YES} ################################################################### # RUNJOB - Judge the Job for Regular Run or Extended 00 Cycle Run ################################################################### export RUNJOB=${RUNJOB:-REGULAR} ######################### # Specify Execution Areas ######################### export HOMEGEFS=${HOMEGEFS:-/nw${envir}/naefs.${model_ver}} export EXECGEFS=${EXECGEFS:-$HOMEGEFS/exec} export FIXGEFS=${FIXGEFS:-$HOMEGEFS/fix} export USHGEFS=${USHGEFS:-$HOMEGEFS/ush} export ERRSCRIPT=err_chk export LOGSCRIPT=startmsg export REDOUT='1>>' export REDERR='2>' ###################### # Set up the UTILITIES ###################### export HOMEUTIL=/nwprod/util export utilscript=$HOMEUTIL/ush export EXECUTIL=$HOMEUTIL/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 COMIN=${COMIN:-/com/${NET}/${envir}} export COMOUT=${COMOUT:-/com/${NET}/${envir}} #export COMINGEST=${COMINGEST:-/com/${NET}/${envir}} export COMINGEST=${COMINGEST:-/com/${NET}/prod} mkdir -m 775 -p $COMOUT msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env #################### # Execute the script #################### $HOMEGEFS/scripts/exgefs_conus_ndgd_enscqpf.sh.ecf ############################################################# cat $pgmout.* msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ######################################## # Remove the Temporary working directory ######################################## cd /tmpnwprd2 rm -rf $DATA date