#!/bin/bash ###### 08/15/2007 ################################################################# # Calculate CMC, GEFS & NAEFS Ensemble Probability Forecast, Ensemble Mean & Spread ################################################################################### #################################################### # 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=naefs export RUN=naefs export PS4='${PMI_FORK_RANK}: $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}" export pgmerr=errfile ############################################## # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDECF - Flag Events on SMS ############################################## export SENDCOM=${SENDCOM:-YES} export SENDECF=${SENDECF:-YES} export SENDDBN=${SENDDBN:-YES} ############################################################### # IFNAEFS - Generate Products from NCEP/CMC Combined Ensemble # IFGEFS - Generate Products from NCEP Ensemble # IFCMCE - Generate Products from CMC Ensemble ############################################################### export IFNAEFS=YES export IFGEFS=NO export IFCMCE=NO ################################################################### # IFENSBC1D - Judge if Generate 1 Degree Bias Corrected Forecasts ################################################################### export IFENSBC1D=YES ######################### # Specify Execution Areas ######################### export HOMEnaefs=${HOMEnaefs:-$PACKAGEROOT/naefs.${naefs_ver}} export EXECnaefs=${EXECnaefs:-$HOMEnaefs/exec} export FIXnaefs=${FIXnaefs:-$HOMEnaefs/fix} export USHnaefs=${USHnaefs:-$HOMEnaefs/ush} ######################################### # Run setpdy and initialize PDY variables ######################################### setpdy.sh . ./PDY ######################## # Define COM directories ######################## export DCOM=${DCOM:-${DCOMROOT}} export COMINCMC=${COMINCMC:-$DCOM/$PDY/wgrbbul/cmcensbc_gb2} export COM_NCEP=${COM_NCEP:-$(compath.py $envir/$NET/${naefs_ver})} export COMINNCEP=$COM_NCEP/gefs.${PDY}/${cyc}/pgrb2ap5_bc export COM_FENS=${COM_FENS:-$(compath.py $envir/$NET/${naefs_ver})} export COMINFENS=$COM_FENS/fens.${PDY}/${cyc}/pgrb2ap5_bc export COM_NCEPANL=${COM_NCEPANL:-$(compath.py $envir/$NET/${naefs_ver})} export COM_CMCANL=${COM_CMCANL:-$(compath.py $envir/$NET/${naefs_ver})} export COM_FENSANL=${COM_FENSANL:-$(compath.py $envir/$NET/${naefs_ver})} export COM_OUT=${COM_OUT:-$(compath.py -o $NET/${naefs_ver})} export COMOUTNAEFS_p5=${COM_OUT}/${RUN}.${PDY}/${cyc}/pgrb2ap5_bc export COMOUTNAEFSAN_p5=${COM_OUT}/${RUN}.${PDY}/${cyc}/pgrb2ap5_an export COMOUTNAEFS=${COM_OUT}/${RUN}.${PDY}/${cyc}/pgrb2a_bc export COMOUTNAEFSAN=${COM_OUT}/${RUN}.${PDY}/${cyc}/pgrb2a_an mkdir -m 775 -p ${COMOUTNAEFS_p5} mkdir -m 775 -p ${COMOUTNAEFSAN_p5} if [ "$IFENSBC1D" = "YES" ]; then mkdir -m 775 -p ${COMOUTNAEFS} mkdir -m 775 -p ${COMOUTNAEFSAN} fi msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" env cd $DATA ############################## # Execute the script using poe ############################## runscript=$HOMEnaefs/scripts/exnaefs_prob_avgspr.sh hourlist=" 003 006 009 012 015 018 021 024 027 030 033 036 039 042 045 048 \ 051 054 057 060 063 066 069 072 075 078 081 084 087 090 093 096 099 \ 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 \ 153 156 159 162 165 168 171 174 177 180 183 186 189 192 198 204 \ 210 216 222 228 234 240 246 252 258 264 270 276 282 288 294 300 \ 306 312 318 324 330 336 342 348 354 360 366 372 378 384" if [ -s $DATA/poescript_naefs ]; then rm $DATA/poescript_naefs fi for nfhrs in $hourlist; do mkdir -p $DATA/group.$nfhrs echo "$runscript \"$nfhrs\" $DATA/group.$nfhrs " >>$DATA/poescript_naefs done chmod +x $DATA/poescript_naefs startmsg $APRUN $DATA/poescript_naefs export err=$?; err_chk wait cat $DATA/group.024/$pgmout.024_prob cat $DATA/group.024/$pgmout.024.avg_an cat $DATA/group.024/$pgmout.024.avg_anf cat $DATA/group.024/$pgmout.024.avg_anfefi cat $DATA/group.360/$pgmout.360_prob cat $DATA/group.360/$pgmout.360.avg_an cat $DATA/group.360/$pgmout.360.avg_anf cat $DATA/group.360/$pgmout.360.avg_anfefi msg="JOB COMPLETED NORMALLY" postmsg "$jlogfile" "$msg" ######################################## # Remove the Temporary working directory ######################################## if [ $KEEPDATA != YES ]; then cd $DATAROOT rm -rf $DATA fi date