WAVEWATCH III  beta 0.0.1
w3src6md Module Reference

Observation-based wind input and dissipation after Donelan et al (2006), and Babanin et al. More...

Functions/Subroutines

subroutine, public w3spr6 (A, CG, WN, EMEAN, FMEAN, WNMEAN, AMAX, FP)
 Calculate mean wave parameters. More...
 
subroutine, public w3sin6 (A, CG, WN2, UABS, USTAR, USDIR, CD, DAIR, TAUWX, TAUWY, TAUNWX, TAUNWY, S, D)
 Observation-based source term for wind input. More...
 
subroutine, public w3sds6 (A, CG, WN, S, D)
 Observation-based source term for dissipation. More...
 
subroutine tau_wave_atmos (S, CINV, SIG, DSII, TAUNWX, TAUNWY)
 Calculated the stress for the negative part of the input term. More...
 

Detailed Description

Observation-based wind input and dissipation after Donelan et al (2006), and Babanin et al.

(2010).

Parameterisation is based on the field data from Lake George, Australia. Initial implementation of input and dissipation is based on work from Tsagareli et al. (2010) and Rogers et al. (2012). Parameterisation extended and account for negative input due to opposing winds (see Donelan et al, 2006) and the vector version of the stress computation.

Author
S. Zieger
Q. Liu
Date
26-Jun-2018

Function/Subroutine Documentation

◆ tau_wave_atmos()

subroutine w3src6md::tau_wave_atmos ( real, dimension(nth,nk), intent(in)  S,
real, dimension(nk), intent(in)  CINV,
real, dimension(nk), intent(in)  SIG,
real, dimension(nk), intent(in)  DSII,
real, intent(out)  TAUNWX,
real, intent(out)  TAUNWY 
)

Calculated the stress for the negative part of the input term.

Calculated the stress for the negative part of the input term, that is the stress from the waves to the atmosphere. Relevant in the case of opposing winds.

Parameters
[in]SWind-input source term Sin.
[in]CINVInverse phase speed.
[in]SIGRelative frequencies.
[in]DSIIFrequency bandwidths.
[out]TAUNWXStress components (wave->atmos).
[out]TAUNWYStress components (wave->atmos).
Author
S. Zieger
Q. Liu
Date
26-Jun-2018

Definition at line 1067 of file w3src6md.F90.

