#!/bin/bash ######################################################### # 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 ####################################################### set -xa #################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-naefs} export RUN=${RUN:-fens} ##################################################################################### # DATAROOT: Location of working directory, default to /lfs/f1/ops/${envir}/tmp # 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 ${COMROOT}/$NET/${envir} # COM_OUT: Directory for output file, default to ${COMROOT}/$NET/${envir} ##################################################################################### export PS4='$SECONDS + ' date ######################################################## # obtain unique process id (pid) and make temp directory ######################################################## export pid=$$ export DATAROOT=${DATAROOT:-/lfs/f1/ops/${envir}/tmp} export DATA=${DATA:-${DATAROOT:?}/${jobid}} 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 pgmerr=errfile export cycle=t${cyc}z ################## # File To Log Msgs ################## export jlogfile=${jlogfile:-${DATA}/jlogfile.${job}.${pid}} ################################################################ # SENDCOM=YES--Copy output file to ${COMROOT} # 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:-NO} export BIASC00=${BIASC00:-NO} export BIASMEM=${BIASMEM:-NO} export BIASCDAS=${BIASCDAS:-YES} export BIASANL=${BIASANL:-YES} ######################### # Specify Execution Areas ######################### export HOMEfnmoc=${HOMEfnmoc:-${PACKAGEROOT}/naefs.${naefs_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>' ######################################### # Run setpdy and initialize PDY variables ######################################### setpdy.sh . ./PDY ######################## # Define COM directories ######################## export COM_FENS=${COM_FENS:-$(compath.py $envir/$NET/${naefs_ver})} export COMINbias=${COMINbias:-$(compath.py $envir/$NET/${naefs_ver})} export COMINgefs=${COMINgefs:-$(compath.py ${envir}/com/gefs/${gefs_ver})} export COMINnavgem=${COMINnavgem:-${DCOMROOT}/navgem} export COMINcfs=${COMINcfs:-$(compath.py ${envir}/com/cfs/${cfs_ver})} export COM_OUT=${COM_OUT:-$(compath.py -o $NET/${naefs_ver})} export COMOUT=$COM_OUT/${RUN}.${PDY}/${cyc}/pgrb2ap5 export COMOUTNCEP_M1=$COM_OUT/gefs.${PDYm1}/${cyc}/pgrb2ap5 export COMOUT_M1=$COM_OUT/${RUN}.${PDYm1}/${cyc}/pgrb2ap5 mkdir -m 775 -p $COMOUT mkdir -m 775 -p $COMOUT_M1 mkdir -m 775 -p $COMOUTNCEP_M1 msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env #################### # Execute the script #################### $HOMEfnmoc/scripts/exnaefs_fnmoc_ens_bias.sh cat $pgmout.000.anl cat $pgmout.000.mdf msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ############################## # Remove the Temporary working directory ############################## if [ $KEEPDATA != YES ]; then cd $DATAROOT rm -rf $DATA fi date