WAVEWATCH III  beta 0.0.1
w3swldmd Module Reference

Source term module for swell dissipation. More...

Functions/Subroutines

subroutine, public w3swl4 (A, CG, WN, DAIR, S, D)
 FIXME. More...
 
subroutine, public w3swl6 (A, CG, WN, S, D)
 Turbulent dissipation of narrow-banded swell. More...
 

Detailed Description

Source term module for swell dissipation.

Source term for swell dissipation based on different physics that can be independently selected from the input and whitecapping dissipation terms in the model setup.

Author
H. L. Tolman
Date
21-Nov-2011

Function/Subroutine Documentation

◆ w3swl4()

subroutine, public w3swldmd::w3swl4 ( real, dimension(nspec), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nk), intent(in)  WN,
real, intent(in)  DAIR,
real, dimension(nspec), intent(out)  S,
real, dimension(nspec), intent(out)  D 
)

FIXME.

A, S, D all stored as 1-D arrays with dimension NTH*NK (column by column).

Parameters
[in]AAction density spectrum.
[in]CGGroup velocities.
[in]WNWavenumbers.
[in]DAIRAir density.
[out]SSource term.
[out]DDiagonal term of the derivative.
Author
H. L. Tolman
Date
13-Aug-2021

Definition at line 94 of file w3swldmd.F90.