1067  !/
1068  !/ +-----------------------------------+
1069  !/ | WAVEWATCH III NOAA/NCEP |
1070  !/ | S. Zieger |
1071  !/ | Q. Liu |
1072  !/ | FORTRAN 90 |
1073  !/ | Last update : 26-Jun-2018 |
1074  !/ +-----------------------------------+
1075  !/
1076  !/ 24-Oct-2013 : Origination following LFACTOR
1077  !/ (S. Zieger)
1078  !/ 26-Jun-2018 : Updates on DSII10Hz ( version 6.06)
1079  !/ (Q. Liu)
1080  !
1081  ! 1. Purpose :
1082  !
1083  ! Calculated the stress for the negative part of the input term,
1084  ! that is the stress from the waves to the atmosphere. Relevant
1085  ! in the case of opposing winds.
1086  !
1087  ! 2. Method :
1088  ! 1) If required, extend resolved part of the spectrum to 10Hz using
1089  ! an approximation for the spectral slope at the high frequency
1090  ! limit: Sin(F) prop. F**(-2) and for E(F) prop. F**(-5).
1091  ! 2) Calculate stresses:
1092  ! stress components (x,y): /10Hz
1093  ! TAUNW_X,Y = GRAV * DWAT * | [SinX,Y(F)]/C(F) dF
1094  ! /
1095  ! 3. Parameters :
1096  !
1097  ! Parameter list
1098  ! ----------------------------------------------------------------
1099  ! S R.A. I Wind input energy density spectrum
1100  ! CINV R.A. I Inverse phase speed 1/C(sigma)
1101  ! SIG R.A. I Relative frequencies [in rad.]
1102  ! DSII R.A. I Frequency bandwiths [in rad.]
1103  ! TAUNWX-Y Real O Component of the negative wave-supported stress
1104  ! ----------------------------------------------------------------
1105  !
1106  ! 4. Subroutines used :
1107  !
1108  ! Name Type Scope Description
1109  ! ----------------------------------------------------------------
1110  ! STRACE Subr. W3SERVMD Subroutine tracing.
1111  ! IRANGE Func. Private Index generator (ie, array addressing)
1112  ! TAUWINDS Func. Private Normal stress calculation (TAU_NRM)
1113  ! ----------------------------------------------------------------
1114  !
1115  ! 5. Source code :
1116  !
1117  !/
1118  USE constants, ONLY: grav, tpi
1119  USE w3gdatmd, ONLY: nk, nth, nspec, dth, xfr, ecos, esin
1120 #ifdef W3_S
1121  USE w3servmd, ONLY: strace
1122 #endif
1123  IMPLICIT NONE
1124  !
1125  !/ ------ I/O parameters --------------------------------------------- /
1126  REAL, INTENT(IN) :: S(NTH,NK) ! wind-input source term Sin
1127  REAL, INTENT(IN) :: CINV(NK) ! inverse phase speed
1128  REAL, INTENT(IN) :: SIG(NK) ! relative frequencies
1129  REAL, INTENT(IN) :: DSII(NK) ! frequency bandwidths
1130  REAL, INTENT(OUT) :: TAUNWX, TAUNWY ! stress components (wave->atmos)
1131  !
1132  !/ --- local parameters (in order of appearance) ------------------ /
1133 #ifdef W3_S
1134  INTEGER, SAVE :: IENT = 0
1135 #endif
1136  REAL, PARAMETER :: FRQMAX = 10. ! Upper freq. limit to extrapolate to.
1137  INTEGER :: NK10Hz
1138  !
1139  REAL :: ECOS2(NSPEC), ESIN2(NSPEC)
1140  REAL, ALLOCATABLE :: IK10Hz(:), SIG10Hz(:), CINV10Hz(:)
1141  REAL, ALLOCATABLE :: SDENSX10Hz(:), SDENSY10Hz(:)
1142  REAL, ALLOCATABLE :: DSII10Hz(:), UCINV10Hz(:)
1143  !
1144  !/ ------------------------------------------------------------------- /
1145 #ifdef W3_S
1146  CALL strace (ient, 'TAU_WAVE_ATMOS')
1147 #endif
1148  !
1149  !/ 0) --- Find the number of frequencies required to extend arrays
1150  !/ up to f=10Hz and allocate arrays --------------------------- /
1151  nk10hz = ceiling(alog(frqmax/(sig(1)/tpi))/alog(xfr))+1
1152  nk10hz = max(nk,nk10hz)
1153  !
1154  ALLOCATE(ik10hz(nk10hz))
1155  ik10hz = real( irange(1,nk10hz,1) )
1156  !
1157  ALLOCATE(sig10hz(nk10hz))
1158  ALLOCATE(cinv10hz(nk10hz))
1159  ALLOCATE(dsii10hz(nk10hz))
1160  ALLOCATE(sdensx10hz(nk10hz))
1161  ALLOCATE(sdensy10hz(nk10hz))
1162  ALLOCATE(ucinv10hz(nk10hz))
1163  !
1164  ecos2 = ecos(1:nspec)
1165  esin2 = esin(1:nspec)
1166  !
1167  !/ 1) --- Either extrapolate arrays up to 10Hz or use discrete spectral
1168  ! grid per se. Limit the constraint to the positive part of the
1169  ! wind input only. ---------------------------------------------- /
1170  IF (nk .LT. nk10hz) THEN
1171  sdensx10hz(1:nk) = sum(abs(min(0.,s))*reshape(ecos2,(/nth,nk/)),1) * dth
1172  sdensy10hz(1:nk) = sum(abs(min(0.,s))*reshape(esin2,(/nth,nk/)),1) * dth
1173  sig10hz = sig(1)*xfr**(ik10hz-1.0)
1174  cinv10hz(1:nk) = cinv
1175  cinv10hz(nk+1:nk10hz) = sig10hz(nk+1:nk10hz)*0.101978
1176  dsii10hz = 0.5 * sig10hz * (xfr-1.0/xfr)
1177  ! The first and last frequency bin:
1178  dsii10hz(1) = 0.5 * sig10hz(1) * (xfr-1.0)
1179  dsii10hz(nk10hz) = 0.5 * sig10hz(nk10hz) * (xfr-1.0) / xfr
1180  !
1181  ! --- Spectral slope for S_IN(F) is proportional to F**(-2) ------ /
1182  sdensx10hz(nk+1:nk10hz) = sdensx10hz(nk) * (sig10hz(nk)/sig10hz(nk+1:nk10hz))**2
1183  sdensy10hz(nk+1:nk10hz) = sdensy10hz(nk) * (sig10hz(nk)/sig10hz(nk+1:nk10hz))**2
1184  ELSE
1185  sig10hz = sig
1186  cinv10hz = cinv
1187  dsii10hz = dsii
1188  sdensx10hz(1:nk) = sum(abs(min(0.,s))*reshape(ecos2,(/nth,nk/)),1) * dth
1189  sdensy10hz(1:nk) = sum(abs(min(0.,s))*reshape(esin2,(/nth,nk/)),1) * dth
1190  END IF
1191  !
1192  !/ 2) --- Stress calculation ----------------------------------------- /
1193  ! --- The wave supported stress (waves to atmosphere) ------------ /
1194  taunwx = tauwinds(sdensx10hz,cinv10hz,dsii10hz) ! x-component
1195  taunwy = tauwinds(sdensy10hz,cinv10hz,dsii10hz) ! y-component
1196  !/

References w3gdatmd::dth, constants::dwat, w3gdatmd::ecos, w3gdatmd::esin, constants::grav, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3servmd::strace(), constants::tpi, and w3gdatmd::xfr.

Referenced by w3sin6().

◆ w3sds6()

subroutine, public w3src6md::w3sds6 ( 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 
)

Observation-based source term for dissipation.

After Babanin et al. (2010) following the implementation by Rogers et al. (2012). The dissipation function Sds accommodates an inherent breaking term T1 and an additional cumulative term T2 at all frequencies above the peak. The forced dissipation term T2 is an integral that grows toward higher frequencies and dominates at smaller scales (Babanin et al. 2010).

