Skip to content

Commit 3952826

Browse files
mickaelaccensiFabrice Ardhuin
andauthored
remove lookup table for ST4 to speed up computation and clean up the ST4 code (NOAA-EMC#1124)
Co-authored-by: Fabrice Ardhuin <fabrice.ardhuin@ifremer.fr>
1 parent 63f8270 commit 3952826

25 files changed

+1801
-307
lines changed

manual/eqs/ST3.tex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,15 @@ \subsubsection{~$S_{in} + S_{ds}$: \wam\ cycle 4 (ECWAM)} \label{sec:ST3}
5757
waves that travel faster than the wind. This accounts for some gustiness in
5858
the wind and should possibly be resolution-dependent. For reference, this
5959
parameter was not properly set in early versions of the SWAN model, as
60-
discovered by R. Lalbeharry.}. The roughness $z_1$ is defined as,
61-
60+
discovered by R. Lalbeharry.}. If the friction velocity $u_\star$ is known,
61+
it gives the roughness $z_1$ and the wind speed at altitude $z_u$ (by default $z_u=10$~m),
6262
\begin{eqnarray}
63-
U_{10}&=&\frac{u_\star}{\kappa} \log\left(\frac{z_u}{z_1}\right) \\
64-
z_1&=&\alpha_0 \frac{\tau}{ \sqrt{1-\tau_w/\tau}},
63+
z_1&=&\alpha_0 \frac{\tau}{ \sqrt{1-\tau_w/u_\star^2}}, \\
64+
U(z_u)&=&\frac{u_\star}{\kappa} \log\left(\frac{z_u}{z_1}\right)
6565
\end{eqnarray}
6666

6767
\noindent
68-
where $\tau=u_\star^2$, and $z_u$ is the height at which the wind is
69-
specified. These two equations provide an implicit functional dependence of
68+
In practice these two equations provide an implicit functional dependence of
7069
$u_\star$ on $U_{10}$ and $\tau_w/\tau$. This relationship is then tabulated
7170
\citep{art:Jan91, rep:Bea07}.
7271

