#!/bin/bash ##### 05/05/99 ######################################### # Daily Update Bias Estimation from FNMOC Global Ensemble # ####################################################### ###################################################### # 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 #################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-gens} export RUN=${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 /tmpnwprd # SENDECF: 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" = dev ]; then PARA_CONFIG=${PARA_CONFIG:-/ensemble/save/${LOGNAME}/${direxp}/parm/fnmoc_bias_config} . $PARA_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 #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" #export pgmout="OUTPUT.${pid}" export pgmout="OUTPUT" export pgmerr=errfile 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 SMS # 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} ######################################################################## # RUNJOB - Judge the Job for Regular Run or Extended 00 Cycle Run ######################################################################## export RUNJOB=${RUNJOB:-REGULAR} ##################################################################### # BIASAVG - Calculate the Bias of Ensemble Average # BIASC00 - Calculate the Bias of Ensemble Control Test # BIASMEM - Calculate the Bias of One Ensemble Member # BIASCDAS - Calculate the Difference Between GDAS and CDAS Analysis # BIASANL - Calculate the Difference Between NCEP and FNMOC Analysis ##################################################################### export BIASAVG=${BIASAVG:-YES} export BIASC00=${BIASC00:-NO} export BIASMEM=${BIASMEM:-NO} export BIASCDAS=${BIASCDAS:-YES} export BIASANL=${BIASANL:-YES} #################################### # Specify Execution Areas #################################### export HOMEfnmoc=${HOMEfnmoc:-/nw${envir}/naefs.${model_ver}} export EXECfnmoc=${EXECfnmoc:-$HOMEfnmoc/exec} export FIXfnmoc=${FIXfnmoc:-$HOMEfnmoc/fix} export USHfnmoc=${USHfnmoc:-$HOMEfnmoc/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 COM_FENS=${COM_FENS:-/com/${NET}/${envir}} export COM_BIAS=${COM_BIAS:-/com/${NET}/${envir}} #export COM_NCEP=${COM_NCEP:-/com/${NET}/${envir}} export COM_NCEP=${COM_NCEP:-/com/${NET}/prod} #export COM_NOGAPS=${COM_NOGAPS:-/com/fnmoc/${envir}} export COM_NOGAPS=${COM_NOGAPS:-/com/fnmoc/prod} #export COM_CFS=${COM_CFS:-/com/cfs/${envir}} export COM_CFS=${COM_CFS:-/com/cfs/prod} export COM_OUT=${COM_OUT:-/com/${NET}/${envir}} export COMOUT=$COM_OUT/${RUN}.${PDY}/${cyc}/pgrb2a export COMOUTNCEP_M1=$COM_OUT/gefs.${PDYm1}/${cyc}/pgrb2a export COMOUT_M2=$COM_OUT/${RUN}.${PDYm2}/${cyc}/pgrb2a export COMOUT_GB1=$COM_OUT/${RUN}.${PDY}/${cyc}/pgrba export COMOUTNCEP_M1_GB1=$COM_OUT/gefs.${PDYm1}/${cyc}/pgrba export COMOUT_M2_GB1=$COM_OUT/${RUN}.${PDYm2}/${cyc}/pgrba mkdir -m 775 -p $COMOUT mkdir -m 775 -p $COMOUT_M2 mkdir -m 775 -p $COMOUTNCEP_M1 mkdir -m 775 -p $COMOUT_GB1 mkdir -m 775 -p $COMOUT_M2_GB1 mkdir -m 775 -p $COMOUTNCEP_M1_GB1 msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env ############################################################# # Execute the script $HOMEfnmoc/scripts/exfnmoc_ens_bias.sh.ecf ############################################################# cat $pgmout.00* msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## cd $DATA_IN rm -rf $DATA date