References: Babanin et al. 2010: JPO 40(4), 667-683 Rogers et al. 2012: JTECH 29(9) 1329-1346

Parameters
[in]AAction density spectrum.
[in]CGGroup velocities.
[in]WNWavenumbers.
[out]SSource term (1-D version).
[out]DDiagonal term of derivative.
Author
S. Zieger
Q. Liu
Date
26-Jun-2018

Definition at line 547 of file w3src6md.F90.

547  !/
548  !/ +-----------------------------------+
549  !/ | WAVEWATCH III NOAA/NCEP |
550  !/ | S. Zieger |
551  !/ | Q. Liu |
552  !/ | FORTRAN 90 |
553  !/ | Last update : 26-Jun-2018 |
554  !/ +-----------------------------------+
555  !/
556  !/ 23-Jun-2010 : Origination. ( version 4.04 )
557  !/ (S. Zieger)
558  !/ 26-Jun-2018 : Revise the width of the last bin ( version 6.06 )
559  !/ (Q. Liu)
560  !/
561  ! 1. Purpose :
562  !
563  ! Observation-based source term for dissipation after Babanin et al.
564  ! (2010) following the implementation by Rogers et al. (2012). The
565  ! dissipation function Sds accommodates an inherent breaking term T1
566  ! and an additional cumulative term T2 at all frequencies above the
567  ! peak. The forced dissipation term T2 is an integral that grows
568  ! toward higher frequencies and dominates at smaller scales
569  ! (Babanin et al. 2010).
570  !
571  ! References:
572  ! Babanin et al. 2010: JPO 40(4), 667-683
573  ! Rogers et al. 2012: JTECH 29(9) 1329-1346
574  !
575  ! 2. Method :
576  !
577  ! Sds = (T1 + T2) * E
578  !
579  ! 3. Parameters :
580  !
581  ! Parameter list
582  ! ----------------------------------------------------------------
583  ! A¹ R.A. I Action density spectrum
584  ! CG R.A. I Group velocities
585  ! WN R.A. I Wavenumbers
586  ! S¹ R.A. O Source term (1-D version)
587  ! D¹ R.A. O Diagonal term of derivative
588  ! ¹ Stored as 1-D array with dimension NTH*NK (column by column).
589  ! ----------------------------------------------------------------
590  !
591  ! 4. Subroutines used :
592  !
593  ! Name Type Module Description
594  ! ----------------------------------------------------------------
595  ! STRACE Subr. W3SERVMD Subroutine tracing.
596  ! ----------------------------------------------------------------
597  !
598  ! 5. Called by :
599  !
600  ! Name Type Module Description
601  ! ----------------------------------------------------------------
602  ! W3SRCE Subr. W3SRCEMD Source term integration.
603  ! W3EXPO Subr. N/A Point output post-processor.
604  ! GXEXPO Subr. N/A GrADS point output post-processor.
605  ! ----------------------------------------------------------------
606  !
607  ! 6. Error messages :
608  !
609  ! None.
610  !
611  ! 7. Remarks :
612  !
613  ! 8. Structure :
614  !
615  ! See source code.
616  !
617  ! 9. Switches :
618  !
619  ! !/S Enable subroutine tracing.
620  ! !/T6 Test output for dissipation terms T1 and T2.
621  !
622  ! 10. Source code :
623  !
624  !/ ------------------------------------------------------------------- /
625  USE constants, ONLY: grav, tpi
626  USE w3gdatmd, ONLY: nk, nth, nspec, dden, dsii, sig2, dth, xfr
627  USE w3gdatmd, ONLY: sds6a1, sds6a2, sds6p1, sds6p2, sds6et
628  USE w3odatmd, ONLY: ndse
629  USE w3servmd, ONLY: extcde
630 #ifdef W3_T6
631  USE w3timemd, ONLY: stme21
632  USE w3wdatmd, ONLY: time
633  USE w3odatmd, ONLY: ndst
634 #endif
635 #ifdef W3_S
636  USE w3servmd, ONLY: strace
637 #endif
638  !/
639  IMPLICIT NONE
640  !/
641  !/ ------------------------------------------------------------------- /
642  !/ Parameter list
643  REAL, INTENT(IN) :: A(NSPEC), CG(NK), WN(NK)
644  REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC)
645  !/
646  !/ ------------------------------------------------------------------- /
647  !/ Local parameters
648 #ifdef W3_S
649  INTEGER, SAVE :: IENT = 0
650 #endif
651  INTEGER :: IK, ITH, IKN(NK)
652  REAL :: FREQ(NK) ! frequencies [Hz]
653  REAL :: DFII(NK) ! frequency bandwiths [Hz]
654  REAL :: ANAR(NK) ! directional narrowness
655  REAL :: BNT ! empirical constant for
656  ! wave breaking probability
657  REAL :: EDENS (NK) ! spectral density E(f)
658  REAL :: ETDENS(NK) ! threshold spec. density ET(f)
659  REAL :: EXDENS(NK) ! excess spectral density EX(f)
660  REAL :: NEXDENS(NK) ! normalised excess spectral density
661  REAL :: T1(NK) ! inherent breaking term
662  REAL :: T2(NK) ! forced dissipation term
663  REAL :: T12(NK) ! = T1+T2 or combined dissipation
664  REAL :: ADF(NK), XFAC, EDENSMAX ! temp. variables
665 #ifdef W3_T6
666  CHARACTER(LEN=23) :: IDTIME
667 #endif
668  !/
669  !/ ------------------------------------------------------------------- /
670  !/
671 #ifdef W3_S
672  CALL strace (ient, 'W3SDS6')
673 #endif
674  !
675  !/ 0) --- Initialize essential parameters ---------------------------- /
676  ikn = irange(1,nspec,nth) ! Index vector for elements of 1,
677  ! ! 2,..., NK such that for example
678  ! ! SIG(1:NK) = SIG2(IKN).
679  freq = sig2(ikn)/tpi
680  anar = 1.0
681  bnt = 0.035**2
682  t1 = 0.0
683  t2 = 0.0
684  nexdens = 0.0
685  !
686  !/ 1) --- Calculate threshold spectral density, spectral density, and
687  !/ the level of exceedence EXDENS(f) -------------------------- /
688  etdens = ( tpi * bnt ) / ( anar * cg * wn**3 )
689  edens = sum(reshape(a,(/ nth,nk /)),1) * tpi * sig2(ikn) * dth / cg ! E(f)
690  exdens = max(0.0,edens-etdens)
691  !
692  !/ --- normalise by a generic spectral density -------------------- /
693  IF (sds6et) THEN ! ww3_grid.inp: &SDS6 SDSET = T or F
694  nexdens = exdens / etdens ! normalise by threshold spectral density
695  ELSE ! normalise by spectral density
696  edensmax = maxval(edens)*1e-5
697  IF (all(edens .GT. edensmax)) THEN
698  nexdens = exdens / edens
699  ELSE
700  DO ik = 1,nk
701  IF (edens(ik) .GT. edensmax) nexdens(ik) = exdens(ik) / edens(ik)
702  END DO
703  END IF
704  END IF
705  !
706  !/ 2) --- Calculate inherent breaking component T1 ------------------- /
707  t1 = sds6a1 * anar * freq * (nexdens**sds6p1)
708  !
709  !/ 3) --- Calculate T2, the dissipation of waves induced by
710  !/ the breaking of longer waves T2 ---------------------------- /
711  adf = anar * (nexdens**sds6p2)
712  xfac = (1.0-1.0/xfr)/(xfr-1.0/xfr)
713  DO ik = 1,nk
714  dfii = dsii/tpi
715  ! IF (IK .GT. 1) DFII(IK) = DFII(IK) * XFAC
716  IF (ik .GT. 1 .AND. ik .LT. nk) dfii(ik) = dfii(ik) * xfac
717  t2(ik) = sds6a2 * sum( adf(1:ik)*dfii(1:ik) )
718  END DO
719  !
720  !/ 4) --- Sum up dissipation terms and apply to all directions ------- /
721  t12 = -1.0 * ( max(0.0,t1)+max(0.0,t2) )
722  DO ith = 1, nth
723  d(ikn+ith-1) = t12
724  END DO
725  !
726  s = d * a
727  !
728  !/ 5) --- Diagnostic output (switch !/T6) ---------------------------- /
729 #ifdef W3_T6
730  CALL stme21 ( time , idtime )
731  WRITE (ndst,270) 'T1*E',idtime(1:19),(t1*edens)
732  WRITE (ndst,270) 'T2*E',idtime(1:19),(t2*edens)
733  WRITE (ndst,271) sum(sum(reshape(s,(/ nth,nk /)),1)*dden/cg)
734  !
735 270 FORMAT (' TEST W3SDS6 : ',a,'(',a,')',':',70e11.3)
736 271 FORMAT (' TEST W3SDS6 : Total SDS =',e13.5)
737 #endif
738  !/
739  !/ End of W3SDS6 ----------------------------------------------------- /
740  !/

