From 27a82cce60d2da14bfc6673c74a9163cb01b46f2 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Tue, 21 Oct 2025 11:45:24 +0000 Subject: [PATCH 1/3] correct TH2M computation and test in ww3_tp2.3 --- model/src/w3iogomd.F90 | 2 +- regtests/ww3_tp2.3/input/ww3_ounf.inp | 2 +- regtests/ww3_tp2.3/input/ww3_ounf.nml | 2 +- regtests/ww3_tp2.3/input/ww3_shel.inp | 2 +- regtests/ww3_tp2.3/input/ww3_shel.nml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index 91a82f9001..c4c78191ed 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -1684,7 +1684,7 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) IF ( FLOLOC( 3, 3).AND.(IK.GE.E3DF(2,3).AND.IK.LE.E3DF(3,3))) & STH1M(JSEA,IK)= SQRT(ABS(2.*(1-M1)))*RADE IF ( FLOLOC( 3, 4).AND.(IK.GE.E3DF(2,4).AND.IK.LE.E3DF(3,4))) & - TH2M(JSEA,IK)= MOD ( 270. - RADE*0.5*ATAN2(ABY2(JSEA),AB2X(JSEA)) , 180. ) + TH2M(JSEA,IK)= MOD ( 270. - RADE*0.5*ATAN2(AB2Y(JSEA),AB2X(JSEA)) , 180. ) M2 = SQRT(AB2X(JSEA)**2+AB2Y(JSEA)**2)/MAX(1E-20,AB(JSEA)) IF ( FLOLOC( 3, 5).AND.(IK.GE.E3DF(2,5).AND.IK.LE.E3DF(3,5))) & STH2M(JSEA,IK)= SQRT(ABS(0.5*(1-M2)))*RADE diff --git a/regtests/ww3_tp2.3/input/ww3_ounf.inp b/regtests/ww3_tp2.3/input/ww3_ounf.inp index b0c2404f0d..4fb0a9dde9 100644 --- a/regtests/ww3_tp2.3/input/ww3_ounf.inp +++ b/regtests/ww3_tp2.3/input/ww3_ounf.inp @@ -13,7 +13,7 @@ $ file for a full documentation of field output options. Namelist type $ selection is used here (for alternative F/T flags, see ww3_shel.inp). $ N - HS DIR SPR DP EF TH1M STH1M + HS DIR SPR DP EF TH1M STH1M TH2M STH2M $ $--------------------------------------------------------------------- $ $ netCDF version [3,4] diff --git a/regtests/ww3_tp2.3/input/ww3_ounf.nml b/regtests/ww3_tp2.3/input/ww3_ounf.nml index 034cc7cdcc..4244fcf3db 100644 --- a/regtests/ww3_tp2.3/input/ww3_ounf.nml +++ b/regtests/ww3_tp2.3/input/ww3_ounf.nml @@ -9,7 +9,7 @@ FIELD%TIMESTART = '19680606 000000' FIELD%TIMESTRIDE = '86400.' FIELD%TIMECOUNT = '999' - FIELD%LIST = 'HS DIR SPR DP EF TH1M STH1M' + FIELD%LIST = 'HS DIR SPR DP EF TH1M STH1M TH2M STH2M' FIELD%PARTITION = '0 1 2' FIELD%TYPE = 4 / diff --git a/regtests/ww3_tp2.3/input/ww3_shel.inp b/regtests/ww3_tp2.3/input/ww3_shel.inp index 2d69bd5e4a..ad588a3b7e 100644 --- a/regtests/ww3_tp2.3/input/ww3_shel.inp +++ b/regtests/ww3_tp2.3/input/ww3_shel.inp @@ -18,7 +18,7 @@ $ 19680606 000000 86400 19680611 000000 $ (1) Forcing Fields N -HS DIR SPR DP EF TH1M STH1M +HS DIR SPR DP EF TH1M STH1M TH2M STH2M $ 19680606 000000 0 19680608 000000 19680606 000000 0 19680608 000000 diff --git a/regtests/ww3_tp2.3/input/ww3_shel.nml b/regtests/ww3_tp2.3/input/ww3_shel.nml index 8b5e606293..42b29b1879 100644 --- a/regtests/ww3_tp2.3/input/ww3_shel.nml +++ b/regtests/ww3_tp2.3/input/ww3_shel.nml @@ -21,7 +21,7 @@ ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML - TYPE%FIELD%LIST = 'HS DIR SPR DP EF TH1M STH1M' + TYPE%FIELD%LIST = 'HS DIR SPR DP EF TH1M STH1M TH2M STH2M' / ! -------------------------------------------------------------------- ! From 65e5c443c8dcc41e476e199207f2d2a6eee422c3 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Thu, 23 Oct 2025 15:24:06 +0000 Subject: [PATCH 2/3] correct formula in manual --- manual/eqs/output.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/eqs/output.tex b/manual/eqs/output.tex index ef9e38c664..174b3adfef 100644 --- a/manual/eqs/output.tex +++ b/manual/eqs/output.tex @@ -128,7 +128,7 @@ \subsection{~Output parameters} \label{sub:outpars} \frac{a_1(f)^2+b_1(f)^2}{E(f)^2} \right )^{1/2} \right \} \right ]^{1/2} \: , \label{eq:sig_th1} \end{equation} \item \textbf{TH2M} Mean direction from $a_2$ and $b_2$ (degr.) - \begin{equation} \theta_2 (f)= \mbox{atan} \left ( \frac{b_2(f)}{a_2(f)} \right ) + \begin{equation} \theta_2 (f)= 0.5 \mbox{atan} \left ( \frac{b_2(f)}{a_2(f)} \right ) \: , \label{eq:theta_2} \end{equation} \begin{equation} a_2(f) = 2 \pi \int_0^{2\pi} \int_0^\infty \cos(2 \theta) F(\sigma,\theta) \: \mathrm{d}\theta \: , \end{equation} \begin{equation} From fb1b307636384531434e9359c98d7b561f3501c1 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Mon, 27 Oct 2025 09:05:09 +0000 Subject: [PATCH 3/3] activate th2m and sth2m --- regtests/ww3_tp2.3/input/namelists_GARDEN.nml | 2 +- regtests/ww3_tp2.3/input/ww3_grid.inp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regtests/ww3_tp2.3/input/namelists_GARDEN.nml b/regtests/ww3_tp2.3/input/namelists_GARDEN.nml index b8533dddaa..4069e95450 100644 --- a/regtests/ww3_tp2.3/input/namelists_GARDEN.nml +++ b/regtests/ww3_tp2.3/input/namelists_GARDEN.nml @@ -1,4 +1,4 @@ -&OUTS E3D=1, TH1MF=1, STH1MF=1 / +&OUTS E3D=1, TH1MF=1, STH1MF=1,TH2MF=1, STH2MF=1 / &PRO2 DTIME=345600. / &PRO3 WDTHTH=1.50, WDTHCG=1.50 / END OF NAMELISTS diff --git a/regtests/ww3_tp2.3/input/ww3_grid.inp b/regtests/ww3_tp2.3/input/ww3_grid.inp index 3a42713071..a6794bcd6e 100644 --- a/regtests/ww3_tp2.3/input/ww3_grid.inp +++ b/regtests/ww3_tp2.3/input/ww3_grid.inp @@ -16,7 +16,7 @@ $ $ $ Activated up to one line per namelist !! $ - &OUTS E3D=1, TH1MF=1, STH1MF=1 / + &OUTS E3D=1, TH1MF=1, STH1MF=1, TH2MF=1, STH2MF=1 / $ &PRO2 DTIME= 0. / $ &PRO2 DTIME=172800. / &PRO2 DTIME=345600. /