Skip to content

Commit

Permalink
add output parameters for skewness (NOAA-EMC#1209)
Browse files Browse the repository at this point in the history
Co-authored-by: Fabrice Ardhuin <[email protected]>
  • Loading branch information
mickaelaccensi and Fabrice Ardhuin authored Apr 4, 2024
1 parent d8b82c9 commit 8b5e91f
Show file tree
Hide file tree
Showing 19 changed files with 800 additions and 22 deletions.
4 changes: 4 additions & 0 deletions manual/eqs/output.tex
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ \subsection{~Output parameters} \label{sub:outpars}
\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}
\item \textbf{SKW} Skewness of surface elevation sampled at zero slope. This is the $\lambda_1$ parameter defined in \cite{Barrick&Lipa1985} or $\lambda_{3,0,0}$ in \cite{Srokosz1986}. It is computed from the second order correction to the surface elevation, using ECWAM code by P. Janssen.
\item \textbf{EMB} this is $-\gamma/8 = -(\lambda_{1,2,0}+\lambda_{1,0,2}-2 \lambda{0,1,1} \lambda{1,1,1})/8 (1-\lambda_{0,1,1]^2)$, such that the mean sea level of points with zero slope
is EMB$\times H_s$.
\item \textbf{EMC} this is hte additional tracker bias coefficient equal to $-\lambda_{3,0,0}/24$, which is specific to the choice of retracker, see the $J_z$ function in \cite{DeCarlo&Ardhuin2024}.
\end{list}
\item{Numerical diagnostics }
Expand Down
10 changes: 10 additions & 0 deletions manual/manual.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3760,3 +3760,13 @@ @PHDTHESIS{Gagnaire-Renou2009
year = 2010,
}

@ARTICLE{Srokosz1986,
author = "Meric A. Srokosz",
title = "On the joint distribution of surface elevation and slopes for a non linear random sea, with an application to radar altimetry",
journal = JGR,
volume = 91,
pages = "995--1006",
year = 1986,
keywords={altimeter;sea state bias},
}