References constants::dair, w3gdatmd::dden, w3gdatmd::dsii, w3gdatmd::dth, w3gdatmd::ecos, w3gdatmd::esin, w3servmd::extcde(), constants::grav, w3odatmd::iaproc, w3odatmd::naperr, w3odatmd::ndse, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::sds6a1, w3gdatmd::sds6a2, w3gdatmd::sds6et, w3gdatmd::sds6p1, w3gdatmd::sds6p2, w3gdatmd::sig2, w3gdatmd::sin6ws, w3timemd::stme21(), w3servmd::strace(), w3wdatmd::time, constants::tpi, and w3gdatmd::xfr.

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

◆ w3sin6()

subroutine, public w3src6md::w3sin6 ( real, dimension (nspec), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nspec), intent(in)  WN2,
real, intent(in)  UABS,
real, intent(in)  USTAR,
real, intent(in)  USDIR,
real, intent(in)  CD,
real, intent(in)  DAIR,
real, intent(out)  TAUWX,
real, intent(out)  TAUWY,
real, intent(out)  TAUNWX,
real, intent(out)  TAUNWY,
real, dimension(nspec), intent(out)  S,
real, dimension(nspec), intent(out)  D 
)

Observation-based source term for wind input.

After Donelan, Babanin, Young and Banner (Donelan et al ,2006) following the implementation by Rogers et al. (2012).

References:
  Donelan et al. 2006: JPO 36(8) 1672-1689.
  Rogers  et al. 2012: JTECH 29(9) 1329-1346
