WAVEWATCH III  beta 0.0.1
w3sbt4md Module Reference

SHOWEX bottom friction source term (Ardhuin et al. More...

Functions/Subroutines

subroutine insbt4
 Initialization for bottom friction source term routine. More...
 
subroutine tabu_erf
 Tabulation of ERF function, which is used in bottom friction subgrid modeling. More...
 
subroutine w3sbt4 (A, CG, WN, DEPTH, D50, PSIC, TAUBBL, BEDFORM, S, D, IX, IY)
 Computes the SHOWEX bottom friction with movable bed effects. More...
 

Variables

integer, parameter sizeerftable =300
 
real, dimension(0:sizeerftableerftable
 
real delxerf
 
real, parameter xerfmax = 4.
 

Detailed Description

SHOWEX bottom friction source term (Ardhuin et al.

2003).

Using a subgrid depth parameterization based on Tolman (CE 1995).

Author
F. Ardhuin
J. Lepesqueur
Date
14-Mar-2012

Function/Subroutine Documentation

◆ insbt4()

subroutine w3sbt4md::insbt4

Initialization for bottom friction source term routine.

Author
F. Ardhuin
Date
14-Mar-2012

Definition at line 146 of file w3sbt4md.F90.

146  !/
147  !/ +-----------------------------------+
148  !/ | WAVEWATCH III NOAA/NCEP |
149  !/ | SHOM |
150  !/ | F. Ardhuin |
151  !/ | FORTRAN 90 |
152  !/ | Last update : 14-Mar-2012 |
153  !/ +-----------------------------------+
154  !/
155  !/ 14-Mar-2012 : Origination. ( version 4.05 )
156  !
157  ! 1. Purpose :
158  !
159  ! Initialization for bottom friction source term routine.
160  !
161  ! 2. Method :
162  !
163  ! 3. Parameters :
164  !
165  ! Parameter list
166  ! ----------------------------------------------------------------
167  ! ----------------------------------------------------------------
168  !
169  ! 4. Subroutines used :
170  !
171  ! Name Type Module Description
172  ! ----------------------------------------------------------------
173  ! STRACE Subr. W3SERVMD Subroutine tracing.
174  ! ----------------------------------------------------------------
175  !
176  ! 5. Called by :
177  !
178  ! Name Type Module Description
179  ! ----------------------------------------------------------------
180  ! W3SBT4 Subr. W3SRC3MD Corresponding source term.
181  ! ----------------------------------------------------------------
182  !
183  ! 6. Error messages :
184  !
185  ! None.
186  !
187  ! 7. Remarks :
188  !
189  ! 8. Structure :
190  !
191  ! See source code.
192  !
193  ! 9. Switches :
194  !
195  ! !/S Enable subroutine tracing.
196  !
197  ! 10. Source code :
198  !
199  !/ ------------------------------------------------------------------- /
200  !
201 #ifdef W3_S
202  USE w3servmd, ONLY: strace
203 #endif
204  !/
205  IMPLICIT NONE
206  !/
207  !/ ------------------------------------------------------------------- /
208  !/ Parameter list
209  !/
210  ! NONE
211  !/
212  !/ ------------------------------------------------------------------- /
213  !/ Local parameters
214  !/
215 #ifdef W3_S
216  INTEGER, SAVE :: IENT = 0
217 #endif
218  !/
219  !/ ------------------------------------------------------------------- /
220  !/
221 #ifdef W3_S
222  CALL strace (ient, 'INSIN3')
223 #endif
224  !
225  ! 1. .... ----------------------------------------------------------- *
226  !
227  CALL tabu_erf !tabulates ERF function
228  !/
229  !/ End of INSBT4 ----------------------------------------------------- /
230  !/

References w3servmd::strace(), and tabu_erf().

Referenced by w3sbt4().

◆ tabu_erf()

subroutine w3sbt4md::tabu_erf

Tabulation of ERF function, which is used in bottom friction subgrid modeling.

Initialization for source term routine.

Author
J. Lepesqueur
Date
14-Mar-2012

Definition at line 243 of file w3sbt4md.F90.

243  !/
244  !/ +-----------------------------------+
245  !/ | WAVEWATCH III NOAA/NCEP |
246  !/ | J. Lepesqueur |
247  !/ | FORTRAN 90 |
248  !/ | Last update : 14-Mar-2012 |
249  !/ +-----------------------------------+
250  !/
251  !/ 14-Mar-2012 : Origination. ( version 3.13 )
252  !/
253  ! 1. Purpose :
254  ! Tabulation of ERF function, which is used in bottom friction subgrid modelling
255  !
256  ! Initialization for source term routine.
257  !
258  ! 2. Method :
259  !
260  ! 3. Parameters :
261  !
262  ! Parameter list
263  ! ----------------------------------------------------------------
264  ! ----------------------------------------------------------------
265  !
266  ! 4. Subroutines used :
267  !
268  ! Name Type Module Description
269  ! ----------------------------------------------------------------
270  ! STRACE Subr. W3SERVMD Subroutine tracing.
271  ! ----------------------------------------------------------------
272  !
273  ! 5. Called by :
274  !
275  ! Name Type Module Description
276  ! ----------------------------------------------------------------
277  ! W3SIN3 Subr. W3SRC3MD Corresponding source term.
278  ! ----------------------------------------------------------------
279  !
280  ! 6. Error messages :
281  !
282  ! None.
283  !
284  ! 7. Remarks :
285  !
286  ! 8. Structure :
287  !
288  ! See source code.
289  !
290  ! 9. Switches :
291  !
292  ! !/S Enable subroutine tracing.
293  !
294  ! 10. Source code :
295  !
296  IMPLICIT NONE
297  INTEGER :: I
298  REAL :: x,y
299 
300  delxerf = (2*xerfmax)/real(sizeerftable)
301  DO i=0,sizeerftable
302  x=-1.*xerfmax+i*delxerf
303  if(x.lt.0.)then
304  y=2**(1/2)*(1-abs(erf(x)))/2
305  else
306  y=2**(1/2)*(1+erf(x))/2
307  end if
308  erftable(i)=y
309  END DO
310  RETURN
311  !/ ------------------------------------------------------------------- /

References delxerf, erftable, sizeerftable, and xerfmax.

Referenced by insbt4().

◆ w3sbt4()

subroutine w3sbt4md::w3sbt4 ( real, dimension(nspec), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nk), intent(in)  WN,
real, intent(in)  DEPTH,
real, intent(in)  D50,
real, intent(in)  PSIC,
real, dimension(2), intent(out)  TAUBBL,
real, dimension(3), intent(inout)  BEDFORM,
real, dimension(nspec), intent(out)  S,
real, dimension(nspec), intent(out)  D,
integer, intent(in)  IX,
integer, intent(in)  IY 
)

Computes the SHOWEX bottom friction with movable bed effects.

Uses a Gaussian distribution for friction factors, and estimates the contribution of rippled and non-rippled fractions based on the bayesian approach of Tolman (1995).

Parameters
[in]AAction density spectrum.
[in]CGGroup velocities.
[in]WNWavenumbers.
[in]DEPTHWater depth.
[in]D50Median grain size.
[in]PSICCritical Shields parameter.
[out]TAUBBLComponents of stress leaking to the bottom.
[in,out]BEDFORMRipple parameters (roughness and wavelength).
[out]SSource term (1-D version).
[out]DDiagonal term of derivative.
[in]IXSpatial grid index.
[in]IYSpatial grid index.
Author
F. Ardhuin
J. Lepesqueur
Date
15-Mar-2012

Definition at line 341 of file w3sbt4md.F90.

341  !/
342  !/ +-----------------------------------+
343  !/ | WAVEWATCH III NOAA/NCEP |
344  !/ | F. Ardhuin |
345  !/ ! J. Lepesqueur !
346  !/ | FORTRAN 90 |
347  !/ | Last update : 15-Mar-2012 |
348  !/ +-----------------------------------+
349  !/
350  !/ 23-Jun-2011 : Origination. ( version 4.04 )
351  !/ 04-Jul-2011 : Adding momentum flux TAUBBL ( version 4.05 )
352  !/ 15-Mar-2012 : Adding subgrid treatment for depth ( version 4.05 )
353  !/
354  ! 1. Purpose :
355  !
356  ! Computes the SHOWEX bottom friction with movable bed effects
357  !
358  ! 2. Method :
359  ! Uses a Gaussian distribution for friction factors, and estimates
360  ! the contribution of rippled and non-rippled fractions based on
361  ! the bayesian approach of Tolman (1995).
362  !
363  ! 3. Parameters :
364  !
365  ! Parameter list
366  ! ----------------------------------------------------------------
367  ! A R.A. I Action density spectrum.
368  ! CG R.A. I Group velocities.
369  ! WN R.A. I Wavenumbers.
370  ! DEPTH Real I Water depth.
371  ! D50 Real I Median grain size.
372  ! PSIC Real I Critical Shields parameter
373  ! BEFORMS Real I/O Ripple parameters (roughness and wavelength).
374  ! TAUBBL Real O Components of stress leaking to the bottom.
375  ! S R.A. O Source term (1-D version).
376  ! D R.A. O Diagonal term of derivative. *)
377  ! IX,IY Int. I Spatial grid indices
378  ! ----------------------------------------------------------------
379  !
380  ! 4. Subroutines used :
381  !
382  ! Name Type Module Description
383  ! ----------------------------------------------------------------
384  ! STRACE Subr. W3SERVMD Subroutine tracing.
385  ! ----------------------------------------------------------------
386  !
387  ! 5. Called by :
388  !
389  ! Name Type Module Description
390  ! ----------------------------------------------------------------
391  ! W3SRCE Subr. W3SRCEMD Source term integration.
392  ! W3EXPO Subr. N/A Point output post-processor.
393  ! GXEXPO Subr. N/A GrADS point output post-processor.
394  ! ----------------------------------------------------------------
395  !
396  ! 6. Error messages :
397  !
398  ! None.
399  !
400  ! 7. Remarks :
401  !
402  ! 8. Structure :
403  !
404  ! See source code.
405  !
406  ! 9. Switches :
407  !
408  ! !/S Enable subroutine tracing.
409  !
410  ! 10. Source code :
411  !
412  !/ ------------------------------------------------------------------- /
413 
414  USE constants
415  USE w3odatmd, ONLY: ndse
416  USE w3servmd, ONLY: extcde
417  USE w3gdatmd, ONLY: nk, nth, nspec, sig, dden, &
418  sbtcx, ecos, esin, dth
419 
420 #ifdef W3_S
421  USE w3servmd, ONLY: strace
422 #endif
423  IMPLICIT NONE
424  !/
425  !/ ------------------------------------------------------------------- /
426  !/ Parameter list
427  !/
428  !/
429  !/ ------------------------------------------------------------------- /
430  !/ Local parameters
431  !/
432 #ifdef W3_S
433  INTEGER, SAVE :: IENT = 0
434 #endif
435  !/
436  LOGICAL, SAVE :: FIRST = .true.
437  REAL, INTENT(IN) :: CG(NK), WN(NK), DEPTH, A(NSPEC), D50
438  REAL, INTENT(IN) :: PSIC
439  INTEGER, INTENT(IN) :: IX, IY
440  REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC), TAUBBL(2)
441  REAL, INTENT(INOUT) :: BEDFORM(3)
442  REAL :: CBETA(NK)
443  REAL :: UORB2,UORB,AORB, EBX, EBY, AX, AY, LX, LY
444  REAL :: CONST2, TEMP2
445  REAL :: FW, KSUBN, KSUBS, KSUBR, MINADIM
446  REAL :: SHIELDS(3), PSI, DELI1, DELI2, EB, XI, VARU, DD50
447  INTEGER :: IK, ITH, IS, IND, INDE, ISUB
448 
449  REAL :: KRR, DSUB
450  REAL DSUM(NK)
451  ! These are the 3-point Gauss-Hermitte quadrature coefficients
452  REAL, PARAMETER :: WSUB(3) = (/ 0.1666667, 0.1666666 , 0.6666667/)
453  REAL, PARAMETER :: XSUB(3) = (/ -0.001, 0.001 , 0. /)
454 
455  REAL :: PROBA1, PROBA2, PSIX, PSIXT, PSIN2, DPSI , FACTOR
456  REAL :: BACKGROUND
457 
458  !/
459  !/ ------------------------------------------------------------------- /
460  !/
461 #ifdef W3_S
462  CALL strace (ient, 'W3SBT4')
463 #endif
464  !
465  ! 0. Initializations ------------------------------------------------ *
466  IF ( first ) THEN
467  CALL insbt4
468  first = .false.
469  END IF
470 
471  !
472  ! 1. Min / Max settings for grain size D50---------------------------- *
473  !
474  dd50=max(d50,1e-5)
475  dd50=min(dd50,1.)
476  !
477  ! 1.1 Set background roughness when ripples are not active
478  !
479  background=max(sbtcx(6),sbtcx(7)*dd50)
480  !
481  ! 2. Subgrid loop
482  !
483  dsum(:)=0.
484  taubbl(:)=0.
485  !
486  DO isub=1,3
487  !
488  ! 2.a Computes bulk parameters : E, Uorb, Aorb------------------------- *
489  !
490  dsub=depth*(1.+xsub(isub))
491  uorb=0.
492  aorb=0.
493  ax =0.
494  ay =0.
495 
496  DO ik=1, nk
497  IF ( wn(ik)*dsub .LT. 6. ) THEN
498  eb = 0.
499  ebx = 0.
500  eby = 0.
501  DO ith=1, nth
502  is=ith+(ik-1)*nth
503  eb = eb + a(is)
504  ebx = ebx +a(is)*ecos(ith)
505  eby = eby +a(is)*esin(ith)
506  END DO
507  !
508  ! U_bot=sigma * Zeta / sinh(KD) and CBETA = 0.5*sigma^2 /(g*sinh^(kD))
509  ! therefore variance(u_bot)= variance(elevation)*2*CBETA/D
510  !
511  ! CBETA(IK) = MAX(0., (CG(IK)*WN(IK)/SIG(IK)-0.5) )/DSUB
512  cbeta(ik) = 0.5*sig(ik)**2 /(grav*(sinh(wn(ik)*dsub))**2)
513  ! N.B.: could also include shoaling effect on EB ...
514  factor= (dden(ik) / cg(ik))*2*cbeta(ik)*grav
515  varu= eb * factor
516  uorb = uorb + varu
517  aorb = aorb + varu/(sig(ik)**2)
518  ax = ax + (ebx * factor)
519  ay = ay + (eby * factor)
520  ELSE
521  cbeta(ik) = 0.
522  END IF
523  END DO
524  !
525  ! Computes RMS orbital amplitudes
526  !
527  uorb2 = 2*uorb
528  uorb = sqrt(max(1.0e-7,uorb2))
529  aorb = sqrt(max(1.0e-7,2*aorb))
530  !
531  ! Computes potential ripple wavelength, 1.7 = 2 * sqrt(2) * 0.6
532  ! Based on Ardhuin et al. (JGR 2002): lambda = 0.6 * d_1/3
533  !
534  lx = aorb*1.7*ax/sqrt(ax**2+ay**2+1e-12)
535  ly = aorb*1.7*ay/sqrt(ax**2+ay**2+1e-12)
536  !
537  ! 2.b First use of FWTABLE to get skin roughness and estimate Shields parameter
538  !
539  xi=max((alog10(max(aorb/dd50,0.3))-abmin)/delab,1.)
540  ind = min(sizefwtable-1, int(xi))
541  deli1= min(1. ,xi-float(ind))
542  deli2= 1. - deli1
543  fw =fwtable(ind)*deli2+fwtable(ind+1)*deli1
544 
545  psi=fw*uorb2/(2.*grav*(sed_sg-1)*dd50)
546  !
547  ! Normalized Shields parameter
548  !
549  shields(isub)=psi/psic
550  !
551  END DO ! end of loop on ISUB
552  dpsi=(shields(2)-shields(1))/(xsub(2)-xsub(1))*sbtcx(5)
553  !
554  ! Tests if the variation in psi is large enough to use subgrid
555  !
556  IF (abs(dpsi).LT.0.0001*shields(3).OR.abs(dpsi).LT.1.e-8) THEN
557  !
558  ! no subgrid in this case
559  !
560  IF(shields(3).GT.sbtcx(3)) THEN
561 
562  ! ripple roughness, see Ardhuin et al. (2003)
563  ksubr=aorb*sbtcx(1)*shields(3)**sbtcx(2)
564  ! Sheet flow roughness, see Wilson (1989)
565  ksubs=aorb*0.0655*(uorb2/((sed_sg-1)*grav*aorb))**1.4
566  ksubn = ksubr + ksubs
567  bedform(2)=lx
568  bedform(3)=ly
569  ELSE
570  ! relict roughness, see Ardhuin et al. (2003)
571  ksubn=max(background,aorb*sbtcx(4))
572  bedform(2)=-lx
573  bedform(3)=-ly
574  END IF
575 
576  bedform(1)=ksubn
577 
578  ELSE
579  !
580  ! subgrid in this case
581  !
582  psix=(sbtcx(3)-shields(3))/dpsi
583 
584  psixt=max((psix + xerfmax)/delxerf,0.)
585  inde = max(min(sizeerftable-1, int(psixt)),0)
586  deli1 = min(1. ,psixt-float(inde))
587  deli2 = 1. - deli1
588  proba2=max(min(erftable(inde)*deli2+erftable(inde+1)*deli1,1.),0.)
589  proba1 = 1. - proba2
590  ! Mean psi with ripples (Tolman 1995, eq. XX)
591  psin2=max(shields(3)+exp(-(0.5*psix**2))/sqrt(tpi)*dpsi/(proba2+0.0001),sbtcx(3))
592  ! Sum of relict, ripple and sheet flow roughnesses
593  ksubn = proba1*max(background,aorb*sbtcx(4)) &
594  +proba2*aorb*(sbtcx(1)*psin2**sbtcx(2)+ &
595  0.0655*(uorb2/((sed_sg-1)*grav*aorb))**1.4)
596  !
597  IF (proba2.GT.0.5) THEN
598  bedform(2)=lx
599  bedform(3)=ly
600  ELSE
601  bedform(2)=-lx
602  bedform(3)=-ly
603  END IF
604  !
605  END IF
606  bedform(1)=ksubn
607 
608  !
609  ! 2.c second use of FWTABLE to get FW from the full roughness
610  !
611  xi=max((alog10(max(aorb/ksubn,0.3))-abmin)/delab,1.)
612  ind = min(sizefwtable-1, int(xi))
613  deli1= min(1. ,xi-float(ind))
614  deli2= 1. - deli1
615  fw =fwtable(ind)*deli2+fwtable(ind+1)*deli1
616  !
617  ! 5. Fills output arrays and estimates the energy and momentum loss
618  !
619  DO ik=1, nk
620  const2=dden(ik)/cg(ik) & !Jacobian to get energy in band
621  *grav/(sig(ik)/wn(ik)) ! coefficient to get momentum
622  dsum(ik)=-fw*uorb*cbeta(ik) !*WSUB(ISUB)
623  DO ith=1,nth
624  is=ith+(ik-1)*nth
625  d(is)=dsum(ik)
626  temp2=const2*d(is)*a(is)
627  taubbl(1) = taubbl(1) - temp2*ecos(is)
628  taubbl(2) = taubbl(2) - temp2*esin(is)
629  s(is)=d(is)*a(is)
630  END DO
631  END DO
632  !
633  RETURN
634  !/
635  !/ End of W3SBT4 ----------------------------------------------------- /
636  !/

