From 69a15d1c1df3e84a846319affbab8aa5f8e59061 Mon Sep 17 00:00:00 2001 From: pieterbartsmit Date: Mon, 15 Jun 2026 19:43:29 -0700 Subject: [PATCH 1/4] Changes to WW3 to allow for a wind-dependent betamax calculation. Specifically we implement a relation of the form: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit betamax_eff = BETAMAX_INTERCEPT + min(U10, 25) * BETAMAX_SLOPE where BETAMAX_INTERCEPT and BETAMAX_SLOPE are currently hardcoded parameters for testing purposes (both positive and negative slopes are meaningful). The 25 m/s cap is intentional: air-sea physics become uncertain beyond that wind speed. Note: the HF tail stress is precomputed in a lookup table using a fixed betamax (from the namelist). When betamax_eff differs from that value, the table result must be rescaled — this is done at line 968. --- model/src/w3src4md.F90 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index bfbb85e66..3220ac6f1 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -551,6 +551,13 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & REAL :: COSU, SINU, TAUX, TAUY, USDIRP, USTP REAL :: TAUPX, TAUPY, UST2, TAUW, TAUWB REAL , PARAMETER :: EPS1 = 0.00001, EPS2 = 0.000001 + + REAL :: BBETA_EFF !PBS: The effective "betamax" after we apply a linear approximation. + ! Part of SOFAR enhancements to be able to better calibrate betamax + ! Estimated as BBETA_EFF= BETAMAX_INTERCEPT + BETAMAX_SLOPE * U + REAL , PARAMETER :: BETAMAX_INTERCEPT=1.43 ! Intercept of the linear betamax relation + REAL , PARAMETER :: BETAMAX_SLOPE=0.0 ! Slope of the linear betamax relation + #if defined(W3_T) || defined(W3_STAB3) REAL :: Usigma !standard deviation of U due to gustiness REAL :: USTARsigma !standard deviation of USTAR due to gustiness @@ -602,9 +609,11 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & STRESSSTABN =0. ! ! Coupling coefficient times density ratio DRAT - ! - CONST1=BBETA/KAPPA**2 ! needed for the tail - CONST0=CONST1*DRAT ! needed for the resolved spectrum + ! PBS: Instead of a constant betamax we use a betamax linearly dependent on wind speed to allow for more flexibility + ! in calibration. (SOFAR SPECIFIC) + BBETA_EFF = BETAMAX_INTERCEPT + BETAMAX_SLOPE * MIN(U, 25.0) + CONST1=BBETA_EFF/KAPPA**2 ! needed for the tail + CONST0=CONST1*DRAT ! needed for the resolved spectrum ! ! 1.a estimation of surface roughness parameters ! @@ -957,6 +966,10 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & TAU1 =(TAUHFT(IND,J)*DELI2+TAUHFT(IND+1,J)*DELI1 )*DELJ2 & +(TAUHFT(IND,J+1)*DELI2+TAUHFT(IND+1,J+1)*DELI1)*DELJ1 END IF + + ! PBS - SOFAR: Because we recompute betamax based on windspeed we have to reschale the tabulated tail + ! contributions with the new betamax value + TAU1 = TAU1 * (BBETA_EFF / BBETA) ! TAUHF = LEVTAIL0*UST**2*TAU1 END IF ! End of test on use of table From f9637e5fa7e61d4de0d9e1892a025555fead2439 Mon Sep 17 00:00:00 2001 From: pieterbartsmit Date: Mon, 29 Jun 2026 11:45:03 -0700 Subject: [PATCH 2/4] Rebase onto the new ww3 codebase. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9ad4d4f29..4f43a44be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.14 +7.14.2 From c374e1513061304ddc844d59b65ff6673146a2c8 Mon Sep 17 00:00:00 2001 From: pieterbartsmit Date: Mon, 29 Jun 2026 15:27:40 -0700 Subject: [PATCH 3/4] Added realistic values from our calibration for the parameters. Also included a cap to ensure the value remains between 1.26 and 1.46. --- model/src/w3src4md.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index 3220ac6f1..99de02620 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -555,8 +555,8 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & REAL :: BBETA_EFF !PBS: The effective "betamax" after we apply a linear approximation. ! Part of SOFAR enhancements to be able to better calibrate betamax ! Estimated as BBETA_EFF= BETAMAX_INTERCEPT + BETAMAX_SLOPE * U - REAL , PARAMETER :: BETAMAX_INTERCEPT=1.43 ! Intercept of the linear betamax relation - REAL , PARAMETER :: BETAMAX_SLOPE=0.0 ! Slope of the linear betamax relation + REAL , PARAMETER :: BETAMAX_INTERCEPT=1.134 ! Intercept of the linear betamax relation + REAL , PARAMETER :: BETAMAX_SLOPE=0.0155 ! Slope of the linear betamax relation #if defined(W3_T) || defined(W3_STAB3) REAL :: Usigma !standard deviation of U due to gustiness @@ -611,7 +611,8 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & ! Coupling coefficient times density ratio DRAT ! PBS: Instead of a constant betamax we use a betamax linearly dependent on wind speed to allow for more flexibility ! in calibration. (SOFAR SPECIFIC) - BBETA_EFF = BETAMAX_INTERCEPT + BETAMAX_SLOPE * MIN(U, 25.0) + BBETA_EFF = MAX( MIN( BETAMAX_INTERCEPT + BETAMAX_SLOPE * U, 1.26 ), 1.46) + CONST1=BBETA_EFF/KAPPA**2 ! needed for the tail CONST0=CONST1*DRAT ! needed for the resolved spectrum ! From 5ae8660b0fffe20b6db3e74d58f26402df8cfe74 Mon Sep 17 00:00:00 2001 From: pieterbartsmit Date: Tue, 30 Jun 2026 09:25:29 -0700 Subject: [PATCH 4/4] Updated to latest estimates for slope/intercept. Updated the upperbound on bbeta_eff to 1.5, lower bound to 1.25 Fixed an issue with how the bounds were inforced (I had swapped the min/max conditions which would have forced the bbeta_eff to be outside the [1.25, 1.5] interval instead of bounded by it). --- model/src/w3src4md.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index 99de02620..d3f2cd429 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -556,7 +556,7 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & ! Part of SOFAR enhancements to be able to better calibrate betamax ! Estimated as BBETA_EFF= BETAMAX_INTERCEPT + BETAMAX_SLOPE * U REAL , PARAMETER :: BETAMAX_INTERCEPT=1.134 ! Intercept of the linear betamax relation - REAL , PARAMETER :: BETAMAX_SLOPE=0.0155 ! Slope of the linear betamax relation + REAL , PARAMETER :: BETAMAX_SLOPE=0.0157 ! Slope of the linear betamax relation #if defined(W3_T) || defined(W3_STAB3) REAL :: Usigma !standard deviation of U due to gustiness @@ -611,7 +611,7 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & ! Coupling coefficient times density ratio DRAT ! PBS: Instead of a constant betamax we use a betamax linearly dependent on wind speed to allow for more flexibility ! in calibration. (SOFAR SPECIFIC) - BBETA_EFF = MAX( MIN( BETAMAX_INTERCEPT + BETAMAX_SLOPE * U, 1.26 ), 1.46) + BBETA_EFF = MAX( MIN( BETAMAX_INTERCEPT + BETAMAX_SLOPE * U, 1.5 ), 1.25) CONST1=BBETA_EFF/KAPPA**2 ! needed for the tail CONST0=CONST1*DRAT ! needed for the resolved spectrum