Parameters
[in]AAction density spectrum
[in]CGGroup velocities.
[in]WN2Wavenumbers.
[in]UABSWind speed at 10 m above sea level (U10).
[in]USTARFriction velocity.
[in]USDIRDirection of USTAR.
[in]CDDrag coefficient.
[in]DAIRAir density.
[out]TAUWXComponent of the wave-supported stress.
[out]TAUWYComponent of the wave-supported stress.
[out]TAUWNXComponent of the negative part of the stress.
[out]TAUWNYComponent of the negative part of the stress.
[out]SSource term.
[out]DDiagonal term of derivative.
Author
S. Zieger
Q. Liu
Date
13-Aug-2021

Definition at line 292 of file w3src6md.F90.

292  !/
293  !/ +-----------------------------------+
294  !/ | WAVEWATCH III NOAA/NCEP/NOPP |
295  !/ | S. Zieger |
296  !/ | Q. Liu |
297  !/ | FORTRAN 90 |
298  !/ | Last update : 13-Aug-2021 |
299  !/ +-----------------------------------+
300  !/
301  !/ 20-Dec-2010 : Origination. ( version 4.04 )
302  !/ (S. Zieger)
303  !/
304  !/ 26-Jun-2018 : UPROXY Update & UABS ( version 6.06 )
305  !/ (Q. Liu)
306  !/ 13-Aug-2021 : Consider DAIR a variable ( version x.xx )
307  !/
308  ! 1. Purpose :
309  !
310  ! Observation-based source term for wind input after Donelan, Babanin,
311  ! Young and Banner (Donelan et al ,2006) following the implementation
312  ! by Rogers et al. (2012).
313  !
314  ! References:
315  ! Donelan et al. 2006: JPO 36(8) 1672-1689.
316  ! Rogers et al. 2012: JTECH 29(9) 1329-1346
317  !
318  ! 2. Method :
319  !
320  ! Sin = B * E
321  !
322  ! 3. Parameters :
323  !
324  ! Parameter list
325  ! ----------------------------------------------------------------
326  ! A¹ R.A. I Action density spectrum
327  ! CG R.A. I Group velocities
328  ! WN2¹ R.A. I Wavenumbers
329  ! UABS Real I Wind speed at 10 m above sea level (U10)
330  ! USTAR Real I Friction velocity
331  ! USDIR Real I Direction of USTAR
332  ! CD Real I Drag coefficient
333  ! DAIR Real I Air density
334  ! S¹ R.A. O Source term
335  ! D¹ R.A. O Diagonal term of derivative
336  ! TAUWX-Y Real O Component of the wave-supported stress
337  ! TAUNWX-Y Real O Component of the negative part of the stress
338  ! ¹ Stored as 1-D array with dimension NTH*NK (column by column).
339  ! ----------------------------------------------------------------
340  !
341  ! 4. Subroutines used :
342  !
343  ! Name Type Module Description
344  ! ----------------------------------------------------------------
345  ! LFACTOR Subr. W3SRC6MD
346  ! IRANGE Func. W3SRC6MD
347  ! STRACE Subr. W3SERVMD Subroutine tracing.
348  ! ----------------------------------------------------------------
349  !
350  ! 5. Called by :
351  !
352  ! Name Type Module Description
353  ! ----------------------------------------------------------------
354  ! W3SRCE Subr. W3SRCEMD Source term integration.
355  ! W3EXPO Subr. N/A Point output post-processor.
356  ! GXEXPO Subr. N/A GrADS point output post-processor.
357  ! ----------------------------------------------------------------
358  !
359  ! 6. Error messages :
360  !
361  ! None.
362  !
363  ! 7. Remarks :
364  !
365  ! 8. Structure :
366  !
367  ! See comments in source code.
368  !
369  ! 9. Switches :
370  !
371  ! !/S Enable subroutine tracing.
372  ! !/T6 Test and diagnostic output for tail reduction.
373  !
374  ! 10. Source code :
375  !
376  !/ ------------------------------------------------------------------- /
377  USE constants, ONLY: dwat, tpi, grav
378  USE w3gdatmd, ONLY: nk, nth, nspec, dth, sig2, dden2
379  USE w3gdatmd, ONLY: ecos, esin, sin6a0, sin6ws
380  USE w3odatmd, ONLY: ndse
381  USE w3servmd, ONLY: extcde
382 #ifdef W3_S
383  USE w3servmd, ONLY: strace
384 #endif
385  !/
386  IMPLICIT NONE
387  !/
388  !/ ------------------------------------------------------------------- /
389  !/ Parameter list
390  REAL, INTENT(IN) :: A (NSPEC), CG(NK), WN2(NSPEC)
391  REAL, INTENT(IN) :: UABS, USTAR, USDIR, CD, DAIR
392  REAL, INTENT(OUT) :: TAUWX, TAUWY, TAUNWX, TAUNWY
393  REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC)
394  !/
395  !/ ------------------------------------------------------------------- /
396  !/ Local parameters
397 #ifdef W3_S
398  INTEGER, SAVE :: IENT = 0
399 #endif
400  INTEGER :: IK, ITH, IKN(NK)
401  REAL :: COSU, SINU, UPROXY
402  REAL, DIMENSION(NSPEC) :: CG2, ECOS2, ESIN2, DSII2
403  REAL, DIMENSION(NK) :: DSII, SIG, WN
404  REAL :: K(NTH,NK), SDENSIG(NTH,NK) ! 1,2,5)
405  REAL, DIMENSION(NK) :: ADENSIG, KMAX, ANAR, SQRTBN ! 1,2,3)
406  REAL, DIMENSION(NSPEC) :: W1, W2, SQRTBN2, CINV2 ! 4,7)
407  REAL, DIMENSION(NK) :: LFACT, CINV ! 5)
408  !/ ------------------------------------------------------------------- /
409 #ifdef W3_S
410  CALL strace (ient, 'W3SIN6')
411 #endif
412  !
413  !/ 0) --- set up a basic variables ----------------------------------- /
414  cosu = cos(usdir)
415  sinu = sin(usdir)
416  !
417  taunwx = 0.
418  taunwy = 0.
419  tauwx = 0.
420  tauwy = 0.
421  !
422  !/ --- scale friction velocity to wind speed (10m) in
423  !/ the boundary layer ----------------------------------------- /
424  !/ Donelan et al. (2006) used U10 or U_{λ/2} in their S_{in}
425  !/ parameterization. To avoid some disadvantages of using U10 or
426  !/ U_{λ/2}, Rogers et al. (2012) used the following engineering
427  !/ conversion:
428  !/ UPROXY = SIN6WS * UST
429  !/
430  !/ SIN6WS = 28.0 following Komen et al. (1984)
431  !/ SIN6WS = 32.0 suggested by E. Rogers (2014)
432  !
433  uproxy = sin6ws * ustar ! Scale wind speed
434  !
435  ecos2 = ecos(1:nspec) ! Only indices from 1 to NSPEC
436  esin2 = esin(1:nspec) ! are requested.
437  !
438  ikn = irange(1,nspec,nth) ! Index vector for elements of 1 ... NK
439  ! ! such that e.g. SIG(1:NK) = SIG2(IKN).
440  dsii2 = dden2 / dth / sig2 ! Frequency bandwidths (int.) (rad)
441  dsii = dsii2(ikn)
442  sig = sig2(ikn)
443  wn = wn2(ikn)
444  cinv2 = wn2 / sig2 ! inverse phase speed
445  !
446  DO ith = 1, nth
447  cg2(ikn+(ith-1)) = cg ! Apply CG to all directions.
448  END DO
449  !
450  !/ 1) --- calculate 1d action density spectrum (A(sigma)) and
451  !/ zero-out values less than 1.0E-32 to avoid NaNs when
452  !/ computing directional narrowness in step 4). --------------- /
453  k = reshape(a,(/ nth,nk /))
454  adensig = sum(k,1) * sig * dth ! Integrate over directions.
455  !
456  !/ 2) --- calculate normalised directional spectrum K(theta,sigma) --- /
457  kmax = maxval(k,1)
458  DO ik = 1,nk
459  IF (kmax(ik).LT.1.0e-34) THEN
460  k(1:nth,ik) = 1.
461  ELSE
462  k(1:nth,ik) = k(1:nth,ik)/kmax(ik)
463  END IF
464  END DO
465  !
466  !/ 3) --- calculate normalised spectral saturation BN(IK) ------------ /
467  anar = 1.0/( sum(k,1) * dth ) ! directional narrowness
468  !
469  sqrtbn = sqrt( anar * adensig * wn**3 )
470  DO ith = 1, nth
471  sqrtbn2(ikn+(ith-1)) = sqrtbn ! Calculate SQRTBN for
472  END DO ! the entire spectrum.
473  !
474  !/ 4) --- calculate growth rate GAMMA and S for all directions for
475  !/ following winds (U10/c - 1 is positive; W1) and in 7) for
476  !/ adverse winds (U10/c -1 is negative, W2). W1 and W2
477  !/ complement one another. ------------------------------------ /
478  w1 = max( 0., uproxy * cinv2* ( ecos2*cosu + esin2*sinu ) - 1. )**2
479  !
480  d = (dair / dwat) * sig2 * &
481  (2.8 - ( 1. + tanh(10.*sqrtbn2*w1 - 11.) )) *sqrtbn2*w1
482  !
483  s = d * a
484  !
485  !/ 5) --- calculate reduction factor LFACT using non-directional
486  ! spectral density of the wind input ------------------------- /
487  cinv = cinv2(ikn)
488  sdensig = reshape(s*sig2/cg2,(/ nth,nk /))
489  CALL lfactor(sdensig, cinv, uabs, ustar, usdir, sig, dsii, &
490  lfact, tauwx, tauwy )
491  !
492  !/ 6) --- apply reduction (LFACT) to the entire spectrum ------------- /
493  IF (sum(lfact) .LT. nk) THEN
494  DO ith = 1, nth
495  d(ikn+ith-1) = d(ikn+ith-1) * lfact
496  END DO
497  s = d * a
498  END IF
499  !
500  !/ 7) --- compute negative wind input for adverse winds. negative
501  !/ growth is typically smaller by a factor of ~2.5 (=.28/.11)
502  !/ than those for the favourable winds [Donelan, 2006, Eq. (7)].
503  !/ the factor is adjustable with NAMELIST parameter in
504  !/ ww3_grid.inp: '&SIN6 SINA0 = 0.04 /' ----------------------- /
505  IF (sin6a0.GT.0.0) THEN
506  w2 = min( 0., uproxy * cinv2* ( ecos2*cosu + esin2*sinu ) - 1. )**2
507  d = d - ( (dair / dwat) * sig2 * sin6a0 * &
508  (2.8 - ( 1. + tanh(10.*sqrtbn2*w2 - 11.) )) *sqrtbn2*w2 )
509  s = d * a
510  ! --- compute negative component of the wave supported stresses
511  ! from negative part of the wind input ---------------------- /
512  sdensig = reshape(s*sig2/cg2,(/ nth,nk /))
513  CALL tau_wave_atmos(sdensig, cinv, sig, dsii, taunwx, taunwy )
514  END IF
515  !
516  !/
517  !/ End of W3SIN6 ----------------------------------------------------- /
518  !/

