Skip to content

Commit

Permalink
Merge pull request #84 from NOAA-EMC/feature/gfsv16b_herawavepost
Browse files Browse the repository at this point in the history
Adapting wavepostsbs for running on Hera
  • Loading branch information
KateFriedman-NOAA committed Jun 15, 2020
2 parents 22b735d + 295cd05 commit a2bd621
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 58 deletions.
1 change: 1 addition & 0 deletions scripts/exwave_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Script history log:
# 2019-05-06 J-Henrique Alves First Version.
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported to R&D machine Hera
#
# $Id$
#
Expand Down
164 changes: 110 additions & 54 deletions scripts/exwave_post_sbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# wave_tar.sh : tars the spectral and bulletin multiple files
#
# Script history log:
# 2019-12-06 J-Henrique Alves First Version adapted from HTolman post.sh 2007
# 2019-12-06 J-Henrique Alves: First Version adapted from HTolman post.sh 2007
# 2020-06-10 J-Henrique Alves: Porting to R&D machine Hera
#
# $Id$
#
Expand Down Expand Up @@ -516,49 +517,7 @@
export GRDIDATA=${DATA}/output_$YMDHMS
ln -fs $DATA/mod_def.${waveuoutpGRD} mod_def.ww3

if [ $fhr = $fhrp ]
then
iwait=0
pfile=$COMIN/rundata/${WAV_MOD_TAG}.out_pnt.${waveuoutpGRD}.${YMD}.${HMS}
while [ ! -s ${pfile} ]; do sleep 10; ((iwait++)) && ((iwait==$iwaitmax)) && break ; echo $iwait; done
if [ $iwait -eq $iwaitmax ]; then
echo " FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD
echo ' '
[[ "$LOUD" = YES ]] && set -x
postmsg "$jlogfile" "FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD
err=6; export err;${errchk}
exit $err
fi
ln -fs ${pfile} ./out_pnt.${waveuoutpGRD}

if [ "$DOSPC_WAV" = 'YES' ]
then
export dtspec=3600.
for buoy in $buoys
do
echo "$USHwave/wave_outp_spec.sh $buoy $ymdh spec > spec_$buoy.out 2>&1" >> ${fcmdnow}
done
fi

if [ "$DOIBP_WAV" = 'YES' ]
then
export dtspec=3600.
for buoy in $ibpoints
do
echo "$USHwave/wave_outp_spec.sh $buoy $ymdh ibp > ibp_$buoy.out 2>&1" >> ${fcmdnow}
done
fi

if [ "$DOBLL_WAV" = 'YES' ]
then
export dtspec=3600.
for buoy in $buoys
do
echo "$USHwave/wave_outp_spec.sh $buoy $ymdh bull > bull_$buoy.out 2>&1" >> ${fcmdnow}
done
fi

fi
# Gridded data (main part, need to be run side-by-side with forecast

if [ $fhr = $fhrg ]
then
Expand Down Expand Up @@ -588,17 +547,18 @@
glo_15mxt) ymdh_int=`$NDATE -${WAVHINDH} $ymdh`; dt_int=3600.; n_int=9999 ;;
glo_30mxt) ymdh_int=`$NDATE -${WAVHINDH} $ymdh`; dt_int=3600.; n_int=9999 ;;
esac
echo "$USHwave/wave_grid_interp_sbs.sh $grdID $ymdh_int $dt_int $n_int > grint_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
echo "$USHwave/wave_grid_interp_sbs.sh $grdID $ymdh_int $dt_int $n_int > grint_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
if [ "$DOGRB_WAV" = 'YES' ]
then
gribFL=\'`echo ${OUTPARS_WAV}`\'
case $grdID in
glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
glo_30mxt) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=11 ;;
esac
echo "$USHwave/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
echo "$USHwave/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd}
fi
echo "${fcmdigrd}.${nigrd}" >> ${fcmdnow}
echo "pwd" >> ${fcmdnow}
echo "${GRIBDATA}/${fcmdigrd}.${nigrd}" >> ${fcmdnow}
chmod 744 ${fcmdigrd}.${nigrd}
nigrd=$((nigrd+1))
done
Expand All @@ -620,12 +580,84 @@
so_20m) GRDNAME='antarc' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;;
glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;;
esac
echo "$USHwave/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdnow}
echo "$USHwave/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdnow}
done
fi

