diff --git a/scripts/exglobal_fcst_nemsfv3gfs.sh b/scripts/exglobal_fcst_nemsfv3gfs.sh index 0b42e9e04..78b80f25f 100755 --- a/scripts/exglobal_fcst_nemsfv3gfs.sh +++ b/scripts/exglobal_fcst_nemsfv3gfs.sh @@ -371,7 +371,8 @@ if [ $cplwav = ".true." ]; then wavprfx=${COMPONENTwave}${WAV_MEMBER} for wavGRD in $waveGRD ; do # Link wave IC for current cycle - $NLN ${WRDIR}/${sPDY}.${scyc}0000.restart.${wavGRD} $DATA/restart.${wavGRD} + # Elimanted dependency on sPDY scyc, only required in GFS with IAU, not GEFS + $NLN ${WRDIR}/${PDY}.${cyc}0000.${COMPONENTwave}${WAV_MEMBER}.restart.${wavGRD} $DATA/restart.${wavGRD} eval $NLN $datwave/${wavprfx}.log.${wavGRD}.${PDY}${cyc} log.${wavGRD} done if [ "$WW3ICEINP" = "YES" ]; then @@ -1229,7 +1230,21 @@ if [ $SEND = "YES" ]; then done fi fi +fi +# Copy single wave restart file for GEFS +if [ $cplwav = ".true." ]; then + if [ "${COMPONENTwave}" = "gefswave" ]; then + WRDIR=$COMOUTWW3/${COMPONENTRSTwave}.${PDY}/${cyc}/restart + mkdir -p ${WRDIR} + RDATE=$($NDATE +$WAVCYCH $CDATE) + rPDY=$(echo $RDATE | cut -c1-8) + rcyc=$(echo $RDATE | cut -c9-10) + for wavGRD in $waveGRD ; do + # Copy wave IC for the next cycle + $NCP $DATA/${rPDY}.${rcyc}0000.restart.${wavGRD} ${WRDIR}/${rPDY}.${rcyc}0000.${COMPONENTwave}${WAV_MEMBER}.restart.${wavGRD} + done + fi fi #------------------------------------------------------------------ diff --git a/scripts/exwave_prep.sh b/scripts/exwave_prep.sh index a0886adac..f98e0f697 100755 --- a/scripts/exwave_prep.sh +++ b/scripts/exwave_prep.sh @@ -104,7 +104,7 @@ # Update restart time is added offset relative to model start RSTOFFSET=$(( ${RSTOFFSET} + ${RSTIOFF_WAV} )) ymdh_rst_ini=`$NDATE ${RSTOFFSET} $YMDH` - RST2OFFSET=$(( ${RSTOFFSET} + ${RST2IOFF_WAV} )) + RST2OFFSET=$(( ${DT_2_RST_WAV} + ${RST2IOFF_WAV} )) ymdh_rst2_ini=`$NDATE ${RST2OFFSET} $YMDH` # DT2 relative to first-first-cycle restart file # First restart file for cycling time_rst_ini="`echo $ymdh_rst_ini | cut -c1-8` `echo $ymdh_rst_ini | cut -c9-10`0000" diff --git a/scripts/exwave_stats.sh b/scripts/exwave_stat.sh similarity index 62% rename from scripts/exwave_stats.sh rename to scripts/exwave_stat.sh index 36a5e3001..8fc6d9af1 100755 --- a/scripts/exwave_stats.sh +++ b/scripts/exwave_stat.sh @@ -1,31 +1,36 @@ #!/bin/bash # ################################################################################ -# -# UNIX Script Documentation Block -# Script name: exwave_init.sh -# Script description: Creates model definition files for WW3 -# -# Author: Yung Chao Org: NCEP/EMC Date: 2008-02-20 -# Abstract: This script is the init config for the global multi_grid wave model. -# It creates model definition files with all configurations of spatial -# and spectral grids, as well as physics parameters and time steps. -# -# Script history log: -# 2008-02-20 Ying Chao: origination. -# 2014-01-10 J-Henrique Alves Expanded parameter list including partitions -# 2014-01-20 J-Henrique Alves Introduced wave ensemble bulletin -# 2014-01-30 J-Henrique Alves Mpiserial for parallel processing -# 2019-11-18 J-Henrique Alves Transitioning to GEFS workflow -# 2019-12-02 J-Henrique Alves Merging wave scripts to global workflow -# -# $Id$ -# -# Attributes: -# Language: Bourne-again (BASH) shell -# Machine: WCOSS-DELL-P3 -# -############################################################################### +# # +# exwave_stats.sh - Compute unified statistics for global wave ensemble # +# # +# Packs ensemble mean, spread and probabilities in grib2 format. # +# # +# Requirements: # +# - WGRIB2 with IPOLATES library # +# # +# Origination: # +# - Unreported Waves Group Developer, Feb 2008 # +# # +# Changes: # +# - expanded parameter list including partitioned data # +# (list in parameter array) (JH Alves, Jan 2014) # # # +# - introduced wave ensemble bulletin following spectral bulletin format # +# (JH Alves, Jan 2014) # +# - introduced two USH scripts for post proc # +# - wave_ens_stats.sh : generate unified stats files (mean, spread, prob) # +# - wave_ens_bull.sh : generates wave ensemble bulletin files # +# (JH Alves, Jan 2014) # +# - mpiserial for parallel processing (JH Alves, Jan 2014) # +# - Changes to wave_ens_stats (fortran) for paralellism: code now # +# computes separately stats type (mean, spread or prob) and prob # +# level (JH Alves, Jan 2014) # +# # +# Update log since 2014 # +# Nov2019 JHAlves - Transitioning to GEFS workflow # +# Dec2019 JHAlves RPadilla - Merging wave scripts to global workflow # +# # +################################################################################ # set -x #£ Use LOUD variable to turn on/off trace. Defaults to YES (on). @@ -49,28 +54,31 @@ export YMDH=${PDY}${cyc} export tcycz=t${cyc}z # - export wgrib2=$utilexec/wgrib2 +# export wgrib2=$utilexec/wgrib2 # # 0.b System-specific settings # - export grdID='glo_30m' npert=${npert:?Parameter npert required for ensemble statistics} nmembn=`expr ${npert} + 1` - export membn="00 `seq -w 1 ${nmembn}`" +# + export membn="" +for i in $(seq -f "%02g" 0 $npert); do membn="$membn $i"; done # # 0.c Time management # - export FHMAX_WAV=${FHMAX_WAV:-384} + export FHMAXWAV=${FHMAXWAV:-384} export dtgh='3' # Time interval between fields + export dtgh2='6' # Time interval between fields after 240 hrs export hcst_hour=-24 # Time range for data output # This line for when hindcast codes are available -# export trange=`expr ${FHMAX_WAV} - ${hcst_hour}` +# export trange=`expr ${FHMAXWAV} - ${hcst_hour}` # In the meantime, generate grib2 stats data only with forecasts - export trange=`expr ${FHMAX_WAV} - 0` - ngrib=`expr ${trange} / ${dtgh} + 1` +# and ngrib is calculated while the input files are copied to the wrok directory. + export trange=`expr ${FHMAXWAV} - 0` +# ngrib=`expr ${trange} / ${dtgh} + 1` # # 0.d Parameter selection and deployment of arrays @@ -90,13 +98,13 @@ # 1.a Check if buoy input files exist and copy # # When changing to cfp, verify for cfp hang noticed during Q4FY15 GEFS upgrade - buoyfile='wave_${NET}.buoys.stats' + buoyfile=wave_${NET}.buoys if [ -f $FIXwave/${buoyfile} ] ; then cp $FIXwave/${buoyfile} buoy_file.data echo " $FIXwave/${buoyfile} copied to buoy_file.data." else msg="ABNORMAL EXIT: ERR in coping ${buoyfile}." - ./postmsg "$jlogfile" "$msg" + postmsg "$jlogfile" "$msg" set +x echo ' ' echo '******************************************************* ' @@ -105,31 +113,54 @@ echo ' ' echo "$FIXwave/wave_ens_buoy.data missing." >> $ensemb_log [[ "$LOUD" = YES ]] && set -x - err=1;export err;./err_chk - exit_code=1 + echo "$FIXwave/wave_${NET}_buoy.data missing." >> $ensemb_log + msg="ABNORMAL EXIT: NO FILE $buoyfile" + postmsg "$jlogfile" "$msg" + err=1;export err;${errchk} || exit ${err} fi + # # 1.b Copy grib2 data for all members # - for me in $membn +# for ifrcst in `seq 0 $dtgh $FHMAXWAV` +# do + ngrib=0 + inc=$dtgh + ifrcst=0 + while [ $ifrcst -le $FHMAXWAV ] do - if [ -f $COMIN/${modIE}${me}.$grdID.t${cyc}z.grib2 ] ; then -# infile=$COMIN/${modIE}${me}.$grdID.t${cyc}z.grib2 - cp $COMIN/${modIE}${me}.$grdID.t${cyc}z.grib2 ./. - else - msg="ABNORMAL EXIT: ERR in coping ${modIE}$me.$grdID.t${cyc}z.grib2." - ./postmsg "$jlogfile" "$msg" - echo ' ' - echo '******************************************************* ' - echo "*** ERR : No $COMIN/${modIE}$me.$grdID.t${cyc}z.grib2 copied. *** " - echo '******************************************************* ' - echo ' ' - echo "$COMIN/${modIE}$me.$grdID.t${cyc}z.grib2 missing." >> $ensemb_log - err=2;export err;./err_chk - exit_code=2 - fi + ngrib=$(( $ngrib + 1 )) + fcsthr=$(printf "%03d" $ifrcst) + for me in $membn + do + if [ "$me" == "00" ]; then + ftype="c" + else + ftype="p" + fi + cpfile=$COMIN/${modIE}${me}.t${cyc}z.${ftype}${me}.$grdID.f${fcsthr}.grib2 + if [ -f ${cpfile} ] ; then + cp $cpfile ./. + else + msg="ABNORMAL EXIT: ERR in coping $cpfile " + postmsg "$jlogfile" "$msg" + echo ' ' + echo '******************************************************* ' + echo "*** ERR : No $cpfile copied. *** " + echo '******************************************************* ' + echo ' ' + echo "$cpfile missing." >> $ensemb_log + err=2;export err;${errchk} || exit ${err} + fi + done + if [ $ifrcst -ge 240 ] + then + inc=$dtgh2 + fi + ifrcst=$(( $ifrcst + $inc )) done + # Prepare separate data files to reduce copy load to tmp directories # # 2.a Command file set-up @@ -179,32 +210,53 @@ # mpiserial line ifile=1 - for me in $membn +# for ifrcst in `seq 0 $dtgh $FHMAXWAV` +# do + inc=$dtgh + ifrcst=0 + while [ $ifrcst -le $FHMAXWAV ] do + fcsthr=$(printf "%03d" $ifrcst) + for me in $membn + do + if [ "$me" == "00" ]; then + ftype="c" + else + ftype="p" + fi + infile=${modIE}${me}.t${cyc}z.${ftype}${me}.$grdID.f${fcsthr}.grib2 + outfile=${nnip}.t${cyc}z.${ftype}${me}.f${fcsthr}.grib2 + + wgfileout=wgrib_${nnip}_${me}.out + if [ "${npart}" = "0" ] + then + echo "$WGRIB2 -match ${nip} -match surface ${infile} -grib ${outfile} > ${wgfileout} 2>&1" >> cmdfile.${ifile} + else + echo "$WGRIB2 -match ${prepar} -match \"${paridx} in sequence\" ${infile} -grib ${outfile} > ${wgfileout} 2>&1" >> cmdfile.${ifile} + fi - infile=${modIE}${me}.$grdID.t${cyc}z.grib2 +# mpiserial if block + if [ "$ncmdfile" -gt '1' ] + then + ifile=`expr $ifile + 1` + fi + if [ "$ifile" -gt "$ncmdfile" ] + then + ifile=1 + fi + done #for members + if [ $ifrcst -ge 240 ] + then + inc=$dtgh2 + fi + ifrcst=$(( $ifrcst + $inc )) + done #for times + iparam=`expr ${iparam} + 1` + done #for parameters + # END all loops - if [ "${npart}" = "0" ] - then - echo "$wgrib2 -match ${nip} -match surface ${infile} -grib ${nnip}_${me}.t${cyc}z.grib2 > wgrib_${nnip}_${me}.out 2>&1" >> cmdfile.${ifile} - else - echo "$wgrib2 -match ${prepar} -match \"${paridx} in sequence\" ${infile} -grib ${nnip}_${me}.t${cyc}z.grib2 > wgrib_${nnip}_${me}.out 2>&1" >> cmdfile.${ifile} - fi -# mpiserial if block - if [ "$ncmdfile" -gt '1' ] - then - ifile=`expr $ifile + 1` - fi - if [ "$ifile" -gt "$ncmdfile" ] - then - ifile=1 - fi - done - - iparam=`expr ${iparam} + 1` - done # 2.c Execute poe or serial command files @@ -219,7 +271,7 @@ if [ "$ncmdfile" -gt '1' ] then # mpirun.lsf cfp cmdfile - mpirun.lsf mpiserial + mpirun cfp cmdfile exit=$? else # ./cmdfile @@ -227,7 +279,7 @@ exit=$? fi fi - +# # mpiserial section # 2.d.1 Ending times on the different processors @@ -259,48 +311,65 @@ fi # 2.d Check for errors - - iparam=1 - - for me in $membn - do - - while [ ${iparam} -le ${nparam} ] + inc=$dtgh + ifrcst=0 + while [ $ifrcst -le $FHMAXWAV ] do + fcsthr=$(printf "%03d" $ifrcst) - nnip=${arrpar[$iparam-1]} - - if [ ! -f ${nnip}_${me}.t${cyc}z.grib2 ] - then - msg="ABNORMAL EXIT: ERR in generating base grib parameter file" - ./postmsg "$jlogfile" "$msg" - set +x - echo ' ' - echo '***************************************** ' - echo "*** FATAL ERROR *** " - echo "--- No ${nnip}_${me}.t${cyc}z.grib2 file --- " - echo '***************************************** ' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - echo "No ${nnip}_${me}.t${cyc}z.grib2 " >> $wavelog - err=3;export err;./err_chk - exit_code=3 - else - set +x - echo -e "\n Base grib parameter file created succesfully.\n" - [[ "$LOUD" = YES ]] && set -x - echo -e "\n ${COMOUT}/${nnip}_${me}.t${cyc}z.grib2 \n" - rm -f wgrib_${nnip}_${me}.out - fi + iparam=1 + for me in $membn + do + if [ "$me" == "00" ]; then + ftype="c" + else + ftype="p" + fi + while [ ${iparam} -le ${nparam} ] + do + nnip=${arrpar[$iparam-1]} + + if [ ! -f ${nnip}.t${cyc}z.${ftype}${me}.f${fcsthr}.grib2 ] + then + msg="ABNORMAL EXIT: ERR in generating base grib parameter file" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '***************************************** ' + echo "*** FATAL ERROR *** " + echo "--- No ${nnip}.t${cyc}z.${ftype}${me}.f${fcsthr}.grib2 file --- " + echo '***************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "No ${nnip}_${me}.t${cyc}z.grib2 " >> $wavelog + err=3;export err;./err_chk + exit_code=3 + else + set +x + echo -e "\n Base grib parameter file created succesfully.\n" + [[ "$LOUD" = YES ]] && set -x + echo -e "\n ${COMOUT}/${nnip}_${me}.t${cyc}z.grib2 \n" + rm -f wgrib_${nnip}_${me}.out + fi + + iparam=`expr ${iparam} + 1` + + done #for iparam + done #for member number + if [ $ifrcst -ge 240 ] + then + inc=$dtgh2 + fi + ifrcst=$(( $ifrcst + $inc )) + done #for fcst time +#XXX WORKING FINE UP TO HERE - iparam=`expr ${iparam} + 1` - done - done # 2.f Clean up larger grib2 gridded files -rm -f ${modID}??.${grdID}.t${cyc}z.grib2 - +#XXX don't delet them for the moment. +#XXX rm -f ${modIE}??.t${cyc}z.???.$grdID.f???.grib2 +#XXX # # 2. Generate ensemble mean, spread and probability files # @@ -327,21 +396,28 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 # ifile=1 fhour=0 - end_hour=`expr ${ngrib} \* ${dtgh}` + +# 81 is the number of files up to 240 hrs evry 3 hours. +# after that files are every 6 hours + if [ "$ngrib" -gt 81 ] + then + diffhr=`expr $ngrib - 81` + plushr=`expr $diffhr \* 6` + end_hour=`expr 240 + $plushr` + else + end_hour=`expr ${ngrib} \* ${dtgh}` + fi while [ "$fhour" -lt "$end_hour" ] do - iparam=1 - while [ ${iparam} -le ${nparam} ] do nip=${arrpar[$iparam-1]} # Line for doing per parameter, per time stamp -# echo "$USHwave/wave_ens_stats.sh ${nip} ${ngrib} ${fhour} 1> wave_ens_stats_${nip}_${fhour}.out 2>&1" >> cmdfile -# mpiserial block - echo "$USHwave/wave_ens_stats.sh ${nip} ${ngrib} ${fhour} 1> wave_ens_stats_${nip}_${fhour}.out 2>&1" >> cmdfile.${ifile} + echo "nip ngrib fhour: ${nip}, ${ngrib}, ${fhour}" + echo "$USHwave/wave_ens_stat.sh ${nip} ${ngrib} ${fhour} 1> wave_ens_stats_${nip}_${fhour}.out 2>&1" >> cmdfile.${ifile} if [ "$ncmdfile" -gt '1' ] then @@ -355,8 +431,13 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 iparam=`expr ${iparam} + 1` done - - fhour=`expr $fhour + $dtgh` + if [ $fhour -ge 240 ] + then + inc=$dtgh2 + else + inc=$dtgh + fi + fhour=`expr $fhour + $inc` done # 2.c Execute poe or serial command files @@ -372,7 +453,7 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 if [ "$ncmdfile" -gt '1' ] then # mpirun.lsf cfp cmdfile - mpirun.lsf mpiserial + mpirun cfp cmdfile exit=$? else # ./cmdfile @@ -441,6 +522,7 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 HTSGW) snip=hs ;; PERPW) snip=tp ;; DIRPW) snip=pdir ;; + IMWF) snip=tm ;; WVHGT) snip=wshs ;; WVPER) snip=wstp ;; WVDIR) snip=wsdir ;; @@ -448,8 +530,10 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 WDIR) snip=wnddir ;; SWELL1) snip=hswell1 ;; SWELL2) snip=hswell2 ;; + SWELL3) snip=hswell3 ;; SWPER1) snip=tswell1 ;; SWPER2) snip=tswell2 ;; + SWPER3) snip=tswell3 ;; *) nnip= ;; esac @@ -486,16 +570,24 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 do ingrib=${snip}_${stype}.${hhh}.grib2 - outgrib=${COMPONENTwave}.${snip}_${stype}.t${cyc}z.grib2 + outgrib=${MDC}.${snip}_${stype}.t${cyc}z.grib2 -# echo "$wgrib2 ./${par_dir}/${valtime}/${ingrib} -append -grib ./${outgrib} >> ${snip}_${stype}.t${cyc}z.out 2>> ${snip}_${stype}.t${cyc}z.err" >> cmdfile - echo "$wgrib2 ./${par_dir}/${valtime}/${ingrib} -append -grib ./${outgrib} >> ${snip}_${stype}.t${cyc}z.out 2>> ${snip}_${stype}.t${cyc}z.err" >> cmdfile.${ifile} +# echo "$WGRIB2 ./${par_dir}/${valtime}/${ingrib} -append -grib ./${outgrib} >> ${snip}_${stype}.t${cyc}z.out 2>> ${snip}_${stype}.t${cyc}z.err" >> cmdfile + echo "$WGRIB2 ./${par_dir}/${valtime}/${ingrib} -append -grib ./${outgrib} >> ${snip}_${stype}.t${cyc}z.out 2>> ${snip}_${stype}.t${cyc}z.err" >> cmdfile.${ifile} done - fhour=`expr $fhour + $dtgh` + if [ $fhour -ge 240 ] + then + inc=$dtgh2 + else + inc=$dtgh + fi + fhour=`expr $fhour + $inc` + done + # Cleanup appended data file # echo "rm -rf ./${par_dir}/${valtime}" >> cmdfile # mpiserial block @@ -521,7 +613,7 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 if [ "$ncmdfile" -gt '1' ] then # mpirun.lsf cfp cmdfile - mpirun.lsf mpiserial + mpirun cfp cmdfile exit=$? else # ./cmdfile @@ -530,9 +622,11 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 fi # 2.e Check for errors and create bundle files - rm -f ${COMPONENTwave}.mean.t${cyc}z.grib2 - rm -f ${COMPONENTwave}.spread.t${cyc}z.grib2 - rm -f ${COMPONENTwave}.probab.t${cyc}z.grib2 + + + rm -f ${MDC}.mean.t${cyc}z.grib2 + rm -f ${MDC}.spread.t${cyc}z.grib2 + rm -f ${MDC}.probab.t${cyc}z.grib2 iparam=1 while [ ${iparam} -le ${nparam} ] @@ -543,6 +637,7 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 HTSGW) snip=hs ;; PERPW) snip=tp ;; DIRPW) snip=pdir ;; + IMWF) snip=tm ;; WVHGT) snip=wshs ;; WVPER) snip=wstp ;; WVDIR) snip=wsdir ;; @@ -550,40 +645,47 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 WDIR) snip=wnddir ;; SWELL1) snip=hswell1 ;; SWELL2) snip=hswell2 ;; + SWELL3) snip=hswell3 ;; SWPER1) snip=tswell1 ;; SWPER2) snip=tswell2 ;; + SWPER3) snip=tswell3 ;; *) nnip= ;; esac - if [ ! -f ${COMPONENTwave}.${snip}_mean.t${cyc}z.grib2 ] + ls -lt ${MDC}.${snip}_mean.t${cyc}z.grib2 + ls -lt ${MDC}.${snip}_mean.t${cyc}z.grib2 + + + + if [ ! -f ${MDC}.${snip}_mean.t${cyc}z.grib2 ] then msg="ABNORMAL EXIT: ERR in generating statistics file" - ./postmsg "$jlogfile" "$msg" + postmsg "$jlogfile" "$msg" set +x echo ' ' echo '***************************************** ' echo "*** FATAL ERROR *** " - echo "--- No ${COMPONENTwave}.${snip}_mean.t${cyc}z.grib2 file --- " + echo "--- No ${MDC}.${snip}_mean.t${cyc}z.grib2 file --- " echo '***************************************** ' echo ' ' [[ "$LOUD" = YES ]] && set -x - echo "No ${modIE}.${WAVEWND_FID}.$cycle.wind " >> $wavelog + echo "No ${modIE}.${wndID}.$cycle.wind " >> $wavelog err=4;export err;./err_chk exit_code=4 else set +x echo -e "\n Statistics files generated succesfully.\n" [[ "$LOUD" = YES ]] && set -x - echo -e "\n ${COMOUT}/${COMPONENTwave}.${snip}_mean.t${cyc}z.grib2\n" + echo -e "\n ${COMOUT}/${MDC}.${snip}_mean.t${cyc}z.grib2\n" # Large directory, cleanup is taking long time. Will leave for SPA to decide # rm -rf tmp_${nip} rm -f wave_${modID}_stats_${nip}_*.out rm -f ${snip}_*.t${cyc}z.out ${snip}_*.t${cyc}z.err # Bundle individual parameter files into a single file - cat ${COMPONENTwave}.${snip}_mean.t${cyc}z.grib2 >> ${COMPONENTwave}.mean.t${cyc}z.grib2 - cat ${COMPONENTwave}.${snip}_spread.t${cyc}z.grib2 >> ${COMPONENTwave}.spread.t${cyc}z.grib2 - cat ${COMPONENTwave}.${snip}_probab.t${cyc}z.grib2 >> ${COMPONENTwave}.probab.t${cyc}z.grib2 + cat ${MDC}.${snip}_mean.t${cyc}z.grib2 >> ${MDC}.mean.t${cyc}z.grib2 + cat ${MDC}.${snip}_spread.t${cyc}z.grib2 >> ${MDC}.spread.t${cyc}z.grib2 + cat ${MDC}.${snip}_probab.t${cyc}z.grib2 >> ${MDC}.probab.t${cyc}z.grib2 fi @@ -624,7 +726,35 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 ibuoy=1 # 3.c Create bundled grib2 file with all parameters - cat ${COMPONENTwave}.hs_*.t${cyc}z.grib2 ${COMPONENTwave}.tp_*.t${cyc}z.grib2 ${COMPONENTwave}.wnd_*.t${cyc}z.grib2 > gribfile +#XXX +ls -lt ${MDC}.hs_*.t${cyc}z.grib2 + + if [ ! -f ${MDC}.hs_*.t${cyc}z.grib2 ] + then + msg="ABNORMAL EXIT: ERR in generating statistics file" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '***************************************** ' + echo "*** FATAL ERROR *** " + echo "--- No ${MDC}.hs_*.t${cyc}z.grib2 file --- " + echo '***************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "No ${MDC}.hs_*.t${cyc}z.grib2 " >> $wavelog + err=4;export err; ./err_chk + exit_code=4 + exit 1 + else + echo "--- ${MDC}.hs_*.t${cyc}z.grib2 file exist...continue --- " + + + fi +#XXX + + + + cat ${MDC}.hs_*.t${cyc}z.grib2 ${MDC}.tp_*.t${cyc}z.grib2 ${MDC}.wnd_*.t${cyc}z.grib2 > gribfile # 3.d Loop through buoys and populate cmdfiles with calls to wave_ens_bull.sh @@ -665,7 +795,7 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 if [ "$ncmdfile" -gt '1' ] then # mpirun.lsf cfp cmdfile - mpirun.lsf mpiserial + mpirun cfp cmdfile exit=$? else # ./cmdfile @@ -719,12 +849,12 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 if [ ! -s ${modID}.${bnom}.bull ] then msg="ABNORMAL EXIT: ERR in generating bulettin file" - ./postmsg "$jlogfile" "$msg" + postmsg "$jlogfile" "$msg" set +x echo ' ' echo '***************************************** ' echo "*** FATAL ERROR *** " - echo "--- No ${COMPONENTwave}.${bnom}.bull file created --- " + echo "--- No ${MDC}.${bnom}.bull file created --- " echo '***************************************** ' echo ' ' [[ "$LOUD" = YES ]] && set -x @@ -743,10 +873,10 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 # # 4.a Compress bulletins into tar file and copy to COMOUT - tar cf ${COMPONENTwave}.t${cyc}z.bull_tar ${COMPONENTwave}.*.bull - rm -f ${COMPONENTwave}.*.bull - tar cf ${COMPONENTwave}.t${cyc}z.station_tar ${COMPONENTwave}.*.ts - rm -f ${COMPONENTwave}.*.ts + tar cf ${MDC}.t${cyc}z.bull_tar ${MDC}.*.bull + rm -f ${MDC}.*.bull + tar cf ${MDC}.t${cyc}z.station_tar ${MDC}.*.ts + rm -f ${MDC}.*.ts set +x echo ' ' @@ -754,12 +884,12 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 echo '---------------------' [[ "$LOUD" = YES ]] && set -x - if [ -f ${COMPONENTwave}.t${cyc}z.bull_tar ] + if [ -f ${MDC}.t${cyc}z.bull_tar ] then set +x - echo " Copying ${COMPONENTwave}.t${cyc}z.bull_tar to $COMOUT" + echo " Copying ${MDC}.t${cyc}z.bull_tar to $COMOUT" [[ "$LOUD" = YES ]] && set -x - cp -f ${COMPONENTwave}.t${cyc}z.bull_tar $COMOUT/. + cp -f ${MDC}.t${cyc}z.bull_tar $COMOUT/. else set +x echo ' ' @@ -775,12 +905,12 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 # 4.b Compress time series into tar file and copy to COMOUT - if [ -f ${COMPONENTwave}.t${cyc}z.station_tar ] + if [ -f ${MDC}.t${cyc}z.station_tar ] then set +x - echo " Copying ${COMPONENTwave}.t${cyc}z.bull_tar to $COMOUT" + echo " Copying ${MDC}.t${cyc}z.bull_tar to $COMOUT" [[ "$LOUD" = YES ]] && set -x - cp -f ${COMPONENTwave}.t${cyc}z.station_tar $COMOUT/. + cp -f ${MDC}.t${cyc}z.station_tar $COMOUT/. else set +x echo ' ' @@ -798,20 +928,20 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 for stype in mean spread probab do - if [ -f ${COMPONENTwave}.${stype}.t${cyc}z.grib2 ] + if [ -f ${MDC}.${stype}.t${cyc}z.grib2 ] then set +x - echo " Copying ${COMPONENTwave}.${stype}.t${cyc}z.grib2 to $COMOUT" + echo " Copying ${MDC}.${stype}.t${cyc}z.grib2 to $COMOUT" [[ "$LOUD" = YES ]] && set -x - cp -f ${COMPONENTwave}.${stype}.t${cyc}z.grib2 $COMOUT/. + cp -f ${MDC}.${stype}.t${cyc}z.grib2 $COMOUT/. else set +x echo ' ' echo '*************************************** ' - echo '*** FATAL ERROR: No ${COMPONENTwave}.${stype}.t${cyc}z.grib2 file found *' + echo '*** FATAL ERROR: No ${MDC}.${stype}.t${cyc}z.grib2 file found *' echo '*************************************** ' echo ' ' - echo "$modIE fcst $date $cycle: ${COMPONENTwave}.${stype}.t${cyc}z.grib2 not fouund." >> $wavelog + echo "$modIE fcst $date $cycle: ${MDC}.${stype}.t${cyc}z.grib2 not fouund." >> $wavelog echo $msg [[ "$LOUD" = YES ]] && set -x err=7;export err pgm;./err_chk @@ -826,6 +956,7 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 HTSGW) snip=hs ;; PERPW) snip=tp ;; DIRPW) snip=pdir ;; + IMWF) snip=tm ;; WVHGT) snip=wshs ;; WVPER) snip=wstp ;; WVDIR) snip=wsdir ;; @@ -833,8 +964,10 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 WDIR) snip=wnddir ;; SWELL1) snip=hswell1 ;; SWELL2) snip=hswell2 ;; + SWELL3) snip=hswell3 ;; SWPER1) snip=tswell1 ;; SWPER2) snip=tswell2 ;; + SWPER3) snip=tswell3 ;; *) nnip= ;; esac @@ -846,20 +979,20 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 for stype in ${stypes} do - if [ -f ${COMPONENTwave}.${snip}_${stype}.t${cyc}z.grib2 ] + if [ -f ${MDC}.${snip}_${stype}.t${cyc}z.grib2 ] then set +x - echo " Copying ${COMPONENTwave}.${snip}_${stype}.t${cyc}z.grib2 to $COMOUT" + echo " Copying ${MDC}.${snip}_${stype}.t${cyc}z.grib2 to $COMOUT" [[ "$LOUD" = YES ]] && set -x - cp -f ${COMPONENTwave}.${snip}_${stype}.t${cyc}z.grib2 $COMOUT/. + cp -f ${MDC}.${snip}_${stype}.t${cyc}z.grib2 $COMOUT/. else set +x echo ' ' echo '*************************************** ' - echo '*** FATAL ERROR: No ${COMPONENTwave}.${snip}_${stype}.t${cyc}z.grib2 file found *' + echo '*** FATAL ERROR: No ${MDC}.${snip}_${stype}.t${cyc}z.grib2 file found *' echo '*************************************** ' echo ' ' - echo "$modIE fcst $date $cycle: ${COMPONENTwave}.${snip}_${stype}.t${cyc}z.grib2 not fouund." >> $wavelog + echo "$modIE fcst $date $cycle: ${MDC}.${snip}_${stype}.t${cyc}z.grib2 not fouund." >> $wavelog echo $msg [[ "$LOUD" = YES ]] && set -x err=7;export err pgm;./err_chk @@ -873,25 +1006,25 @@ rm -f ${modID}??.${grdID}.t${cyc}z.grib2 # if [ "$SENDDBN" = 'YES' ] then - $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${COMPONENTwave}.mean.t${cyc}z.grib2 - $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${COMPONENTwave}.spread.t${cyc}z.grib2 - $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${COMPONENTwave}.probab.t${cyc}z.grib2 - $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${COMPONENTwave}.t${cyc}z.bull_tar - $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${COMPONENTwave}.t${cyc}z.station_tar + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${MDC}.mean.t${cyc}z.grib2 + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${MDC}.spread.t${cyc}z.grib2 + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${MDC}.probab.t${cyc}z.grib2 + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${MDC}.t${cyc}z.bull_tar + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/${MDC}.t${cyc}z.station_tar fi # if [ "$exit_code" -ne '0' ] then msg="ABNORMAL EXIT: Problem in GWES STATS" - ./postmsg "$jlogfile" "$msg" + postmsg "$jlogfile" "$msg" echo $msg err=$exit_code ; export err ; ./err_chk else - touch $COMOUT/${COMPONENTwave}.$cycle.statsdone + touch $COMOUT/${MDC}.$cycle.statsdone fi msg="$job completed normally" - ./postmsg "$jlogfile" "$msg" + postmsg "$jlogfile" "$msg" # echo "Ending at : `date`" # diff --git a/sorc/link_fv3gfs.sh b/sorc/link_fv3gfs.sh index a7261e0b4..7ef158b18 100755 --- a/sorc/link_fv3gfs.sh +++ b/sorc/link_fv3gfs.sh @@ -179,6 +179,12 @@ cd ${pwd}/../scripts ||exit 8 cd $pwd/../exec [[ -s global_fv3gfs.x ]] && rm -f global_fv3gfs.x $LINK ../sorc/fv3gfs.fd/NEMS/exe/global_fv3gfs.x . +if [ -d ../sorc/fv3gfs.fd/WW3/exec ]; then # Wave execs + for waveexe in ww3_gint ww3_grib ww3_grid ww3_multi ww3_ounf ww3_ounp ww3_outf ww3_outp ww3_prep ww3_prnc; do + [[ -s $waveexe ]] && rm -f $waveexe + $LINK ../sorc/fv3gfs.fd/WW3/exec/$waveexe . + done +fi [[ -s gfs_ncep_post ]] && rm -f gfs_ncep_post $LINK ../sorc/gfs_post.fd/exec/ncep_post gfs_ncep_post diff --git a/ush/wave_ens_stats.sh b/ush/wave_ens_stat.sh similarity index 100% rename from ush/wave_ens_stats.sh rename to ush/wave_ens_stat.sh