Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QP #1050

Merged
merged 5 commits into from
Sep 14, 2023
Merged

QP #1050

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions manual/eqs/output.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ \subsection{~Output parameters} \label{sub:outpars}
in \para\ref{sec:ww3shel}. That input file also provides a list of flags
indicating if output parameters are available in different field
output file types (ASCII, grib, igrads, NetCDF).
For any details on how these parameters are computed, the user may read the code of the {\code w3iogo} routine, in the {\code w3iogomd.ftn} module.
For any details on how these parameters are computed, the user may read the code of the {\code w3iogo} routine, in the {\code w3iogomd.F90} module.

Selection of field outputs in {\code ww3\_shel.inp} is most easily performed by providing a list of the
Selection of field outputs in {\code ww3\_shel.nml} or {\code ww3\_shel.inp} is most easily performed by providing a list of the
requested parameters, for example, {\textbf HS DIR SPR} will request the calculation of significant wave height, mean direction and directional spread. These will thus be stored in the {\code out\_grd.XX} file and can be post-processed, for example in NetCDF using {\code ww3\_ouf}. Examples are given in \para\ref{sec:ww3multi} and
\para\ref{sec:ww3ounf}. The names for these namelists are the bold names below, for
example \textbf{HS}.
Expand All @@ -26,6 +26,9 @@ \subsection{~Output parameters} \label{sub:outpars}
file extensions, NetCDF variable names and namelist-based selection (see
also \para\ref{sec:ww3ounf}), and the long parameter name/definition.

When the result is not overly sensitive to the contribution of the unresolved part of the spectrum (for $f<f_{NK}$), the contribution of the tail is parameterized assuming a power law decay of the spectrum, by default $E(f,\theta) = E(f_{NK},\theta) (f_{NK}/f)^{-5}$, for some parameters this is either unnecessary or misleading, and the integrals are computed only up to $f_{NK}$.


Finally we note that in all definitions the frequency is the \emph{relative} frequency. Thus, in the presence of currents, these can only be compared to drifting measurement data or data obtained in wavenumber and converted to frequency. Comparison to fixed instrument data requires the use of the full spectrum and proper conversion to the fixed reference frame.

\begin{list}{\Roman{outgrps})\hfill}
Expand Down Expand Up @@ -300,8 +303,12 @@ \subsection{~Output parameters} \label{sub:outpars}
\item \textbf{MSD} Direction of the maximum slope variance mss$_u$
\item \textbf{MCD} Spectral tail direction
\item \textbf{QP} Peakedness parameter \citep{art:G70}
\begin{equation} Q_p = \frac{2}{E^2} \int_0^{2\pi} \int_0^\infty
\sigma\:F(\sigma,\theta)^2\:d\sigma\:d\theta \: \label{eq:qp}
\begin{equation} Q_p = \frac{2}{E^2} \int_0^{f_{NK}} f \left( \int_0^{2\pi}
F(f,\theta) \:\rd \theta \right)^2 \: \rd f \: \label{eq:qp}
\end{equation}
\item \textbf{QKK} wavenumber peakedness \citep{art:DC23}
\begin{equation} Q_{kk} = \frac{1}{E^2} \int_0^{f_{NK}} \int_0^{2\pi}
0.5 \left[ A(k,\theta)+ A(k,\theta+\pi)\right]^2 \frac{\sigma^2}{k C_g} \:\rd \theta \: \rd \sigma \: \label{eq:qkk}
\end{equation}
\end{list}

Expand Down
10 changes: 10 additions & 0 deletions manual/manual.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3654,3 +3654,13 @@ @article{vanVledder2006
volume = {53},
year = {2006}
}