fi

# Point output part (can be split or become meta-task to reduce resource usage)
if [ $fhr = $fhrp ]
then
iwait=0
pfile=$COMIN/rundata/${WAV_MOD_TAG}.out_pnt.${waveuoutpGRD}.${YMD}.${HMS}
while [ ! -s ${pfile} ]; do sleep 10; ((iwait++)) && ((iwait==$iwaitmax)) && break ; echo $iwait; done
if [ $iwait -eq $iwaitmax ]; then
echo " FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD
echo ' '
[[ "$LOUD" = YES ]] && set -x
postmsg "$jlogfile" "FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD
err=6; export err;${errchk}
exit $err
fi
ln -fs ${pfile} ./out_pnt.${waveuoutpGRD}

if [ "$DOSPC_WAV" = 'YES' ]
then
export dtspec=3600.
for buoy in $buoys
do
echo "$USHwave/wave_outp_spec.sh $buoy $ymdh spec > spec_$buoy.out 2>&1" >> ${fcmdnow}
done
fi

if [ "$DOIBP_WAV" = 'YES' ]
then
export dtspec=3600.
for buoy in $ibpoints
do
echo "$USHwave/wave_outp_spec.sh $buoy $ymdh ibp > ibp_$buoy.out 2>&1" >> ${fcmdnow}
done
fi

if [ "$DOBLL_WAV" = 'YES' ]
then
export dtspec=3600.
for buoy in $buoys
do
echo "$USHwave/wave_outp_spec.sh $buoy $ymdh bull > bull_$buoy.out 2>&1" >> ${fcmdnow}
done
fi

fi

if [ ${CFP_MP:-"NO"} = "YES" ]; then
nfile=0
ifile=0
iline=1
ifirst='yes'
nlines=$( wc -l ${fcmdnow} | awk '{print $1}' )
while [ $iline -le $nlines ]; do
line=$( sed -n ''$iline'p' ${fcmdnow} )
if [ -z "$line" ]; then
break
else
if [ "$ifirst" = 'yes' ]; then
echo "#!/bin/sh" > cmdmfile.$nfile
echo "$nfile cmdmfile.$nfile" >> cmdmprog
chmod 744 cmdmfile.$nfile
fi
echo $line >> cmdmfile.$nfile
nfile=$(( nfile + 1 ))
if [ $nfile -eq $NTASKS ]; then
nfile=0
ifirst='no'
fi
iline=$(( iline + 1 ))
fi
done
fi

wavenproc=`wc -l ${fcmdnow} | awk '{print $1}'`
wavenproc=`echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS}))`

Expand All @@ -638,7 +670,11 @@

if [ "$wavenproc" -gt '1' ]
then
${wavempexec} ${wavenproc} ${wave_mpmd} ${fcmdnow}
if [ ${CFP_MP:-"NO"} = "YES" ]; then
${wavempexec} -n ${wavenproc} ${wave_mpmd} cmdmprog
else
${wavempexec} ${wavenproc} ${wave_mpmd} ${fcmdnow}
fi
exit=$?
else
chmod 744 ${fcmdnow}
Expand Down Expand Up @@ -700,15 +736,31 @@

# 6.b Spectral data files

if [ ${CFP_MP:-"NO"} = "YES" ]; then nm=0; fi

if [ "$DOIBP_WAV" = 'YES' ]
then
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG ibp $Nibp > ${WAV_MOD_TAG}_ibp_tar.out 2>&1 " >> cmdtarfile
if [ ${CFP_MP:-"NO"} = "YES" ]; then
echo "$nm $USHwave/wave_tar.sh $WAV_MOD_TAG ibp $Nibp > ${WAV_MOD_TAG}_ibp_tar.out 2>&1 " >> cmdtarfile
nm=$(( nm + 1 ))
else
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG ibp $Nibp > ${WAV_MOD_TAG}_ibp_tar.out 2>&1 " >> cmdtarfile
fi
fi
if [ "$DOSPC_WAV" = 'YES' ]
then
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG spec $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG bull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG cbull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
if [ ${CFP_MP:-"NO"} = "YES" ]; then
echo "$nm $USHwave/wave_tar.sh $WAV_MOD_TAG spec $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
nm=$(( nm + 1 ))
echo "$nm $USHwave/wave_tar.sh $WAV_MOD_TAG bull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
nm=$(( nm + 1 ))
echo "$nm $USHwave/wave_tar.sh $WAV_MOD_TAG cbull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
nm=$(( nm + 1 ))
else
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG spec $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG bull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
echo "$USHwave/wave_tar.sh $WAV_MOD_TAG cbull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile
fi
fi