94  !/
95  !/ +-----------------------------------+
96  !/ | WAVEWATCH III NOAA/NCEP |
97  !/ | H. L. Tolman |
98  !/ | FORTRAN 90 |
99  !/ | Last update : 13-Aug-2021 |
100  !/ +-----------------------------------+
101  !/
102  !/ 29-May-2009 : Origination (w3srcxmd.ftn) ( version 3.14 )
103  !/ 06-Jan-2012 : Implementation (S. Zieger)
104  !/ 13-Aug-2021 : Consider DAIR a variable ( version x.xx )
105  !/
106  ! 1. Purpose :
107  !
108  ! FIXME
109  !
110  ! 2. Method :
111  !
112  ! 3. Parameters :
113  !
114  ! Parameter list
115  ! ----------------------------------------------------------------
116  ! A¹ R.A. I Action density spectrum
117  ! CG R.A. I Group velocities
118  ! WN R.A. I Wavenumbers
119  ! DAIR R.A. I Air density
120  ! S¹ R.A. O Source term
121  ! D¹ R.A. O Diagonal term of derivative
122  ! ¹ Stored as 1-D array with dimension NTH*NK (column by column).
123  ! ----------------------------------------------------------------
124  !
125  ! 4. Subroutines used :
126  !
127  ! Name Type Module Description
128  ! ----------------------------------------------------------------
129  ! IRANGE Func. W3SWLDMD
130  ! STRACE Subr. W3SERVMD Subroutine tracing.
131  ! ----------------------------------------------------------------
132  !
133  ! 5. Called by :
134  !
135  ! Name Type Module Description
136  ! ----------------------------------------------------------------
137  ! W3SRCE Subr. W3SRCEMD Source term integration.
138  ! W3EXPO Subr. N/A Point output post-processor.
139  ! GXEXPO Subr. N/A GrADS point output post-processor.
140  ! ----------------------------------------------------------------
141  !
142  ! 6. Error messages :
143  !
144  ! None.
145  !
146  ! 7. Remarks :
147  !
148  ! 8. Structure :
149  !
150  ! See comments in source code.
151  !
152  ! 9. Switches :
153  !
154  ! !/S Enable subroutine tracing.
155  !
156  ! 10. Source code :
157  !
158  !/ ------------------------------------------------------------------- /
159  USE constants, ONLY: grav, dwat
160  USE w3gdatmd, ONLY: nk, nth, nspec, sig2, dden, fte, swl6b1
161 #ifdef W3_S
162  USE w3servmd, ONLY: strace
163 #endif
164  !/
165  IMPLICIT NONE
166  !/
167  !/ ------------------------------------------------------------------- /
168  !/ Parameter list
169  REAL, INTENT(IN) :: A(NSPEC), CG(NK), WN(NK), DAIR
170  REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC)
171  !/
172  !/ ------------------------------------------------------------------- /
173  !/ Local parameters
174 #ifdef W3_S
175  INTEGER, SAVE :: IENT = 0
176 #endif
177  INTEGER :: IKN(NK), ITH
178  REAL, PARAMETER :: VA = 1.4e-5 ! Air kinematic viscosity (used in WAM).
179  REAL :: EB(NK), WN2(NSPEC), EMEAN
180  REAL :: FE, AORB, RE, RECRIT, UOSIG, CDSV
181  !/
182  !/ ------------------------------------------------------------------- /
183  !/
184 #ifdef W3_S
185  CALL strace (ient, 'W3SWL4')
186 #endif
187  !
188  ikn = irange(1,nspec,nth)
189  d = 0.
190  wn2 = 0.
191  !
192  DO ith = 1, nth
193  wn2(ikn+(ith-1)) = wn ! Wavenumbers to all directions.
194  END DO
195  !
196  eb = sum(reshape(a,(/ nth,nk /)),1) * dden(1:nk) / cg
197  emean = sum(eb) + (eb(nk) / dden(nk)) * fte
198  !
199  aorb = 2.0*sqrt(emean)
200  !
201  eb = sum(reshape(a*sig2**2,(/ nth,nk /)),1) * dden(1:nk) / cg
202  uosig = 2.0*sqrt(sum(eb))
203 
204  fe = swl6b1 ! (from NAMELIST)
205  ! FE = 0.001 ! (from NAMELIST)
206  !/ 0.001 - 0.019 with median value 0.007 (Ardhuin et al 2009, Babanin 2011)
207  cdsv = 1.2
208  !
209  recrit = 1.0e5
210  re = 4.0 * uosig * aorb / va
211  !
212  IF (re .GT. recrit) THEN
213  d = -(16.0/grav) * (dair/dwat) * fe * (sig2**2) *uosig
214  ELSE
215  d = -2.0 * (dair/dwat) * cdsv * wn2 * sqrt(2.0 * va * sig2)
216  END IF
217  !
218  s = d * a
219  !
220  ! WRITE(*,*) ' FE =',FE
221  ! WRITE(*,*) ' HS =',4.*SQRT(EMEAN)
222  ! WRITE(*,*) ' UOSIG =',UOSIG
223  ! WRITE(*,*) ' AORB =',AORB
224  ! WRITE(*,*) ' RE/RECRIT=',RE/RECRIT
225  ! WRITE(*,*) ' SWL4_tot =',SUM(SUM(RESHAPE(S,(/ NTH,NK /)),1)*DDEN/CG)
226  !/
227  !/ End of W3SWL4 ----------------------------------------------------- /
228  !/

References w3gdatmd::dden, constants::dwat, w3gdatmd::fte, constants::grav, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::sig2, w3servmd::strace(), and w3gdatmd::swl6b1.

◆ w3swl6()

subroutine, public w3swldmd::w3swl6 ( real, dimension(nspec), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nk), intent(in)  WN,
real, dimension(nspec), intent(out)  S,
real, dimension(nspec), intent(out)  D 
)

Turbulent dissipation of narrow-banded swell.

A, S, D all stored as 1-D arrays with dimension NTH*NK (column by column).

Described in Babanin (2011, Section 7.5). Babanin 2011: Cambridge Press, 295-321, 463pp.

S = D * A

Parameters
[in]AAction density spectrum.
[in]CGGroup velocities.
[in]WNWavenumbers.
[out]SSource term.
[out]DDiagonal term of the derivative.
Author
H. L. Tolman
Date
16-Feb-2012

Definition at line 252 of file w3swldmd.F90.

