From 0aa92ed940b5498a11ce0824b47f769c49d51634 Mon Sep 17 00:00:00 2001 From: Aron Roland - wave Date: Wed, 3 Apr 2019 21:27:45 +0200 Subject: [PATCH 1/4] breaking_bugfix: add proper scaling for radian freq. [radHz] --- model/ftn/w3sdb1md.ftn | 13 +++++-------- model/ftn/ww3_grid.ftn | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/model/ftn/w3sdb1md.ftn b/model/ftn/w3sdb1md.ftn index 7d2d93e19..39358b7e7 100644 --- a/model/ftn/w3sdb1md.ftn +++ b/model/ftn/w3sdb1md.ftn @@ -68,11 +68,9 @@ ! Compute depth-induced breaking using Battjes and Janssen bore ! model approach ! -! 2. Method : +! 2. Method : Battjes & Janssen (1979), ! -! Sdb = - CDB * FMEAN * QB * B * B * SPEC -! -! Where CDB = SDBC1 = 0.25 * BJALFA (defaults to BJALFA = 1) +! Where CDB = SDBC1 = BJALFA (defaults to BJALFA = 1) ! modified via ww3_grid namelist parameter BJALFA ! B = HM / HRMS ! HM = GAMMA * DEP @@ -179,7 +177,7 @@ ! !/T WRITE (NDST,9000) SDBC1, SDBC2, FDONLY ! -! 1. Integral quantities ... only for the case when it is used nonlinear in the solver ... +! 1. Integral quantities. AR: make sure mean quantities are computed, need to move upward ! ETOT = 0. FMEAN2 = 0. @@ -256,9 +254,9 @@ IF (IWB == 1) THEN IF ( ( BB .GT. THR) .AND. ( ABS ( BB - QB ) .GT. THR) ) THEN IF ( BB .LT. 1.0) THEN - CBJ = DBLE(SDBC1) * QB * DBLE(FMEAN) / BB + CBJ = 2 * DBLE(SDBC1) * QB * DBLE(FMEAN) / BB ELSE - CBJ = DBLE(SDBC1) * DBLE(FMEAN) * BB ! Make sure the energy vanishes ... + CBJ = 2 * DBLE(SDBC1) * DBLE(FMEAN) * BB ! Make sure the energy vanishes ... END IF ELSE CBJ = 0.d0 @@ -275,7 +273,6 @@ ENDIF D = - CBJ S = D * A - ELSE IF (IWB == 3) THEN ENDIF IF (CBJ .GT. 0.) THEN diff --git a/model/ftn/ww3_grid.ftn b/model/ftn/ww3_grid.ftn index 3234e79f2..6b22d97b5 100644 --- a/model/ftn/ww3_grid.ftn +++ b/model/ftn/ww3_grid.ftn @@ -1888,7 +1888,7 @@ !/DB1 ' Using Hmax/d in Miche style formulation.' !/DB1 END IF !/DB1 WRITE (NDSO,*) -!/DB1 SDBC1 = 0.25 * BJALFA +!/DB1 SDBC1 = BJALFA !/DB1 SDBC2 = BJGAM !/DB1 FDONLY = BJFLAG ! From 3421754e504cec782bff47dc54ea52b583b3aafb Mon Sep 17 00:00:00 2001 From: Aron Roland - wave Date: Wed, 3 Apr 2019 21:38:33 +0200 Subject: [PATCH 2/4] breaking_bugfix: Add some comments ... --- model/ftn/w3sdb1md.ftn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/model/ftn/w3sdb1md.ftn b/model/ftn/w3sdb1md.ftn index 39358b7e7..e75b798cc 100644 --- a/model/ftn/w3sdb1md.ftn +++ b/model/ftn/w3sdb1md.ftn @@ -256,14 +256,16 @@ IF ( BB .LT. 1.0) THEN CBJ = 2 * DBLE(SDBC1) * QB * DBLE(FMEAN) / BB ELSE - CBJ = 2 * DBLE(SDBC1) * DBLE(FMEAN) * BB ! Make sure the energy vanishes ... + CBJ = 2 * DBLE(SDBC1) * DBLE(FMEAN) * BB + ! AR: The multiplication with BB is kind of experimental, it basically to avoid to high gamma values in the solution when BB > 1 + ! AR: It is obvious that for BB > 1 .. CBJ is getting smaller for the original equation ... not really what you would expect. END IF ELSE CBJ = 0.d0 ENDIF D = - CBJ S = D * A - ELSE IF (IWB == 2) THEN + ELSE IF (IWB == 2) THEN IF (ETOT .GT. THR) THEN HRMS = SQRT(8*EMEAN) FAK = (1+4./SQRT(PI)*(B*BB+1.5*B)*exp(-BB)-ERF(B)) From 92e2ec554a0df075818084caaea420461adb83c5 Mon Sep 17 00:00:00 2001 From: Aron Roland - wave Date: Thu, 4 Apr 2019 19:14:41 +0200 Subject: [PATCH 3/4] update comments ... --- model/ftn/w3sdb1md.ftn | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/model/ftn/w3sdb1md.ftn b/model/ftn/w3sdb1md.ftn index e75b798cc..8f42d0223 100644 --- a/model/ftn/w3sdb1md.ftn +++ b/model/ftn/w3sdb1md.ftn @@ -57,25 +57,38 @@ !/ | FORTRAN 90 | !/ | J. H. Alves | !/ | H. L. Tolman | +!/ ! A. Roland | !/ | Last update : 08-Jun-2018 | !/ +-----------------------------------+ !/ !/ 25-Apr-2007 : Origination of module. ( version 3.11 ) !/ 08-Jun-2018 : Add DEBUGDB1. ( version 6.04 ) +!/ 03-Apr-2019 : Rewrite in terms of energy density (A. Roland, version 6.07) +!/ 03-Apr-2019 : Add Thornton & Guza, 1983 (A. Roland, version 6.07) + !/ ! 1. Purpose : ! ! Compute depth-induced breaking using Battjes and Janssen bore ! model approach ! -! 2. Method : Battjes & Janssen (1979), -! -! Where CDB = SDBC1 = BJALFA (defaults to BJALFA = 1) -! modified via ww3_grid namelist parameter BJALFA -! B = HM / HRMS -! HM = GAMMA * DEP -! GAMMA = SDBC2 defaults to 0.73 (mean Battjes/Janssen value) -! modified via ww3_grid namelist parameter BJGAM +! 2. Method : Battjes & Janssen (1978), +! +! Sbr = Dtot/Etot*WA = D * WA +! Dtot = 0.25*alpha*Qb*fm*Hmax² +! fm = sigma/2Pi +! BB = Hrms²/Hmax² = 8Etot/Hmax² +! D = Dtot/Etot = BJALFA * sigma / pi * Qb/BB = 2 * BJALFA * fm * Qb/BB +! +! only valid for Hrms .le. Hm, Qb .le. 1, otherwise, in the degenrative regime it is +! due to Qb > 1 that all wave are broken and Hrms .le. Hmax +! MLIM can be used to enforce this conditions, source term will smoothly converge to this limit. +! +! Where CDB = SDBC1 = BJALFA (defaults to BJALFA = 1) +! modified via ww3_grid namelist parameter BJALFA +! HM = GAMMA * DEP +! GAMMA = SDBC2 defaults to 0.73 (mean Battjes/Janssen value) +! modified via ww3_grid namelist parameter BJGAM ! ! And QB is estimated by iterations using the nonlinear expression ! @@ -143,7 +156,6 @@ !/ INTEGER, INTENT(IN) :: IX ! Local grid number REAL, INTENT(IN) :: A(NSPEC) -!AR: This below is not good I know ... we need more inlined methods ... REAL, INTENT(INOUT) :: EMEAN, FMEAN, WNMEAN, DEPTH REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC) REAL, INTENT(IN) :: CG(NK) @@ -256,9 +268,7 @@ IF ( BB .LT. 1.0) THEN CBJ = 2 * DBLE(SDBC1) * QB * DBLE(FMEAN) / BB ELSE - CBJ = 2 * DBLE(SDBC1) * DBLE(FMEAN) * BB - ! AR: The multiplication with BB is kind of experimental, it basically to avoid to high gamma values in the solution when BB > 1 - ! AR: It is obvious that for BB > 1 .. CBJ is getting smaller for the original equation ... not really what you would expect. + CBJ = 2 * DBLE(SDBC1) * DBLE(FMEAN) * BB ! AR: degenerative regime, all waves must be .le. Hmax, we just smoothly let the excessive energy vanish by * BB. END IF ELSE CBJ = 0.d0 From d0fb168104430e11182e753a18f29261d3b4ee73 Mon Sep 17 00:00:00 2001 From: Aron Roland - wave Date: Thu, 4 Apr 2019 19:21:19 +0200 Subject: [PATCH 4/4] update comments ... --- model/ftn/w3sdb1md.ftn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/ftn/w3sdb1md.ftn b/model/ftn/w3sdb1md.ftn index 8f42d0223..f34501b6d 100644 --- a/model/ftn/w3sdb1md.ftn +++ b/model/ftn/w3sdb1md.ftn @@ -63,8 +63,8 @@ !/ !/ 25-Apr-2007 : Origination of module. ( version 3.11 ) !/ 08-Jun-2018 : Add DEBUGDB1. ( version 6.04 ) -!/ 03-Apr-2019 : Rewrite in terms of energy density (A. Roland, version 6.07) -!/ 03-Apr-2019 : Add Thornton & Guza, 1983 (A. Roland, version 6.07) +!/ 03-Apr-2019 : Rewrite in terms of energy density (A. Roland, version 7.00) +!/ 03-Apr-2019 : Add Thornton & Guza, 1983 (A. Roland, version 7.00) !/ ! 1. Purpose : @@ -80,7 +80,7 @@ ! BB = Hrms²/Hmax² = 8Etot/Hmax² ! D = Dtot/Etot = BJALFA * sigma / pi * Qb/BB = 2 * BJALFA * fm * Qb/BB ! -! only valid for Hrms .le. Hm, Qb .le. 1, otherwise, in the degenrative regime it is +! AR: only valid for Hrms .le. Hm, Qb .le. 1, otherwise, in the degenrative regime it is ! due to Qb > 1 that all wave are broken and Hrms .le. Hmax ! MLIM can be used to enforce this conditions, source term will smoothly converge to this limit. !