References constants::abmin, w3gdatmd::dden, constants::delab, delxerf, w3gdatmd::dth, w3gdatmd::ecos, erftable, w3gdatmd::esin, w3servmd::extcde(), constants::fwtable, constants::grav, insbt4(), w3odatmd::ndse, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::sbtcx, constants::sed_sg, w3gdatmd::sig, sizeerftable, constants::sizefwtable, w3servmd::strace(), constants::tpi, and xerfmax.

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

Variable Documentation

◆ delxerf

real w3sbt4md::delxerf

Definition at line 132 of file w3sbt4md.F90.

132  REAL :: DELXERF

Referenced by tabu_erf(), and w3sbt4().

◆ erftable

real, dimension(0:sizeerftable) w3sbt4md::erftable

Definition at line 131 of file w3sbt4md.F90.

131  REAL :: ERFTABLE(0:SIZEERFTABLE)

Referenced by tabu_erf(), and w3sbt4().

◆ sizeerftable

integer, parameter w3sbt4md::sizeerftable =300

Definition at line 130 of file w3sbt4md.F90.

130  INTEGER, PARAMETER :: SIZEERFTABLE=300

Referenced by tabu_erf(), and w3sbt4().

◆ xerfmax

real, parameter w3sbt4md::xerfmax = 4.