252  !/
253  !/ +-----------------------------------+
254  !/ | WAVEWATCH III NOAA/NCEP |
255  !/ | H. L. Tolman |
256  !/ | FORTRAN 90 |
257  !/ | Last update : 16-Feb-2012 |
258  !/ +-----------------------------------+
259  !/
260  !/ 29-May-2009 : Origination (w3srcxmd.ftn) ( version 3.14 )
261  !/ 16-Feb-2012 : Implementation ( version 4.07 )
262  !/ (S. Zieger)
263  !/
264  ! 1. Purpose :
265  !
266  ! Turbulent dissipation of narrow-banded swell as described in
267  ! Babanin (2011, Section 7.5).
268  !
269  ! Babanin 2011: Cambridge Press, 295-321, 463pp.
270  !
271  ! 2. Method :
272  !
273  ! S = D * A
274  !
275  ! 3. Parameters :
276  !
277  ! Parameter list
278  ! ----------------------------------------------------------------
279  ! A¹ R.A. I Action density spectrum
280  ! CG R.A. I Group velocities
281  ! WN R.A. I Wavenumbers
282  ! S¹ R.A. O Source term
283  ! D¹ R.A. O Diagonal term of derivative
284  ! ¹ Stored as 1-D array with dimension NTH*NK (column by column).
285  ! ----------------------------------------------------------------
286  !
287  ! 4. Subroutines used :
288  !
289  ! Name Type Module Description
290  ! ----------------------------------------------------------------
291  ! IRANGE Func. W3SWLDMD
292  ! STRACE Subr. W3SERVMD Subroutine tracing.
293  ! ----------------------------------------------------------------
294  !
295  ! 5. Called by :
296  !
297  ! Name Type Module Description
298  ! ----------------------------------------------------------------
299  ! W3SRCE Subr. W3SRCEMD Source term integration.
300  ! W3EXPO Subr. N/A Point output post-processor.
301  ! GXEXPO Subr. N/A GrADS point output post-processor.
302  ! ----------------------------------------------------------------
303  !
304  ! 6. Error messages :
305  !
306  ! None.
307  !
308  ! 7. Remarks :
309  !
310  ! 8. Structure :
311  !
312  ! See comments in source code.
313  !
314  ! 9. Switches :
315  !
316  ! !/S Enable subroutine tracing.
317  !
318  ! 10. Source code :
319  !
320  !/ ------------------------------------------------------------------- /
321  USE constants, ONLY: grav
322  USE w3gdatmd, ONLY: nk, nth, nspec, sig, dden, dth
323  USE w3gdatmd, ONLY: swl6cstb1, swl6b1, fte, ftwn
324 #ifdef W3_T6
325  USE w3odatmd, ONLY: ndst
326 #endif
327 #ifdef W3_S
328  USE w3servmd, ONLY: strace
329 #endif
330  !/
331  IMPLICIT NONE
332  !/
333  !/ ------------------------------------------------------------------- /
334  !/ Parameter list
335  REAL, INTENT(IN) :: A(NSPEC), CG(NK), WN(NK)
336  REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC)
337  !/
338  !/ ------------------------------------------------------------------- /
339  !/ Local parameters
340 #ifdef W3_S
341  INTEGER, SAVE :: IENT = 0
342 #endif
343  INTEGER :: IK, ITH, IKN(NK)
344  REAL, DIMENSION(NK) :: ABAND, KMAX, ANAR, BN, AORB, DDIS
345  REAL :: K(NTH,NK), B1
346  !/
347  !/ ------------------------------------------------------------------- /
348  !/
349 #ifdef W3_S
350  CALL strace (ient, 'W3SWL6')
351 #endif
352  !
353  !/ 0) --- Initialize parameters -------------------------------------- /
354  ikn = irange(1,nspec,nth) ! Index vector for array access, e.g.
355  ! ! in form of WN(1:NK) == WN2(IKN).
356  aband = sum(reshape(a,(/ nth,nk /)),1) ! action density as function of wavenumber
357  ddis = 0.
358  d = 0.
359  b1 = swl6b1 ! empirical constant from NAMELIST
360  !
361  !/ 1) --- Choose calculation of steepness a*k ------------------------ /
362  !/ Replace the measure of steepness with the spectral
363  ! saturation after Banner et al. (2002) ---------------------- /
364  k = reshape(a,(/ nth,nk /))
365  kmax = maxval(k,1)
366  DO ik = 1,nk
367  IF (kmax(ik).LT.1.0e-34) THEN
368  k(1:nth,ik) = 1.
369  ELSE
370  k(1:nth,ik) = k(1:nth,ik)/kmax(ik)
371  END IF
372  END DO
373  anar = 1.0/( sum(k,1) * dth )
374  bn = anar * ( aband * sig(1:nk) * dth ) * wn**3
375  !
376  IF (.NOT.swl6cstb1) THEN
377  !
378  !/ --- A constant value for B1 attenuates swell too strong in the
379  !/ western central Pacific (i.e. cross swell less than 1.0m).
380  !/ Workaround is to scale B1 with steepness a*kp, where kp is
381  !/ the peak wavenumber. SWL6B1 remains a scaling constant, but
382  !/ with different magnitude. --------------------------------- /
383  ik = maxloc(aband,1) ! Index for peak
384  ! EMEAN = SUM(ABAND * DDEN / CG) ! Total sea surface variance
385  b1 = swl6b1 * ( 2. * sqrt(sum(aband*dden/cg)) * wn(ik) )
386  !
387  END IF
388  !
389  !/ 2) --- Calculate the derivative term only (in units of 1/s) ------- /
390  DO ik = 1,nk
391  IF (aband(ik) .GT. 1.e-30) THEN
392  ddis(ik) = -(2./3.) * b1 * sig(ik) * sqrt(bn(ik))
393  END IF
394  END DO
395  !
396  !/ 3) --- Apply dissipation term of derivative to all directions ----- /
397  DO ith = 1, nth
398  d(ikn+(ith-1)) = ddis
399  END DO
400  !
401  s = d * a
402  !
403  ! WRITE(*,*) ' B1 =',B1
404  ! WRITE(*,*) ' DDIS_tot =',SUM(DDIS*ABAND*DDEN/CG)
405  ! WRITE(*,*) ' EDENS_tot=',sum(aband*dden/cg)
406  ! WRITE(*,*) ' EDENS_tot=',sum(aband*sig*dth*dsii/cg)
407  ! WRITE(*,*) ' '
408  ! WRITE(*,*) ' SWL6_tot =',sum(SUM(RESHAPE(S,(/ NTH,NK /)),1)*DDEN/CG)
409  !
410  !/
411  !/ End of W3SWL6 ----------------------------------------------------- /
412  !/