References w3gdatmd::dden2, w3gdatmd::dth, constants::dwat, w3gdatmd::ecos, w3gdatmd::esin, w3servmd::extcde(), constants::grav, w3odatmd::ndse, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::sig2, w3gdatmd::sin6a0, w3gdatmd::sin6ws, w3servmd::strace(), tau_wave_atmos(), and constants::tpi.

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

◆ w3spr6()

subroutine, public w3src6md::w3spr6 ( real, dimension(nth,nk), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nk), intent(in)  WN,
real, intent(out)  EMEAN,
real, intent(out)  FMEAN,
real, intent(out)  WNMEAN,
real, intent(out)  AMAX,
real, intent(out)  FP 
)

Calculate mean wave parameters.

See source term routines.

Parameters
[in,out]AAction as a function of direction and wavenumber.
[in,out]CGGroup velocities.
[in,out]WNWavenumbers.
[in,out]EMEANMean wave energy.
[in,out]FMEANMean wave frequency.
[in,out]WNMEANMean wavenumber.
[in,out]AMAXMaximum action density in spectrum.
[in,out]FPPeak frequency (rad).
Author
S. Zieger
Date
11-Feb-2011

Definition at line 122 of file w3src6md.F90.

122  !/
123  !/ +-----------------------------------+
124  !/ | WAVEWATCH III NOAA/NCEP/NOPP |
125  !/ | S. Zieger |
126  !/ | FORTRAN 90 |
127  !/ | Last update : 11-Feb-2011 |
128  !/ +-----------------------------------+
129  !/
130  !/ 08-Oct-2007 : Origination. ( version 3.13 )
131  !/ 11-Feb-2011 : Implementation based on W3SPR1 ( version 4.04 )
132  !/ (S. Zieger)
133  !/
134  ! 1. Purpose :
135  ! Calculate mean wave parameters.
136  !
137  ! 2. Method :
138  ! See source term routines.
139  !
140  ! 3. Parameters :
141  !
142  ! Parameter list
143  ! ----------------------------------------------------------------
144  ! A R.A. I Action as a function of direction and wavenumber
145  ! CG R.A. I Group velocities
146  ! WN R.A. I Wavenumbers
147  ! EMEAN REAL O Mean wave energy
148  ! FMEAN REAL O Mean wave frequency
149  ! WNMEAN REAL O Mean wavenumber
150  ! AMAX REAL O Maximum action density in spectrum
151  ! FP REAL O Peak frequency (rad)
152  ! ----------------------------------------------------------------
153  !
154  ! 4. Subroutines used :
155  !
156  ! Name Type Module Description
157  ! ----------------------------------------------------------------
158  ! STRACE Subr. W3SERVMD Subroutine tracing.
159  ! ----------------------------------------------------------------
160  !
161  ! 5. Called by :
162  !
163  ! Name Type Module Description
164  ! ----------------------------------------------------------------
165  ! W3SRCE Subr. W3SRCEMD Source term integration.
166  ! W3EXPO Subr. N/A Point output post-processor.
167  ! GXEXPO Subr. N/A GrADS point output post-processor.
168  ! ----------------------------------------------------------------
169  !
170  ! 6. Error messages :
171  !
172  ! None.
173  !
174  ! 7. Remarks :
175  !
176  ! 8. Structure :
177  !
178  ! See source code.
179  !
180  ! 9. Switches :
181  !
182  ! !/S Enable subroutine tracing.
183  !
184  ! 10. Source code :
185  !
186  !/ ------------------------------------------------------------------- /
187  USE constants, ONLY: tpiinv
188  USE w3gdatmd, ONLY: nk, nth, sig, dth, dden, fte, ftf, ftwn, dsii
189  USE w3odatmd, ONLY: ndst, ndse
190  USE w3servmd, ONLY: extcde
191 #ifdef W3_S
192  USE w3servmd, ONLY: strace
193 #endif
194  !/
195  IMPLICIT NONE
196  !/
197  !/ ------------------------------------------------------------------- /
198  !/ Parameter list
199  !/
200  REAL, INTENT(IN) :: A(NTH,NK), CG(NK), WN(NK)
201  REAL, INTENT(OUT) :: EMEAN, FMEAN, WNMEAN, AMAX, FP
202  !/
203  !/ ------------------------------------------------------------------- /
204  !/ Local parameters
205  !/
206 #ifdef W3_S
207  INTEGER, SAVE :: IENT = 0
208 #endif
209  INTEGER :: IMAX
210  REAL :: EB(NK), EBAND
211  REAL, PARAMETER :: HSMIN = 0.05
212  REAL :: COEFF(3)
213  !/
214  !/ ------------------------------------------------------------------- /
215  !/
216 #ifdef W3_S
217  CALL strace (ient, 'W3SPR6')
218 #endif
219  !
220  !
221  ! 1. Integrate over directions -------------------------------------- /
222  eb = sum(a,1) * dden / cg
223  amax = maxval(a)
224  !
225  ! 2. Integrate over wavenumbers ------------------------------------- /
226  emean = sum(eb)
227  fmean = sum(eb / sig(1:nk))
228  wnmean = sum(eb / sqrt(wn))
229  !
230  ! 3. Add tail beyond discrete spectrum and get mean pars ------------ /
231  ! ( DTH * SIG absorbed in FTxx )
232  eband = eb(nk) / dden(nk)
233  emean = emean + eband * fte
234  fmean = fmean + eband * ftf
235  wnmean = wnmean + eband * ftwn
236  !
237  ! 4. Final processing
238  fmean = tpiinv * emean / max(1.0e-7, fmean)
239  wnmean = ( emean / max(1.0e-7,wnmean) )**2
240  !
241  ! 5. Determine peak frequency using a weighted integral ------------- /
242  ! Young (1999) p239: integrate f F**4 df / integrate F**4 df ----- /
243  ! TODO: keep in mind that **fp** calculated in this way may not
244  ! work under mixing (wind-sea and swell) sea states (QL)
245  fp = 0.0
246  !
247  IF (4.0*sqrt(emean) .GT. hsmin) THEN
248  eb = sum(a,1) * sig(1:nk) /cg * dth
249  fp = sum(sig(1:nk) * eb**4 * dsii) / max(1e-10, sum(eb**4 * dsii))
250  fp = fp * tpiinv
251  END IF
252  !
253  RETURN
254  !/
255  !/ End of W3SPR6 ----------------------------------------------------- /
256  !/