Definition at line 133 of file w3sbt4md.F90.

133  REAL, PARAMETER :: XERFMAX = 4. ! number of stdev

Referenced by tabu_erf(), and w3sbt4().

constants::abmin
real, parameter abmin
ABMIN.
Definition: constants.F90:94
w3gdatmd::dth
real, pointer dth
Definition: w3gdatmd.F90:1232
w3sbt4md::xerfmax
real, parameter xerfmax
Definition: w3sbt4md.F90:133
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3sbt4md::sizeerftable
integer, parameter sizeerftable
Definition: w3sbt4md.F90:130
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
constants::sizefwtable
integer, parameter sizefwtable
SIZEFWTABLE.
Definition: constants.F90:91
w3sbt4md::insbt4
subroutine insbt4
Initialization for bottom friction source term routine.
Definition: w3sbt4md.F90:146
w3servmd
Definition: w3servmd.F90:3
w3sbt4md::delxerf
real delxerf
Definition: w3sbt4md.F90:132
w3sbt4md::tabu_erf
subroutine tabu_erf
Tabulation of ERF function, which is used in bottom friction subgrid modeling.
Definition: w3sbt4md.F90:243
w3odatmd
Definition: w3odatmd.F90:3
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
constants::fwtable
real, dimension(0:sizefwtable) fwtable
FWTABLE.
Definition: constants.F90:92
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
constants::delab
real delab
DELAB.
Definition: constants.F90:93
w3gdatmd::sbtcx
real, dimension(:), pointer sbtcx
Definition: w3gdatmd.F90:1387
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
w3gdatmd
Definition: w3gdatmd.F90:16
constants::sed_sg
real, parameter sed_sg
SED_SG Specific gravity of sediments (N.D.).
Definition: constants.F90:68
w3sbt4md::erftable
real, dimension(0:sizeerftable) erftable
Definition: w3sbt4md.F90:131
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61