manual/eqs/ST4.tex

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ \subsubsection{~$S_{\mathrm{in}} + S_{\mathrm{ds}}$: Saturation-based dissipatio
88
This family of parameterizations uses a positive part of the wind input taken
99
from WAM cycle 4 with an ad hoc reduction of $u_\star$, implemented in
1010
order to allow a balance with a saturation-based dissipation that uses different options for
11-
a cumulative term. There are three main options for defining the saturation and the cumulative term. Chosing one or the other is done with the {\F SDSBCHOICE} parameter, with {\F SDSBCHOICE=1} for \cite{art:Aea10}, {\F SDSBCHOICE=2} for \cite{Filipot&Ardhuin2012}, and {\F SDSBCHOICE=3} for \cite{Romero2019}. That last options uses a saturation that is defined from the local spectral density, and thus gives zero dissipation for directions where the threshold is not reached, leading to much broader directional spectra. Also the stronger bimodality is achieved by having a strong modulation effect as a cumulative term.
11+
a cumulative term. There are three main options for defining the saturation and the cumulative term. Chosing one or the other is done with the {\F SDSBCHOICE} parameter, with {\F SDSBCHOICE=1} for \cite{art:Aea10}, {\F SDSBCHOICE=2} for \cite{Filipot&Ardhuin2012}, and {\F SDSBCHOICE=3} for \cite{Romero2019} and later adjustments including \cite{art:AA23}. That last option uses a saturation that is defined from the local spectral density, and thus gives zero dissipation for directions where the threshold is not reached, leading to much broader directional spectra. Also the stronger bimodality is achieved by having a strong modulation effect as a cumulative term.
1212

1313
Many other adjustments can be made by changing the namelist parameters. A few successful combinations
14-
are given by tables \ref{tab:ST4_parSIN} and \ref{tab:ST4_parSDS}, with results described by \citep{art:RA13,art:SAG16}.
14+
are given by tables \ref{tab:ST4_parSIN} and \ref{tab:ST4_parSDS}, with results described by \citep{art:RA13,art:SAG16,art:AA23}.
1515
Further calibration to any particular wind field should be done for best performance. Guidance for this is given by \cite{Stopa2018}.
1616
%We also note that the particular
1717
%set of parameters T400 corresponds to setting IPHYS=1 in the ECWAM code cycle 45R2, with a few differences
@@ -216,27 +216,15 @@ \subsubsection{~$S_{\mathrm{in}} + S_{\mathrm{ds}}$: Saturation-based dissipatio
216216
direction will typically produce less dissipation than a sea state with all
217217
the energy radiated in the same direction.
218218

219-
Based on recent analysis by \cite{Guimaraes2018} and \cite{Peureux&al.2019}, this saturation is enhanced by a factor $M_L$ that represents
220-
the effect of long waves on short waves
221-
\begin{equation}
222-
M_l(k,\theta)=1+M_\theta \sqrt{\mathrm{mss}(k,\theta)} + N_\theta \sqrt{\mathrm{nss}(k,\theta)} \label{defFACSAT}.
223-
\end{equation}
224-
where $M_\theta$ is twice the modulation transfer function for short wave steepness, with
225-
$M_\theta=8$ when following the simplified theory by \cite{art:LHS60} and using the root mean square enhancement of $B$ over a
226-
long wave cycle. $N_\theta$ is an additional straining factor due to the instability of the wave action envelope of short waves
227-
propagating in the direction close to that of the long wave \citep{Peureux&al.2019}. The squared slopes $\mathrm{mss}(k,\theta)$ is
228-
the mean square slope in direction $\theta$, wheras $\mathrm{nss}(k,\theta)$ is a slope of long waves propagating in a narrow window $\pm \delta_\theta$,
229-
around the short wave direction $\theta$.
230-
231219
We finally define our dissipation term as the sum of the saturation-based term
232220
and a cumulative breaking term $S_{\mathrm{bk,cu}}$,
233221
\begin{eqnarray}
234222
\cS_{ds}(k,\theta)& =& \sigma
235223
\frac{C_{\mathrm{ds}}^{\mathrm{sat}}}{B^2_r} \left[ \delta_d
236-
\max\left\{ M_l(k,\theta) B\left(k\right) -
224+
\max\left\{ B\left(k\right) -
237225
B_r,0\right\}^2 \right.
238226
\nonumber \\
239-
& & + \left(1-\delta_d \right) \left. \max\left\{ M_L(k,\theta) B'\left(k,\theta \right)- B_r
227+
& & + \left(1-\delta_d \right) \left. \max\left\{B'\left(k,\theta \right)- B_r
240228
,0\right\}^2\right]N(k,\theta) \nonumber \\
241229
& & + \cS_{\mathrm{bk,cu}}(k,\theta) + \cS_{\mathrm{turb}}(k,\theta) \label{Sds_all}.
242230
\end{eqnarray}

model/src/w3gdatmd.F90

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ MODULE W3GDATMD
897897
REAL, POINTER :: DCKI(:,:), SATWEIGHTS(:,:),CUMULW(:,:),QBI(:,:)
898898
REAL :: AALPHA, BBETA, ZZ0MAX, ZZ0RAT, ZZALP,&
899899
SSINTHP, TTAUWSHELTER, SSWELLF(1:7), &
900-
SSDSC(1:21), SSDSBR, &
900+
SSDSC(1:21), SSDSBR, SINTAILPAR(1:5),&
901901
SSDSP, WWNMEANP, SSTXFTF, SSTXFTWN, &
902902
FFXPM, FFXFM, FFXFA, &
903903
SSDSBRF1, SSDSBRF2, SSDSBINT,SSDSBCK,&
@@ -1317,7 +1317,7 @@ MODULE W3GDATMD
13171317
FFXFM, FFXPM, SSDSBRF1, SSDSBRF2, &
13181318
SSDSBINT, SSDSBCK, SSDSHCK, SSDSABK, &
13191319
SSDSPBK, SSINBR,SSINTHP,TTAUWSHELTER,&
1320-
SSWELLF(:), SSDSC(:), SSDSBR, &
1320+
SINTAILPAR(:), SSWELLF(:), SSDSC(:), SSDSBR, &
13211321
SSDSP, WWNMEANP, SSTXFTF, SSTXFTWN, &
13221322
SSDSBT, SSDSCOS, SSDSDTH, SSDSBM(:)
13231323
#endif
@@ -2074,12 +2074,18 @@ SUBROUTINE W3DIMS ( IMOD, MK, MTH, NDSE, NDST )
20742074
MPARS(IMOD)%SRCPS%QBI(NKHS,NKD), &
20752075
STAT=ISTAT )
20762076
CHECK_ALLOC_STATUS ( ISTAT )
2077+
MPARS(IMOD)%SRCPS%IKTAB(:,:)=0.
2078+
MPARS(IMOD)%SRCPS%DCKI(:,:)=0.
2079+
MPARS(IMOD)%SRCPS%QBI(:,:)=0.
20772080
SDSNTH = MTH/2-1 !MIN(NINT(SSDSDTH/(DTH*RADE)),MTH/2-1)
20782081
ALLOCATE( MPARS(IMOD)%SRCPS%SATINDICES(2*SDSNTH+1,MTH), &
20792082
MPARS(IMOD)%SRCPS%SATWEIGHTS(2*SDSNTH+1,MTH), &
20802083
MPARS(IMOD)%SRCPS%CUMULW(MSPEC,MSPEC), &
20812084
STAT=ISTAT )
20822085
CHECK_ALLOC_STATUS ( ISTAT )
2086+
MPARS(IMOD)%SRCPS%SATINDICES(:,:)=0.
2087+
MPARS(IMOD)%SRCPS%SATWEIGHTS(:,:)=0.
2088+
MPARS(IMOD)%SRCPS%CUMULW(:,:)=0.
20832089
#endif
20842090
!
20852091
SGRDS(IMOD)%SINIT = .TRUE.
@@ -2648,6 +2654,7 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST )
26482654
ZZ0RAT => MPARS(IMOD)%SRCPS%ZZ0RAT
26492655
ZZALP => MPARS(IMOD)%SRCPS%ZZALP
26502656
TTAUWSHELTER => MPARS(IMOD)%SRCPS%TTAUWSHELTER
2657+
SINTAILPAR => MPARS(IMOD)%SRCPS%SINTAILPAR
26512658
SSWELLFPAR => MPARS(IMOD)%SRCPS%SSWELLFPAR
26522659
SSWELLF => MPARS(IMOD)%SRCPS%SSWELLF
26532660
SSDSC => MPARS(IMOD)%SRCPS%SSDSC

model/src/w3gridmd.F90

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ MODULE W3GRIDMD
839839
#endif
840840
!
841841
#ifdef W3_ST4
842-
INTEGER :: SWELLFPAR, SDSISO, SDSBRFDF
842+
INTEGER :: SWELLFPAR, SDSISO, SDSBRFDF, SINTABLE,&
843+
TAUWBUG
843844
REAL :: SDSBCHOICE
844845
REAL :: ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP,&
845846
ZALP, Z0RAT, TAUWSHELTER, SWELLF, &
@@ -855,7 +856,8 @@ MODULE W3GRIDMD
855856
SDSBRF1, &
856857
SDSBM0, SDSBM1, SDSBM2, SDSBM3, &
857858
SDSBM4, SDSFACMTF, SDSCUMP, SDSNUW, &
858-
SDSL, SDSMWD, SDSMWPOW, SPMSS, SDSNMTF
859+
SDSL, SDSMWD, SDSMWPOW, SPMSS, SDSNMTF, SINTAIL1, SINTAIL2, &
860+
CUMSIGP, VISCSTRESS
859861
#endif
860862
!
861863
#ifdef W3_ST6
@@ -997,7 +999,7 @@ MODULE W3GRIDMD
997999
NAMELIST /SIN4/ ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP, ZALP, &
9981000
TAUWSHELTER, SWELLFPAR, SWELLF, &
9991001
SWELLF2, SWELLF3, SWELLF4, SWELLF5, SWELLF6, &
1000-
SWELLF7, Z0RAT, SINBR
1002+
SWELLF7, Z0RAT, SINBR, SINTABLE, SINTAIL1, SINTAIL2, TAUWBUG, VISCSTRESS
10011003
#endif
10021004
#ifdef W3_NL1
10031005
NAMELIST /SNL1/ LAMBDA, NLPROP, KDCONV, KDMIN, &
@@ -1039,7 +1041,7 @@ MODULE W3GRIDMD
10391041
SDSC5, SDSC6, SDSBR, SDSBT, SDSP, SDSISO, &
10401042
SDSBCK, SDSABK, SDSPBK, SDSBINT, SDSHCK, &
10411043
SDSDTH, SDSCOS, SDSBRF1, SDSBRFDF, SDSNUW, &
1042-
SDSBM0, SDSBM1, SDSBM2, SDSBM3, SDSBM4, &
1044+
SDSBM0, SDSBM1, SDSBM2, SDSBM3, SDSBM4, CUMSIGP,&
10431045
WHITECAPWIDTH, WHITECAPDUR, SDSMWD, SDSMWPOW, SDKOF
10441046
#endif
10451047

@@ -1718,6 +1720,12 @@ SUBROUTINE W3GRID()
17181720
TAUWSHELTER = 0.3
17191721
ZALP = 0.006
17201722
SINBR = 0.
1723+
SINTABLE = 1
1724+
SINTAIL1 = 0. ! TAUWSHELTER FOR TAIL (no table)
1725+
SINTAIL2 = 0. ! additional peak in capillary range
1726+
TAUWBUG = 1 ! TAUWBUG is 1 is the bug is kept:
1727+
! initializes TAUWX/Y to zero in W3SRCE
1728+
VISCSTRESS =0
17211729
#endif
17221730
!
17231731
#ifdef W3_ST6
@@ -1801,6 +1809,11 @@ SUBROUTINE W3GRID()
18011809
SSWELLF(6) = SWELLF6
18021810
SSWELLF(7) = SWELLF7
18031811
SSWELLFPAR = SWELLFPAR
1812+
SINTAILPAR(1) = FLOAT(SINTABLE)
1813+
SINTAILPAR(2) = SINTAIL1
1814+
SINTAILPAR(3) = SINTAIL2
1815+
SINTAILPAR(4) = FLOAT(TAUWBUG)
1816+
SINTAILPAR(5) = VISCSTRESS
18041817
#endif
18051818
!
18061819
#ifdef W3_ST6
@@ -2106,8 +2119,8 @@ SUBROUTINE W3GRID()
21062119
SDSDTH = 80.
21072120
SDSCOS = 2.
21082121
SDSISO = 2
2109-
SDSBM0 = 1.
2110-
SDSBM1 = 0.
2122+
SDSBM0 = 1. ! All these parameters are related to finite depth
2123+
SDSBM1 = 0. ! scaling of breaking
21112124
SDSBM2 = 0.
21122125
SDSBM3 = 0.
21132126
SDSBM4 = 0.
@@ -2117,8 +2130,9 @@ SUBROUTINE W3GRID()
21172130
SDSBINT = 0.3
21182131
SDSHCK = 1.5
21192132
WHITECAPWIDTH = 0.3
2120-
SDSSTRAIN = 0.
21212133
SDSFACMTF = 400 ! MTF factor for Lambda , Romero (2019)
2134+
CUMSIGP = 0.
2135+
SDSSTRAIN = 0.
21222136
SDSSTRAINA = 15.
21232137
SDSSTRAIN2 = 0.
21242138
WHITECAPDUR = 0.56 ! breaking duration factor
@@ -2129,7 +2143,7 @@ SUBROUTINE W3GRID()
21292143
! MTF
21302144
SPMSS = 0.5 ! cmss^SPMSS
21312145
SDSNMTF = 1.5 ! MTF power
2132-
SDSCUMP = 2.
2146+
SDSCUMP = 2. ! 2 for cumulative mss, 1 for cumulative orb. vel.
21332147
! MW
21342148
SDSMWD = .9 ! new AFo
21352149
SDSMWPOW = 1. ! (k )^pow
@@ -2211,9 +2225,9 @@ SUBROUTINE W3GRID()
22112225
SSDSC(7) = WHITECAPWIDTH
22122226
SSDSC(8) = SDSSTRAIN ! Straining constant ...
22132227
SSDSC(9) = SDSL
2214-
SSDSC(10) = SDSSTRAINA*NTH/360. ! angle Aor enhanced straining
2228+
SSDSC(10) = SDSSTRAINA*NTH/360. ! angle for enhanced straining
22152229
SSDSC(11) = SDSSTRAIN2 ! straining constant for directional part
2216-
SSDSC(12) = SDSBT
2230+
SSDSC(12) = CUMSIGP
22172231
SSDSC(13) = SDSMWD
22182232
SSDSC(14) = SPMSS
22192233
SSDSC(15) = SDSMWPOW
@@ -3197,7 +3211,7 @@ SUBROUTINE W3GRID()
31973211
#ifdef W3_ST4
31983212
WRITE (NDSO,2920) ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP, ZALP, &
31993213
TAUWSHELTER, SWELLFPAR, SWELLF, SWELLF2, SWELLF3, SWELLF4, &
3200-
SWELLF5, SWELLF6, SWELLF7, Z0RAT, SINBR
3214+
SWELLF5, SWELLF6, SWELLF7, Z0RAT, SINBR, SINTABLE, TAUWBUG, VISCSTRESS, SINTAIL1, SINTAIL2
32013215
#endif
32023216
#ifdef W3_ST6
32033217
WRITE (NDSO,2920) SINA0, SINWS, SINFC
@@ -3262,7 +3276,7 @@ SUBROUTINE W3GRID()
32623276
SDSBT, SDSP, SDSISO, SDSCOS, SDSDTH, SDSBRF1, &
32633277
SDSBRFDF, SDSBM0, SDSBM1, SDSBM2, SDSBM3, SDSBM4, &
32643278
SPMSS, SDKOF, SDSMWD, SDSFACMTF, SDSNMTF,SDSMWPOW,&
3265-
SDSCUMP, SDSNUW, WHITECAPWIDTH, WHITECAPDUR
3279+
SDSCUMP, CUMSIGP, SDSNUW, WHITECAPWIDTH, WHITECAPDUR
32663280
#endif
32673281
#ifdef W3_ST6
32683282
WRITE (NDSO,2924) SDSET, SDSA1, SDSA2, SDSP1, SDSP2
@@ -3305,7 +3319,7 @@ SUBROUTINE W3GRID()
33053319
JGS_TERMINATE_DIFFERENCE, &
33063320
JGS_TERMINATE_NORM, &
33073321
JGS_LIMITER, &
3308-
JGS_LIMITER_FUNC, &
3322+
JGS_LIMITER_FUNC, &
33093323
JGS_USE_JACOBI, &
33103324
JGS_BLOCK_GAUSS_SEIDEL, &
33113325
JGS_MAXITER, &
@@ -3642,7 +3656,7 @@ SUBROUTINE W3GRID()
36423656
END SELECT
36433657

36443658
IF (FSTOTALIMP .or. FSTOTALEXP) THEN
3645-
LPDLIB = .TRUE.
3659+
LPDLIB = .TRUE.
36463660
ENDIF
36473661
!
36483662
IF (SUM(UNSTSCHEMES).GT.1) WRITE(NDSO,1035)
@@ -6234,7 +6248,9 @@ SUBROUTINE W3GRID()
62346248
' SWELLF =',F8.5,', SWELLF2 =',F8.5, &
62356249
', SWELLF3 =',F8.5,', SWELLF4 =',F9.1,','/ &
62366250
' SWELLF5 =',F8.5,', SWELLF6 =',F8.5, &
6237-
', SWELLF7 =',F12.2,', Z0RAT =',F8.5,', SINBR =',F8.5,' /')
6251+
', SWELLF7 =',F12.2,', Z0RAT =',F8.5,', SINBR =',F8.5,','/ &
6252+
' SINTABLE =',I2,', TAUWBUG =',I2, &
6253+
', VISCSTRESS =',F8.5,', SINTAIL1 =',F8.5,', SINTAIL2 =',F8.5,' /')
62386254
#endif
62396255
!
62406256
#ifdef W3_ST6
@@ -6407,7 +6423,7 @@ SUBROUTINE W3GRID()
64076423
' SPMSS = ',F5.2, ', SDKOF =',F5.2, &
64086424
', SDSMWD =',F5.2,', SDSFACMTF =',F5.1,', '/ &
64096425
' SDSMWPOW =',F3.1,', SDSNMTF =', F5.2, &
6410-
', SDSCUMP =', F3.1,', SDSNUW =', E8.3,', '/, &
6426+
', SDSCUMP =', F3.1,', CUMSIGP =', F3.1,', SDSNUW =', E10.3,', '/, &
64116427
' WHITECAPWIDTH =',F5.2, ' WHITECAPDUR =',F5.2,' /')
64126428
#endif
64136429
!
@@ -6519,20 +6535,20 @@ SUBROUTINE W3GRID()
65196535
947 FORMAT (/' Ice scattering ',A,/ &
65206536
' --------------------------------------------------')
65216537
948 FORMAT (' IS2 Scattering ... '/&
6522-
' scattering coefficient : ',E9.3/ &
6523-
' 0: no back-scattering : ',E9.3/ &
6538+
' scattering coefficient : ',E10.3/ &
6539+
' 0: no back-scattering : ',E10.3/ &
65246540
' TRUE: istropic back-scattering : ',L3/ &
65256541
' TRUE: update of ICEDMAX : ',L3/ &
65266542
' TRUE: keeps updated ICEDMAX : ',L3/ &
6527-
' flexural strength : ',E9.3/ &
6543+
' flexural strength : ',E10.3/ &
65286544
' TRUE: uses Robinson-Palmer disp.: ',L3/ &
65296545
' attenuation : ',F5.2/ &
65306546
' fragility : ',F5.2/ &
65316547
' minimum floe size in meters : ',F5.2/ &
65326548
' pack scattering coef 1 : ',F5.2/ &
65336549
' pack scattering coef 2 : ',F5.2/ &
65346550
' scaling by concentration : ',F5.2/ &
6535-
' creep B coefficient : ',E9.3/ &
6551+
' creep B coefficient : ',E10.3/ &
65366552
' creep C coefficient : ',F5.2/ &
65376553
' creep D coefficient : ',F5.2/ &
65386554
' creep N power : ',F5.2/ &
@@ -6543,7 +6559,7 @@ SUBROUTINE W3GRID()
65436559
' energy of activation : ',F5.2/ &
65446560
' anelastic coefficient : ',E11.3/ &
65456561
' anelastic exponent : ',F5.2)
6546-
2948 FORMAT ( ' &SIS2 ISC1 =',E9.3,', IS2BACKSCAT =',E9.3, &
6562+
2948 FORMAT ( ' &SIS2 ISC1 =',E10.3,', IS2BACKSCAT =',E10.3, &
65476563
', IS2ISOSCAT =',L3,', IS2BREAK =',L3, &
65486564
', IS2DUPDATE =',L3,','/ &
65496565
' IS2FLEXSTR =',E11.3,', IS2DISP =',L3, &

0 commit comments

Comments
 (0)