#!/bin/ksh ####################################################################### # Create Gempak products for the FNMOC ensemble output ####################################################################### ###################################################### # 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 #################################### # Specify NET and RUN Name and model #################################### export NET=gens export RUN=fens ##################################################################################### # This block is for Developer's test run: # Run config file to get input parameters # This config file should define the following variables # DATA_IN: Location of working directory, default to /tmpnwprd2 # SENDECF: If the job is to be running using ecFLOW, 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" = dev ] ### For Developers, "group_name" is passed from the SMS script then . /${group_name}/save/${LOGNAME}/fnmoc/nwprod/parm/fnmoc_config #export COM_IN=/global/hires/wx22yz/com/gens/${envir} fi # #### 08/25/1999 ################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date #################################### # obtain unique process id (pid) and make temp directory #################################### export pid=$$ export DATA_IN=${DATA_IN:-/tmpnwprd2} export DATA=$DATA_IN/${job}.${pid} mkdir -p $DATA cd $DATA #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" 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 ################################################################ # SENDCOM=YES--Copy output file to /com # SENDECF=YES--Allow to talk back to ecFLOW # 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 export SENDECF=${SENDECF:-YES} ############################################ # Set up model and cycle specific variables ############################################ export NET=${NET:-gens} export RUN=${RUN:-fens} export fend=384 export finc=6 export fstart=06 export model=ensemble export GRIB= export EXT="" export DBN_ALERT_TYPE=FNMOCBC_ENS_GEMPAK # # Now set up GEMPAK/NTRANS environment # . /nwprod/gempak/.gempak ######################### # Specify Execution Areas ######################### export HOMEnaefs=${HOMEnaefs:-/nw${envir}/naefs.${model_ver}} export EXECnaefs=${EXECnaefs:-$HOMEnaefs/exec} export FIXnaefs=${FIXnaefs:-$HOMEnaefs/fix} export USHnaefs=${USHnaefs:-$HOMEnaefs/ush} ################################### # 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 export com=${com:-/com/${NET}/${envir}} export COM_IN=${COM_IN:-/com/${NET}/${envir}} export COM_NAWIPS=${COM_NAWIPS:-/com/nawips/${envir}} export COMIN_AN=$COM_IN/${RUN}.${PDY}/${cyc}/pgrba_an export COMIN_BC=$COM_IN/${RUN}.${PDY}/${cyc}/pgrba_bc export COMIN_WT=$COM_IN/${RUN}.${PDY}/${cyc}/pgrba_wt export COMOUT=$COM_NAWIPS/${RUN}.${PDY} if [ ! -f $COMOUT ] ; then mkdir -p -m 775 $COMOUT fi env DATAHOLD=$DATA ######################################################## # Execute the script. for ftype in an bc do for member in p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 do export DATA=$DATAHOLD/${member}_${ftype} mkdir -p $DATA cd $DATA # Run setup to initialize working directory and utility scripts sh $utilscript/setup.sh case $ftype in an) export COMIN=$COMIN_AN;; bc) export COMIN=$COMIN_BC;; esac export $member export RUN=fnmoc_ge${member} export model=$ftype ${NAWIPSSH:-${HOMEnaefs}/scripts/exnawips.sh.ecf} > $DATAHOLD/${member}_${ftype}.out 2>&1 & done done ######################################################## wait cd $DATAHOLD for member in p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 do set +x echo "######################################" echo " ${member}_an.OUT and ${member}_bc.out " echo "######################################" set -x cat ${member}_an.out cat ${member}_bc.out done msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd $DATA_IN rm -rf $DATA date