@article{art:DC23,
author = {De Carlo, Marine and Fabrice Ardhuin and Annabelle Ollivier and Adrien Nigou },
journal = {Journal of Geophysical Research - Oceans},
keywords = {wave groups,altimetry},
pages = {},
title = {Wave groups and small scale variability of wave heights observed by altimeters},
volume = {},
year = {2023}
}
9 changes: 5 additions & 4 deletions model/inp/ww3_shel.inp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ $ T T 2 15 HMAXD SDMH St Dev of MXC (STE)
$ T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE)
$ F T 2 17 WBT WBT Dominant wave breaking probability bT
$ F F 2 18 FP0 TP Peak period (from peak freq)
$ F F 2 19 WNMEAN WNM Mean wavenumber
$ -------------------------------------------------
$ 3 Spectral Parameters (first 5)
$ -------------------------------------------------
Expand Down Expand Up @@ -211,10 +212,10 @@ $ 8 Spectrum parameters
$ -------------------------------------------------
$ F F 8 1 MSS[X,Y] MSS Mean square slopes
$ F F 8 2 MSC[X,Y] MSC Spectral level at high frequency tail
$ F F 8 3 WL02[X,Y] WL02 East/X North/Y mean wavelength compon
$ F F 8 4 ALPXT AXT Correl sea surface gradients (x,t)
$ F F 8 5 ALPYT AYT Correl sea surface gradients (y,t)
$ F F 8 6 ALPXY AXY Correl sea surface gradients (x,y)
! F F 8 3 MSSD MSD Slope direction
! F F 8 4 MSCD MCD Tail slope direction
! F F 8 5 QP QP Goda peakedness parameter
! F F 8 6 QKK QKK Wavenumber peakedness
$ -------------------------------------------------
$ 9 Numerical diagnostics
$ -------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions model/nml/ww3_multi.nml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@
!
! * the detailed list of field names is given in model/nml/ww3_shel.nml :
! DPT CUR WND AST WLV ICE IBG TAU RHO D50 IC1 IC5
! HS LM T02 T0M1 T01 FP DIR SPR DP HIG
! HS LM T02 T0M1 T01 FP DIR SPR DP HIG MXE MXES MXH MXHC SDMH SDMHC WBT TP WNM
! EF TH1M STH1M TH2M STH2M WN
! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR
! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS
! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC USP TOC
! ABR UBR BED FBB TBB
! MSS MSC WL02 AXT AYT AXY
! MSS MSC MSD MCD QP QKK
! DTD FC CFX CFD CFK
! U1 U2
!
Expand Down
9 changes: 5 additions & 4 deletions model/nml/ww3_shel.nml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE)
! F T 2 17 WBT WBT Dominant wave breaking probability bT
! F F 2 18 FP0 TP Peak period (from peak freq)
! F F 2 19 WNMEAN WNM Mean wavenumber
! -------------------------------------------------
! 3 Spectral Parameters (first 5)
! -------------------------------------------------
Expand Down Expand Up @@ -201,10 +202,10 @@
! -------------------------------------------------
! F F 8 1 MSS[X,Y] MSS Mean square slopes
! F F 8 2 MSC[X,Y] MSC Spectral level at high frequency tail
! F F 8 3 WL02[X,Y] WL02 East/X North/Y mean wavelength compon
! F F 8 4 ALPXT AXT Correl sea surface gradients (x,t)
! F F 8 5 ALPYT AYT Correl sea surface gradients (y,t)
! F F 8 6 ALPXY AXY Correl sea surface gradients (x,y)
! F F 8 3 MSSD MSD Slope direction
! F F 8 4 MSCD MCD Tail slope direction
! F F 8 5 QP QP Goda peakedness parameter
! F F 8 6 QKK QKK Wavenumber peakedness
! -------------------------------------------------
! 9 Numerical diagnostics
! -------------------------------------------------
Expand Down
19 changes: 15 additions & 4 deletions model/src/w3adatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ MODULE W3ADATMD
! MSSD R.A. Public Direction of MSSX
! MSCD R.A. Public Direction of MSCX
! QP R.A. Public Goda peakedness parameter.
! QKK R.A. Public Spectral bandwidth (De Carlo et al. 2023)
!
! DTDYN R.A. Public Mean dynamic time step (raw).
! FCUT R.A. Public Cut-off frequency for tail.
Expand Down Expand Up @@ -474,9 +475,9 @@ MODULE W3ADATMD
! Output fields group 8)
!
REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), &
MSCX(:), MSCY(:), MSCD(:)
MSCX(:), MSCY(:), MSCD(:), QKK(:)
REAL, POINTER :: XMSSX(:), XMSSY(:), XMSSD(:), &
XMSCX(:), XMSCY(:), XMSCD(:)
XMSCX(:), XMSCY(:), XMSCD(:), XQKK(:)
!
! Output fields group 9)
!
Expand Down Expand Up @@ -612,7 +613,7 @@ MODULE W3ADATMD
BEDFORMS(:,:), PHIBBL(:), TAUBBL(:,:)
!
REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), &
MSCX(:), MSCY(:), MSCD(:)
MSCX(:), MSCY(:), MSCD(:), QKK(:)
!
REAL, POINTER :: DTDYN(:), FCUT(:), CFLXYMAX(:), &
CFLTHMAX(:), CFLKMAX(:)
Expand Down Expand Up @@ -1264,7 +1265,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
ALLOCATE ( WADATS(IMOD)%MSSX(NSEALM), WADATS(IMOD)%MSSY(NSEALM), &
WADATS(IMOD)%MSCX(NSEALM), WADATS(IMOD)%MSCY(NSEALM), &
WADATS(IMOD)%MSSD(NSEALM), WADATS(IMOD)%MSCD(NSEALM), &
STAT=ISTAT )
WADATS(IMOD)%QKK(NSEALM), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
!
WADATS(IMOD)%MSSX = UNDEF
Expand All @@ -1273,6 +1274,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
WADATS(IMOD)%MSCX = UNDEF
WADATS(IMOD)%MSCY = UNDEF
WADATS(IMOD)%MSCD = UNDEF
WADATS(IMOD)%QKK = UNDEF
call print_memcheck(memunit, 'memcheck_____:'//' W3DIMA 8')
!
! 9) Numerical diagnostics
Expand Down Expand Up @@ -2273,13 +2275,20 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
ALLOCATE ( WADATS(IMOD)%XQP(1) )
END IF
!
IF ( OUTFLAGS( 8, 6) ) THEN
ALLOCATE ( WADATS(IMOD)%XQKK(NXXX) )
ELSE
ALLOCATE ( WADATS(IMOD)%XQKK(1) )
END IF
!
WADATS(IMOD)%XMSSX = UNDEF
WADATS(IMOD)%XMSSY = UNDEF
WADATS(IMOD)%XMSSD = UNDEF
WADATS(IMOD)%XMSCX = UNDEF
WADATS(IMOD)%XMSCY = UNDEF
WADATS(IMOD)%XMSCD = UNDEF
WADATS(IMOD)%XQP(1) = UNDEF
WADATS(IMOD)%XQKK = UNDEF
!
IF ( OUTFLAGS( 9, 1) ) THEN
ALLOCATE ( WADATS(IMOD)%XDTDYN(NXXX), STAT=ISTAT )
Expand Down Expand Up @@ -2893,6 +2902,7 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST )
MSCX => WADATS(IMOD)%MSCX
MSCY => WADATS(IMOD)%MSCY
MSCD => WADATS(IMOD)%MSCD
QKK => WADATS(IMOD)%QKK
!
DTDYN => WADATS(IMOD)%DTDYN
FCUT => WADATS(IMOD)%FCUT
Expand Down Expand Up @@ -3231,6 +3241,7 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST )
MSCX => WADATS(IMOD)%XMSCX
MSCY => WADATS(IMOD)%XMSCY
MSCD => WADATS(IMOD)%XMSCD
QKK => WADATS(IMOD)%XQKK
!
DTDYN => WADATS(IMOD)%XDTDYN
FCUT => WADATS(IMOD)%XFCUT
Expand Down
52 changes: 40 additions & 12 deletions model/src/w3initmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -639,23 +639,23 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD,
IF (FSTOTALIMP .and. .NOT. LPDLIB) THEN
WRITE(NDSE,*) 'IMPTOTAL is selected'
WRITE(NDSE,*) 'But PDLIB is not'
CALL FLUSH(NDSE)
STOP
CALL FLUSH(NDSE)
STOP
ELSE IF (FSTOTALEXP .and. .NOT. LPDLIB) THEN
WRITE(NDSE,*) 'EXPTOTAL is selected'
WRITE(NDSE,*) 'But PDLIB is not'
CALL FLUSH(NDSE)
STOP
CALL FLUSH(NDSE)
STOP
END IF
#ifdef W3_PDLIB
IF (B_JGS_BLOCK_GAUSS_SEIDEL .AND. .NOT. B_JGS_USE_JACOBI) THEN
WRITE(NDSE,*) 'B_JGS_BLOCK_GAUSS_SEIDEL is used but the Jacobi solver is not choosen'
WRITE(NDSE,*) 'Please set JGS_USE_JACOBI .eqv. .true.'
CALL FLUSH(NDSE)
STOP
CALL FLUSH(NDSE)
STOP
ENDIF
#endif