References w3gdatmd::dden, w3gdatmd::dth, w3gdatmd::fte, w3gdatmd::ftwn, constants::grav, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::sig, w3servmd::strace(), w3gdatmd::swl6b1, and w3gdatmd::swl6cstb1.

Referenced by gxexpo(), w3exnc(), w3expo(), and w3srcemd::w3srce().

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::dth
real, pointer dth
Definition: w3gdatmd.F90:1232
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3gdatmd::swl6cstb1
logical, pointer swl6cstb1
Definition: w3gdatmd.F90:1338
w3wdatmd::va
real, dimension(:,:), pointer va
Definition: w3wdatmd.F90:183
w3servmd
Definition: w3servmd.F90:3
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
constants::dwat
real, parameter dwat
DWAT Density of water (kg/m3).
Definition: constants.F90:62
w3gdatmd::swl6b1
real, pointer swl6b1
Definition: w3gdatmd.F90:1335
w3gdatmd::sig2
real, dimension(:), pointer sig2
Definition: w3gdatmd.F90:1234
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3gdatmd::fte
real, pointer fte
Definition: w3gdatmd.F90:1232
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
w3gdatmd
Definition: w3gdatmd.F90:16
w3gdatmd::ftwn
real, pointer ftwn
Definition: w3gdatmd.F90:1232
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61