2 changes: 1 addition & 1 deletion model/inp/ww3_ounf.inp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ DPT CUR WND AST WLV ICE IBG TAU RHO D50 IC1 IC5 HS LM T02 T0M1 T01 FP
$ DIR SPR DP HIG 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 SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC ABR UBR BED
$ FBB TBB MSS MSC DTD FC CFX CFD CFK U1 U2 WNM TOC
$ FBB TBB MSS MSC DTD FC CFX CFD CFK U1 U2 WNM TOC MSS QP QKK SKW EMB EMC
$
N
DPT HS FP T01
Expand Down
11 changes: 7 additions & 4 deletions model/inp/ww3_shel.inp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,13 @@ $ 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 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
$ 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
$ F F 8 7 SKEW SKW Skewness of elevation for zero slopes
$ F F 8 8 EMBIA1 EMB Mean sea level at zero slopes / Hs
$ F F 8 9 EMBIA2 EMC Tracker bias for LRM least square altimetry
$ -------------------------------------------------
$ 9 Numerical diagnostics
$ -------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion model/nml/ww3_ounf.nml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS
! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC TOC
! ABR UBR BED FBB TBB
! MSS MSC WL02 AXT AYT AXY
! MSS MSC MSD MCD QP QKK SKW EMB EMC
! DTD FC CFX CFD CFK
! U1 U2
!
Expand Down
3 changes: 3 additions & 0 deletions model/nml/ww3_shel.nml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@
! 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
! F F 8 7 SKEW SKW Skewness of elevation for zero slopes
! F F 8 8 EMBIA1 EMB Mean sea level at zero slopes / Hs
! F F 8 9 EMBIA2 EMC Tracker bias for LRM least square altimetry
! -------------------------------------------------
! 9 Numerical diagnostics
! -------------------------------------------------
Expand Down
42 changes: 38 additions & 4 deletions model/src/w3adatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ MODULE W3ADATMD
! 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)
! SKEW R.A. Public skewness lambda_3,0,0 (Srokosz 1986)
!
! DTDYN R.A. Public Mean dynamic time step (raw).
! FCUT R.A. Public Cut-off frequency for tail.
Expand Down Expand Up @@ -475,9 +476,10 @@ MODULE W3ADATMD
! Output fields group 8)
!
REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), &
MSCX(:), MSCY(:), MSCD(:), QKK(:)
MSCX(:), MSCY(:), MSCD(:), QKK(:), SKEW(:), EMBIA1(:), EMBIA2(:)
REAL, POINTER :: XMSSX(:), XMSSY(:), XMSSD(:), &
XMSCX(:), XMSCY(:), XMSCD(:), XQKK(:)
XMSCX(:), XMSCY(:), XMSCD(:), XQKK(:), &
XSKEW(:), XEMBIA1(:), XEMBIA2(:)
!
! Output fields group 9)
!
Expand Down Expand Up @@ -613,7 +615,7 @@ MODULE W3ADATMD
BEDFORMS(:,:), PHIBBL(:), TAUBBL(:,:)
!
REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), &
MSCX(:), MSCY(:), MSCD(:), QKK(:)
MSCX(:), MSCY(:), MSCD(:), QKK(:), SKEW(:), EMBIA1(:), EMBIA2(:)
!
REAL, POINTER :: DTDYN(:), FCUT(:), CFLXYMAX(:), &
CFLTHMAX(:), CFLKMAX(:)
Expand Down Expand Up @@ -1265,7 +1267,9 @@ 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), &
WADATS(IMOD)%QKK(NSEALM), STAT=ISTAT )
WADATS(IMOD)%QKK(NSEALM), WADATS(IMOD)%SKEW(NSEALM), &
WADATS(IMOD)%EMBIA1(NSEALM), WADATS(IMOD)%EMBIA2(NSEALM), &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
!
WADATS(IMOD)%MSSX = UNDEF
Expand All @@ -1275,6 +1279,9 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
WADATS(IMOD)%MSCY = UNDEF
WADATS(IMOD)%MSCD = UNDEF
WADATS(IMOD)%QKK = UNDEF
WADATS(IMOD)%SKEW = UNDEF
WADATS(IMOD)%EMBIA1 = UNDEF
WADATS(IMOD)%EMBIA2 = UNDEF
call print_memcheck(memunit, 'memcheck_____:'//' W3DIMA 8')
!
! 9) Numerical diagnostics
Expand Down Expand Up @@ -2281,6 +2288,24 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
ALLOCATE ( WADATS(IMOD)%XQKK(1) )
END IF
!
IF ( OUTFLAGS( 8, 7) ) THEN
ALLOCATE ( WADATS(IMOD)%XSKEW(NXXX) )
ELSE
ALLOCATE ( WADATS(IMOD)%XSKEW(1) )
END IF
!
IF ( OUTFLAGS( 8, 8) ) THEN
ALLOCATE ( WADATS(IMOD)%XEMBIA1(NXXX) )
ELSE
ALLOCATE ( WADATS(IMOD)%XEMBIA1(1) )
END IF
!
IF ( OUTFLAGS( 8, 9) ) THEN
ALLOCATE ( WADATS(IMOD)%XEMBIA2(NXXX) )
ELSE
ALLOCATE ( WADATS(IMOD)%XEMBIA2(1) )
END IF
!
WADATS(IMOD)%XMSSX = UNDEF
WADATS(IMOD)%XMSSY = UNDEF
WADATS(IMOD)%XMSSD = UNDEF
Expand All @@ -2289,6 +2314,9 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
WADATS(IMOD)%XMSCD = UNDEF
WADATS(IMOD)%XQP(1) = UNDEF
WADATS(IMOD)%XQKK = UNDEF
WADATS(IMOD)%XSKEW = UNDEF
WADATS(IMOD)%XEMBIA1 = UNDEF
WADATS(IMOD)%XEMBIA2 = UNDEF
!
IF ( OUTFLAGS( 9, 1) ) THEN
ALLOCATE ( WADATS(IMOD)%XDTDYN(NXXX), STAT=ISTAT )
Expand Down Expand Up @@ -2903,6 +2931,9 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST )
MSCY => WADATS(IMOD)%MSCY
MSCD => WADATS(IMOD)%MSCD
QKK => WADATS(IMOD)%QKK
SKEW => WADATS(IMOD)%SKEW
EMBIA1 => WADATS(IMOD)%EMBIA1
EMBIA2 => WADATS(IMOD)%EMBIA2
!
DTDYN => WADATS(IMOD)%DTDYN
FCUT => WADATS(IMOD)%FCUT
Expand Down Expand Up @@ -3242,6 +3273,9 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST )
MSCY => WADATS(IMOD)%XMSCY
MSCD => WADATS(IMOD)%XMSCD
QKK => WADATS(IMOD)%XQKK
SKEW => WADATS(IMOD)%XSKEW
EMBIA1 => WADATS(IMOD)%XEMBIA1
EMBIA2 => WADATS(IMOD)%XEMBIA2
!
DTDYN => WADATS(IMOD)%XDTDYN
FCUT => WADATS(IMOD)%XFCUT
Expand Down
86 changes: 85 additions & 1 deletion model/src/w3initmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,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, QKK
TAUOCX, TAUOCY, WNMEAN, QKK, SKEW, EMBIA1, EMBIA2
#endif

#ifdef W3_MPI
Expand Down Expand Up @@ -3406,6 +3406,48 @@ SUBROUTINE W3MPIO ( IMOD )
#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( 8, 7) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_SEND_INIT (SKEW (1),NSEALM , MPI_REAL, IROOT, &
IT, MPI_COMM_WAVE, IRQGO(IH), IERR)
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/07', IROOT, IT, IRQGO(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
!
#ifdef W3_MPI
IF ( FLGRDALL( 8, 8) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_SEND_INIT (EMBIA1 (1),NSEALM , MPI_REAL, IROOT, &
IT, MPI_COMM_WAVE, IRQGO(IH), IERR)
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/08', IROOT, IT, IRQGO(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
!
#ifdef W3_MPI
IF ( FLGRDALL( 8, 9) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_SEND_INIT (EMBIA2 (1),NSEALM , MPI_REAL, IROOT, &
IT, MPI_COMM_WAVE, IRQGO(IH), IERR)
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/09', IROOT, IT, IRQGO(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
Expand Down Expand Up @@ -4653,6 +4695,48 @@ SUBROUTINE W3MPIO ( IMOD )
#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( 8, 7) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_RECV_INIT (SKEW (I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR )
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/07', IFROM, IT, IRQGO2(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
!
#ifdef W3_MPI
IF ( FLGRDALL( 8, 8) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_RECV_INIT (EMBIA1 (I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR )
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/08', IFROM, IT, IRQGO2(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
!
#ifdef W3_MPI
IF ( FLGRDALL( 8, 9) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_RECV_INIT (EMBIA2 (I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR )
#endif
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 8/09', IFROM, IT, IRQGO2(IH), IERR
#endif
#ifdef W3_MPI
END IF
#endif
Expand Down
Loading

0 comments on commit 8b5e91f

Please sign in to comment.