wavenproc=`wc -l cmdtarfile | awk '{print $1}'`
Expand All @@ -723,7 +775,11 @@

if [ "$wavenproc" -gt '1' ]
then
${wavempexec} ${wavenproc} ${wave_mpmd} cmdtarfile
if [ ${CFP_MP:-"NO"} = "YES" ]; then
${wavempexec} -n ${wavenproc} ${wave_mpmd} cmdtarfile
else
${wavempexec} ${wavenproc} ${wave_mpmd} cmdtarfile
fi
exit=$?
else
chmod 744 cmdtarfile
Expand Down
1 change: 1 addition & 0 deletions scripts/exwave_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
# Nov2012 JHAlves - Transitioning to WCOSS #
# Apr2019 JHAlves - Transitioning to GEFS workflow #
# Nov2019 JHAlves - Merging wave scripts to global workflow #
# Jun2020 JHAlves - Porting to R&D machine Hera #
# #
# WAV_MOD_ID and WAV_MOD_TAG replace modID. WAV_MOD_TAG #
# is used for ensemble-specific I/O. For deterministic #
Expand Down
1 change: 1 addition & 0 deletions ush/wave_grib2_sbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# Script history log:
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported to R&D machine Hera
#
# $Id$
#
Expand Down
1 change: 1 addition & 0 deletions ush/wave_grid_interp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# Script history log:
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported to R&D machine Hera
#
# $Id$
###############################################################################
Expand Down
1 change: 1 addition & 0 deletions ush/wave_grid_interp_sbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# Script history log:
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported to R&D machine Hera
#
# $Id$
#
Expand Down
3 changes: 2 additions & 1 deletion ush/wave_grid_moddef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# Script history log:
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported to R&D machine Hera
#
# $Id$
# #
Expand Down Expand Up @@ -126,7 +127,7 @@
# 3. Clean up

cd ..
#rm -rf moddef_$grdID
rm -rf moddef_$grdID

set +x
echo ' '
Expand Down
5 changes: 3 additions & 2 deletions ush/wave_outp_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# Script history log:
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported to R&D machine Hera
#
# $Id$
#
Expand Down Expand Up @@ -245,8 +246,8 @@

# 3.b Clean up the rest

# rm -f ww3_outp.inp
# rm -f mod_def.ww3 out_pnt.ww3
rm -f ww3_outp.inp
rm -f mod_def.ww3 out_pnt.ww3

cd ..
rm -rf ${specdir}_${bloc}
Expand Down
3 changes: 3 additions & 0 deletions ush/wave_prnc_cur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Abstract: Creates current binary data for forcing WW3
#
# Script history log:
# 2019-10-02 J-Henrique Alves: origination, first version
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# 2020-06-10 J-Henrique Alves Ported R&D machine Hera
#
# $Id$
#
Expand Down
1 change: 1 addition & 0 deletions ush/wave_prnc_ice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Update record : #
# #
# - Origination: Hendrik Tolman 01-Mar-2007 #
# 2019-11-02 J-Henrique Alves Ported to global-workflow.
# #
# Update log #
# Nov2019 JHAlves - Merging wave scripts to global workflow #
Expand Down
3 changes: 2 additions & 1 deletion ush/wave_tar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Origination: Hendrik Tolman March 13, 2007 #
# Update log #
# Nov2019 JHAlves - Merging wave scripts to global workflow #
# 2020-06-10 J-Henrique Alves Ported R&D machine Hera
# #
###############################################################################
#
Expand Down Expand Up @@ -220,7 +221,7 @@
cd $DATA

set +x; [[ "$LOUD" = YES ]] && set -v
rm -f ${STA_DIR}/${type}
rm -rf ${STA_DIR}/${type}
set +v

echo ' '
Expand Down

0 comments on commit a2bd621

Please sign in to comment.