References w3gdatmd::dden, w3gdatmd::dsii, w3gdatmd::dth, w3servmd::extcde(), w3gdatmd::fte, w3gdatmd::ftf, w3gdatmd::ftwn, w3odatmd::ndse, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nth, w3gdatmd::sig, w3servmd::strace(), and constants::tpiinv.

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

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::sds6p2
integer, pointer sds6p2
Definition: w3gdatmd.F90:1337
w3src6md::tau_wave_atmos
subroutine tau_wave_atmos(S, CINV, SIG, DSII, TAUNWX, TAUNWY)
Calculated the stress for the negative part of the input term.
Definition: w3src6md.F90:1067
w3gdatmd::dth
real, pointer dth
Definition: w3gdatmd.F90:1232
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3wdatmd
Define data structures to set up wave model dynamic data for several models simultaneously.
Definition: w3wdatmd.F90:18
w3gdatmd::sds6a1
real, pointer sds6a1
Definition: w3gdatmd.F90:1335
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3wdatmd::time
integer, dimension(:), pointer time
Definition: w3wdatmd.F90:172
w3gdatmd::ecos
real, dimension(:), pointer ecos
Definition: w3gdatmd.F90:1234
w3gdatmd::dden2
real, dimension(:), pointer dden2
Definition: w3gdatmd.F90:1234
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3gdatmd::esin
real, dimension(:), pointer esin
Definition: w3gdatmd.F90:1234
w3gdatmd::sds6a2
real, pointer sds6a2
Definition: w3gdatmd.F90:1335
w3servmd
Definition: w3servmd.F90:3
w3gdatmd::dsii
real, dimension(:), pointer dsii
Definition: w3gdatmd.F90:1234
constants::tpiinv
real, parameter tpiinv
TPIINV Inverse of 2*Pi.
Definition: constants.F90:74
w3timemd::stme21
subroutine stme21(TIME, DTME21)
Definition: w3timemd.F90:682
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::sds6et
logical, pointer sds6et
Definition: w3gdatmd.F90:1338
w3gdatmd::sig2
real, dimension(:), pointer sig2
Definition: w3gdatmd.F90:1234
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3gdatmd::xfr
real, pointer xfr
Definition: w3gdatmd.F90:1232
w3gdatmd::sin6ws
real, pointer sin6ws
Definition: w3gdatmd.F90:1335
w3gdatmd::fte
real, pointer fte
Definition: w3gdatmd.F90:1232
w3gdatmd::sds6p1
integer, pointer sds6p1
Definition: w3gdatmd.F90:1337
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
w3servmd::extcde
subroutine extcde(IEXIT, UNIT, MSG, FILE, LINE, COMM)
Definition: w3servmd.F90:736
w3gdatmd::ftf
real, pointer ftf
Definition: w3gdatmd.F90:1232
w3timemd
Definition: w3timemd.F90:3
w3gdatmd::ftwn
real, pointer ftwn
Definition: w3gdatmd.F90:1232
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61
w3gdatmd::sin6a0
real, pointer sin6a0
Definition: w3gdatmd.F90:1335