#!/bin/bash # #### 05/05/99 ############################### # SETUP CMC ENS POST PROCESSING VARIABLES # ############################################# ###################################################### # 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} 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:-cmce} ########################################### # Run config file to get input parameters ########################################### if [ "$RUN_ENVIR" = dev ] ### For Developers, "group_name" is passed from the ecFLOW script then . /ensemble/save/${LOGNAME}/naefs_nwdev/parm/cmce_post_config fi 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 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 #################################### # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls #################################### export SENDCOM=${SENDCOM:-YES} export SENDDBN=${SENDDBN:-YES} # need to set to NO for testing export SENDDBN_GB2=${SENDDBN_GB2:-YES} # need to set to NO for testing ################################################# # ANAPRDGEN - if yes, CMC anlysis data available ################################################# export ANAPRDGEN=${ANAPRDGEN:-YES} export RUN_TCTRACK=${RUN_TCTRACK:-YES} #################################### # Specify Execution Areas #################################### export HOMEGLOBAL=${HOMEGLOBAL:-/nwprod} export EXECGLOBAL=${EXECGLOBAL:-$HOMEGLOBAL/exec} export FIXGLOBAL=${FIXGLOBAL:-$HOMEGLOBAL/fix} export USHGLOBAL=${USHGLOBAL:-$HOMEGLOBAL/ush} export HOMEcmce=${HOMEcmce:-/nw${envir}/naefs.${model_ver}} export EXECcmce=${EXECcmce:-$HOMEcmce/exec} export FIXcmce=${FIXcmce:-$HOMEcmce/fix} export USHcmce=${USHcmce:-$HOMEcmce/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:-$DATA_IN/cmc_ens_prdgen_${cyc}_${envir}} export COM_OUT=${COM_OUT:-/com/${NET}/${envir}} export COMOUTPGRBA=$COM_OUT/${RUN}.${PDY}/${cyc}/pgrba export COMOUTPGRB2A=$COM_OUT/${RUN}.${PDY}/${cyc}/pgrb2a export COMOUTENST=$COM_OUT/${RUN}.${PDY}/${cyc}/ensstat export COMOUTPGRBAm1=$COM_OUT/${RUN}.${PDYm1}/${cyc}/pgrba mkdir -m 775 -p $COMOUTPGRBA mkdir -m 775 -p $COMOUTPGRB2A mkdir -m 775 -p $COMOUTPGRBAm1 mkdir -m 775 -p $COMOUTENST msg="$job HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env ############################################################# # Execute the script $HOMEcmce/scripts/excmcens_post.sh.ecf ############################################################# echo "`hostname`--`date`" >$COM/${RUN}.${PDY}/${cyc}/track/where_cmce_tracker_${cycle}_ran msg="$job JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd $DATA_IN rm -rf $DATA date