#!/bin/bash # #### 05/05/2015####################################### # Daily Update Bias Estimation from NCEP 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:-gefs} 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 export cycle=t${cyc}z ################## # File To Log Msgs ################## export jlogfile=${jlogfile:-${DATA}/jlogfile.${job}.${pid}} ##################################### # Determine Job Output Name on System ##################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" ############################################## # SENDECF - Flag Events on ECF # 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} #################################################################### # BIASGFS - Calculate the Bias of High Resolution GFS Forecast # 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 CMC Analysis ##################################################################### export BIASGFS=${BIASGFS:-YES} export BIASAVG=${BIASAVG:-YES} export BIASCDAS=${BIASCDAS:-YES} export BIASANL=${BIASANL:-YES} export BIASC00=${BIASC00:-NO} export BIASMEM=${BIASMEM:-NO} ############################### # VARWEIGHT - Use varied weight ############################### export VARWEIGHT=NO ########################################################### # IF_REFCSTWITH - Combine Reforecast Bias with Decaying Bias # IF_REFCSTWITH=YES # IF_REFCSTONLY=NO # IF_DECAYONLY=NO # IF_REFCSTONLY - Consider Reforecast Bias Only # IF_REFCSTONLY=YES # IF_REFCSTWITH=NO # IF_DECAYONLY=NO # IF_DECAYONLY - Consider Decaying Bias Only # IF_DECAYONLY=YES # IF_REFCSTWITH=NO # IF_REFCSTONLY=NO ########################################################### export IF_REFCSTWITH=YES export IF_REFCSTONLY=YES export IF_DECAYONLY=NO ######################### # Specify Execution Areas ######################### export HOMEgefs=${HOMEgefs:-$PACKAGEROOT/naefs.${naefs_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>' ######################################### # Run setpdy and initialize PDY variables ######################################### setpdy.sh . ./PDY ######################## # Define COM directories ######################## export COMINbias=${COMINbias:-$(compath.py $envir/$NET/${naefs_ver})} export COMINgefs=${COMINgefs:-$(compath.py $envir/com/gefs/${gefs_ver})} export DCOMINcmce=${DCOMINcmce:-${DCOMROOT}} export COMINcmce=${COMINcmce:-$(compath.py $envir/$NET/${naefs_ver})} 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 COMOUT_M1=$COM_OUT/${RUN}.${PDYm1}/${cyc}/pgrb2ap5 export COMOUT_M2=$COM_OUT/${RUN}.${PDYm2}/${cyc}/pgrb2ap5 mkdir -m 775 -p $COMOUT mkdir -m 775 -p $COMOUT_M2 mkdir -m 775 -p $COMOUT_M1 msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env #################### # Execute the script #################### $HOMEgefs/scripts/exnaefs_gefs_bias.sh cat $DATA/dir_decay/$pgmout.015.avg cat $DATA/dir_decay/$pgmout.015.gfs cat $DATA/dir_decay/$pgmout.024.avg cat $DATA/dir_decay/$pgmout.024.gfs cat $DATA/dir_decay/$pgmout.180.avg cat $DATA/dir_decay/$pgmout.180.gfs cat $DATA/dir_decay/$pgmout.00.anl cat $DATA/dir_decay/$pgmout.00.mdf cat $DATA/dir_coeff/$pgmout.coeff.015.avg cat $DATA/dir_coeff/$pgmout.coeff.024.avg cat $DATA/dir_coeff/$pgmout.coeff.180.avg cat $DATA/dir_rfbias/$pgmout.rfbias.015 cat $DATA/dir_rfbias/$pgmout.rfbias.039 cat $DATA/dir_combine/$pgmout.mecom.015 cat $DATA/dir_combine/$pgmout.mecom.024 msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ######################################## # Remove the Temporary working directory ######################################## if [ $KEEPDATA != YES ]; then cd $DATAROOT rm -rf $DATA fi date