!
! 1.c Open files without unpacking MDS ,,,
!
Expand Down Expand Up @@ -1303,10 +1303,10 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD,
END DO
!Li END DO
#ifdef W3_DEBUGSTP
WRITE(740+IAPROC,*) 'w3initmd 1: max/min(WLVeff)=', max_val, min_val
FLUSH(740+IAPROC)
max_val = 0
min_val = 0
WRITE(740+IAPROC,*) 'w3initmd 1: max/min(WLVeff)=', max_val, min_val
FLUSH(740+IAPROC)
max_val = 0
min_val = 0
#endif
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
Expand Down Expand Up @@ -2147,7 +2147,7 @@ SUBROUTINE W3MPIO ( IMOD )
STMAXE, STMAXD, HMAXE, HCMAXE, HMAXD, &
HCMAXD, QP, PTHP0, PQP, PPE, PGW, PSW, &
PTM1, PT1, PT2, PEP, WBT, CX, CY, &
TAUOCX, TAUOCY, WNMEAN
TAUOCX, TAUOCY, WNMEAN, QKK
#endif

#ifdef W3_MPI
Expand Down Expand Up @@ -3394,6 +3394,20 @@ SUBROUTINE W3MPIO ( IMOD )
#ifdef W3_MPI
END IF
!
IF ( FLGRDALL( 8, 6) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_SEND_INIT (QKK (1),NSEALM , MPI_REAL, IROOT, &
IT, MPI_COMM_WAVE, IRQGO(IH), IERR)
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/06', IROOT, IT, IRQGO(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
!
#ifdef W3_MPI
IF ( FLGRDALL( 9, 1) ) THEN
IH = IH + 1
IT = IT + 1
Expand Down Expand Up @@ -4627,6 +4641,20 @@ SUBROUTINE W3MPIO ( IMOD )
#ifdef W3_MPI
END IF
!
IF ( FLGRDALL( 8, 6) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_RECV_INIT (QKK (I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR )
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/06', IFROM, IT, IRQGO2(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
!
#ifdef W3_MPI
IF ( FLGRDALL( 9, 1) ) THEN
IH = IH + 1
IT = IT + 1
Expand Down
Loading