From a7d7bf7825e6f090ade613de5b7debd82a6467ce Mon Sep 17 00:00:00 2001 From: sanderh Date: Fri, 6 May 2022 10:17:52 +0200 Subject: [PATCH 1/7] :star: DTP=1 in misc namelist requests discrete peak period --- model/ftn/w3odatmd.ftn | 1 + model/ftn/w3partmd.ftn | 11 +++++++---- model/ftn/ww3_grid.ftn | 12 ++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/model/ftn/w3odatmd.ftn b/model/ftn/w3odatmd.ftn index 613b63ac0..5a96524a3 100644 --- a/model/ftn/w3odatmd.ftn +++ b/model/ftn/w3odatmd.ftn @@ -492,6 +492,7 @@ LOGICAL, POINTER :: FLFORM, FLCOMB, O6INIT INTEGER, POINTER :: PTMETH ! C. Bunney; Partitioning method REAL, POINTER :: PTFCUT ! C. Bunney; Part. 5 freq cut + LOGICAL, POINTER :: DISTP ! SH; request discrete peak period !/ CONTAINS !/ ------------------------------------------------------------------- / diff --git a/model/ftn/w3partmd.ftn b/model/ftn/w3partmd.ftn index f8be477d7..6c149c7e7 100644 --- a/model/ftn/w3partmd.ftn +++ b/model/ftn/w3partmd.ftn @@ -65,7 +65,8 @@ ! !/ ------------------------------------------------------------------- / ! - USE W3ODATMD, ONLY: IHMAX, HSPMIN, WSMULT, DIMP, PTMETH, PTFCUT + USE W3ODATMD, ONLY: IHMAX, HSPMIN, WSMULT, DIMP, PTMETH, PTFCUT, & + DISTP ! PUBLIC ! @@ -147,6 +148,8 @@ ! 5) 2-band partitioning; produces hi and low freqency band partitions ! using a user-defined cutoff frequency (PTFCUT). [DIMXP = 2] ! +! set DTP = 1 in the MISC namelist to request discrete peak period +! ! (Chris Bunney, UK Met Office, Jul 2018) ! ! 8. Structure : @@ -1272,16 +1275,16 @@ EH = SUMF(IFPMAX(IP)+1,IP) - SUMF(IFPMAX(IP),IP) DENOM = XL*EH - XH*EL SIGP = SIG(IFPMAX(IP)) - IF (DENOM.NE.0.) THEN + !/ --- Parabolic fit around the spectral peak --- + IF (.NOT.DISTP .AND. DENOM.NE.0.) THEN SIGP = SIGP *( 1. + 0.5 * ( XL2*EH - XH2*EL ) & / SIGN ( ABS(DENOM) , DENOM ) ) END IF CALL WAVNU1 ( SIGP, DEPTH, WNP, CGP ) ! - !/ --- Parabolic fit around the spectral peak --- IK = IFPMAX(IP) EFPMAX(IP) = SUMF(IK,IP) * DTH - IF (IK.GT.1 .AND. IK.LT.NK) THEN + IF (.NOT.DISTP .AND. IK.GT.1 .AND. IK.LT.NK) THEN EL = SUMF(IK-1,IP) * DTH EH = SUMF(IK+1,IP) * DTH NUMER = 0.125 * ( EL - EH )**2 diff --git a/model/ftn/ww3_grid.ftn b/model/ftn/ww3_grid.ftn index 6b22d97b5..3ed0cbbf2 100644 --- a/model/ftn/ww3_grid.ftn +++ b/model/ftn/ww3_grid.ftn @@ -514,7 +514,7 @@ USE W3ODATMD, ONLY: NBI, NBI2, NFBPO, NBO, NBO2, FLBPI, FLBPO, & IPBPO, ISBPO, XBPO, YBPO, RDBPO, FNMPRE, & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, & - NOSWLL, PTMETH, PTFCUT + NOSWLL, PTMETH, PTFCUT, DISTP USE W3TIMEMD, ONLY: NOLEAP USE W3NMLGRIDMD ! @@ -705,6 +705,8 @@ REAL(8) :: GSHIFT ! see notes in WMGHGH LOGICAL :: FLC, ICEDISP, TRCKCMPR INTEGER :: PTM ! Partitioning method + INTEGER :: DTP ! smoothed (0) or discrete (1) peak + ! period REAL :: PTFC ! Part. cut off freq (for method 5) CHARACTER :: PMNAME*45, PMNAM2*45 ! Part. method desc. !/FLD1 INTEGER :: TAILTYPE @@ -886,7 +888,7 @@ STDX, STDY, STDT, ICEHMIN, ICEHINIT, ICEDISP, & ICESLN, ICEWIND, ICESNL, ICESDS, ICEHFAC, & ICEHDISP, ICEDDISP, ICEFDISP, NOLEAP, TRCKCMPR, & - PTM, PTFC, BTBET + PTM, PTFC, BTBET, DTP NAMELIST /OUTS/ P2SF, I1P2SF, I2P2SF, & US3D, I1US3D, I2US3D, & USSP, IUSSP, STK_WN, & @@ -2191,6 +2193,7 @@ TRCKCMPR = .TRUE. NOSW = 5 PTM = 1 ! Default to standard WW3 partitioning. C. Bunney + DTP = 0 ! Default to smoothed tp PTFC = 0.1 ! Part. method 5 cutoff freq default. C. Bunney FMICHE = 1.6 RWNDC = 1. @@ -2502,6 +2505,11 @@ WSCUT = MIN ( 1.0001 , MAX ( 0. , WSC ) ) FLCOMB = FLC NOSWLL = MAX ( 1 , NOSW ) + IF ( DTP == 1 ) THEN + DISTP = .TRUE. ! discrete tp + ELSE + DISTP = .FALSE. ! smoothed tp + END IF PTMETH = PTM ! Partitioning method. Chris Bunney (Jan 2016) PTFCUT = PTFC ! Freq cutoff for partitiong method 5 PMNAM2 = "" From 0155d1a0aca8801acb56b150ae5005682ec4a969 Mon Sep 17 00:00:00 2001 From: sanderh Date: Fri, 6 May 2022 11:49:38 +0200 Subject: [PATCH 2/7] :recycle: DISCRTP=1 in misc namelist requests discrete peak period --- model/ftn/w3odatmd.ftn | 2 +- model/ftn/ww3_grid.ftn | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/model/ftn/w3odatmd.ftn b/model/ftn/w3odatmd.ftn index 5a96524a3..090297a2a 100644 --- a/model/ftn/w3odatmd.ftn +++ b/model/ftn/w3odatmd.ftn @@ -492,7 +492,7 @@ LOGICAL, POINTER :: FLFORM, FLCOMB, O6INIT INTEGER, POINTER :: PTMETH ! C. Bunney; Partitioning method REAL, POINTER :: PTFCUT ! C. Bunney; Part. 5 freq cut - LOGICAL, POINTER :: DISTP ! SH; request discrete peak period + INTEGER, POINTER :: DISTP ! SH; request discrete peak period !/ CONTAINS !/ ------------------------------------------------------------------- / diff --git a/model/ftn/ww3_grid.ftn b/model/ftn/ww3_grid.ftn index 3ed0cbbf2..fae71efb6 100644 --- a/model/ftn/ww3_grid.ftn +++ b/model/ftn/ww3_grid.ftn @@ -704,10 +704,10 @@ ! REAL(8) :: GSHIFT ! see notes in WMGHGH LOGICAL :: FLC, ICEDISP, TRCKCMPR - INTEGER :: PTM ! Partitioning method - INTEGER :: DTP ! smoothed (0) or discrete (1) peak - ! period - REAL :: PTFC ! Part. cut off freq (for method 5) + INTEGER :: PTM ! Partitioning method + INTEGER :: DISCRTP ! smoothed (0) or discrete (1) peak + ! period + REAL :: PTFC ! Part. cut off freq (for method 5) CHARACTER :: PMNAME*45, PMNAM2*45 ! Part. method desc. !/FLD1 INTEGER :: TAILTYPE !/FLD1 REAL :: TAILLEV, TAILT1, TAILT2 @@ -888,7 +888,7 @@ STDX, STDY, STDT, ICEHMIN, ICEHINIT, ICEDISP, & ICESLN, ICEWIND, ICESNL, ICESDS, ICEHFAC, & ICEHDISP, ICEDDISP, ICEFDISP, NOLEAP, TRCKCMPR, & - PTM, PTFC, BTBET, DTP + PTM, PTFC, BTBET, DISCRTP NAMELIST /OUTS/ P2SF, I1P2SF, I2P2SF, & US3D, I1US3D, I2US3D, & USSP, IUSSP, STK_WN, & @@ -2193,7 +2193,7 @@ TRCKCMPR = .TRUE. NOSW = 5 PTM = 1 ! Default to standard WW3 partitioning. C. Bunney - DTP = 0 ! Default to smoothed tp + DISCRTP= 0 ! Default to smoothed tp PTFC = 0.1 ! Part. method 5 cutoff freq default. C. Bunney FMICHE = 1.6 RWNDC = 1. @@ -2505,11 +2505,7 @@ WSCUT = MIN ( 1.0001 , MAX ( 0. , WSC ) ) FLCOMB = FLC NOSWLL = MAX ( 1 , NOSW ) - IF ( DTP == 1 ) THEN - DISTP = .TRUE. ! discrete tp - ELSE - DISTP = .FALSE. ! smoothed tp - END IF + DISTP = DISCRTP ! discrete(1) or smoothed(0) tp PTMETH = PTM ! Partitioning method. Chris Bunney (Jan 2016) PTFCUT = PTFC ! Freq cutoff for partitiong method 5 PMNAM2 = "" From 91f6696323e8186e088aeb4da138d380423f70c0 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 6 May 2022 11:53:49 +0000 Subject: [PATCH 3/7] :recycle: DISTP is an integer, not logical --- model/ftn/w3partmd.ftn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/ftn/w3partmd.ftn b/model/ftn/w3partmd.ftn index 6c149c7e7..e959954fb 100644 --- a/model/ftn/w3partmd.ftn +++ b/model/ftn/w3partmd.ftn @@ -1276,7 +1276,7 @@ DENOM = XL*EH - XH*EL SIGP = SIG(IFPMAX(IP)) !/ --- Parabolic fit around the spectral peak --- - IF (.NOT.DISTP .AND. DENOM.NE.0.) THEN + IF (DISTP.NE.1 .AND. DENOM.NE.0.) THEN SIGP = SIGP *( 1. + 0.5 * ( XL2*EH - XH2*EL ) & / SIGN ( ABS(DENOM) , DENOM ) ) END IF @@ -1284,7 +1284,7 @@ ! IK = IFPMAX(IP) EFPMAX(IP) = SUMF(IK,IP) * DTH - IF (.NOT.DISTP .AND. IK.GT.1 .AND. IK.LT.NK) THEN + IF (DISTP.NE.1 .AND. IK.GT.1 .AND. IK.LT.NK) THEN EL = SUMF(IK-1,IP) * DTH EH = SUMF(IK+1,IP) * DTH NUMER = 0.125 * ( EL - EH )**2 From c118c330698d733d88a94430dd52f66f09eaeaab Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 6 May 2022 14:47:48 +0000 Subject: [PATCH 4/7] :recycle: request discrete tp is a boolean --- model/ftn/w3odatmd.ftn | 4 +++- model/ftn/w3partmd.ftn | 4 ++-- model/ftn/ww3_grid.ftn | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/model/ftn/w3odatmd.ftn b/model/ftn/w3odatmd.ftn index 090297a2a..dd413c6ae 100644 --- a/model/ftn/w3odatmd.ftn +++ b/model/ftn/w3odatmd.ftn @@ -390,6 +390,7 @@ LOGICAL :: FLFORM, FLCOMB, O6INIT INTEGER :: PTMETH ! C. Bunney; Partitioning method REAL :: PTFCUT ! C. Bunney; Part. 5 freq cut + LOGICAL :: DISTP ! SH; discrete Tp END TYPE OTYPE6 !/ TYPE OUTPUT @@ -492,7 +493,7 @@ LOGICAL, POINTER :: FLFORM, FLCOMB, O6INIT INTEGER, POINTER :: PTMETH ! C. Bunney; Partitioning method REAL, POINTER :: PTFCUT ! C. Bunney; Part. 5 freq cut - INTEGER, POINTER :: DISTP ! SH; request discrete peak period + LOGICAL, POINTER :: DISTP ! SH; request discrete peak period !/ CONTAINS !/ ------------------------------------------------------------------- / @@ -1647,6 +1648,7 @@ PTMETH => OUTPTS(IMOD)%OUT6%PTMETH PTFCUT => OUTPTS(IMOD)%OUT6%PTFCUT FLFORM => OUTPTS(IMOD)%OUT6%FLFORM + DISTP => OUTPTS(IMOD)%OUT6%DISTP O6INIT => OUTPTS(IMOD)%OUT6%O6INIT ! RETURN diff --git a/model/ftn/w3partmd.ftn b/model/ftn/w3partmd.ftn index e959954fb..6c149c7e7 100644 --- a/model/ftn/w3partmd.ftn +++ b/model/ftn/w3partmd.ftn @@ -1276,7 +1276,7 @@ DENOM = XL*EH - XH*EL SIGP = SIG(IFPMAX(IP)) !/ --- Parabolic fit around the spectral peak --- - IF (DISTP.NE.1 .AND. DENOM.NE.0.) THEN + IF (.NOT.DISTP .AND. DENOM.NE.0.) THEN SIGP = SIGP *( 1. + 0.5 * ( XL2*EH - XH2*EL ) & / SIGN ( ABS(DENOM) , DENOM ) ) END IF @@ -1284,7 +1284,7 @@ ! IK = IFPMAX(IP) EFPMAX(IP) = SUMF(IK,IP) * DTH - IF (DISTP.NE.1 .AND. IK.GT.1 .AND. IK.LT.NK) THEN + IF (.NOT.DISTP .AND. IK.GT.1 .AND. IK.LT.NK) THEN EL = SUMF(IK-1,IP) * DTH EH = SUMF(IK+1,IP) * DTH NUMER = 0.125 * ( EL - EH )**2 diff --git a/model/ftn/ww3_grid.ftn b/model/ftn/ww3_grid.ftn index fae71efb6..3fd43f30a 100644 --- a/model/ftn/ww3_grid.ftn +++ b/model/ftn/ww3_grid.ftn @@ -703,10 +703,8 @@ ICEHDISP, ICEFDISP, ICEDDISP, BTBET ! REAL(8) :: GSHIFT ! see notes in WMGHGH - LOGICAL :: FLC, ICEDISP, TRCKCMPR + LOGICAL :: FLC, ICEDISP, TRCKCMPR, DISCRTP INTEGER :: PTM ! Partitioning method - INTEGER :: DISCRTP ! smoothed (0) or discrete (1) peak - ! period REAL :: PTFC ! Part. cut off freq (for method 5) CHARACTER :: PMNAME*45, PMNAM2*45 ! Part. method desc. !/FLD1 INTEGER :: TAILTYPE @@ -888,7 +886,7 @@ STDX, STDY, STDT, ICEHMIN, ICEHINIT, ICEDISP, & ICESLN, ICEWIND, ICESNL, ICESDS, ICEHFAC, & ICEHDISP, ICEDDISP, ICEFDISP, NOLEAP, TRCKCMPR, & - PTM, PTFC, BTBET, DISCRTP + PTM, DISCRTP, PTFC, BTBET NAMELIST /OUTS/ P2SF, I1P2SF, I2P2SF, & US3D, I1US3D, I2US3D, & USSP, IUSSP, STK_WN, & @@ -2193,7 +2191,7 @@ TRCKCMPR = .TRUE. NOSW = 5 PTM = 1 ! Default to standard WW3 partitioning. C. Bunney - DISCRTP= 0 ! Default to smoothed tp + DISCRTP= .FALSE. ! Default to smoothed tp PTFC = 0.1 ! Part. method 5 cutoff freq default. C. Bunney FMICHE = 1.6 RWNDC = 1. @@ -2505,7 +2503,8 @@ WSCUT = MIN ( 1.0001 , MAX ( 0. , WSC ) ) FLCOMB = FLC NOSWLL = MAX ( 1 , NOSW ) - DISTP = DISCRTP ! discrete(1) or smoothed(0) tp + DISTP = DISCRTP ! output discrete peak period + write(6,*) DISCRTP PTMETH = PTM ! Partitioning method. Chris Bunney (Jan 2016) PTFCUT = PTFC ! Freq cutoff for partitiong method 5 PMNAM2 = "" @@ -2538,7 +2537,7 @@ ELSE J = 2 END IF - WRITE (NDSO,966) IHMAX, HSPMIN, WSMULT, WSCUT, YESXNO(J), NOSWLL + WRITE (NDSO,966) IHMAX, HSPMIN, WSMULT, WSCUT, YESXNO(J), DISTP, NOSWLL WRITE (NDSO,5971) PMNAME IF( PMNAM2 .NE. "" ) WRITE (NDSO,5972) PMNAM2 !! WRITE (NDSO,966) IHMAX, HSPMIN, WSMULT, WSCUT, YESXNO(J) @@ -2726,7 +2725,7 @@ ICEHINIT, ICEDISP, ICEHDISP, & ICESLN, ICEWIND, ICESNL, ICESDS, & ICEDDISP,ICEFDISP, NOLEAP, TRCKCMPR, & - BTBETA + BTBETA, DISTP ELSE WRITE (NDSO,2966) CICE0, CICEN, LICE, PMOVE, XSEED, FLAGTR, & XP, XR, XFILT, IHMAX, HSPMIN, WSMULT, & @@ -2736,7 +2735,7 @@ ICEHINIT, ICEDISP, ICEHDISP, & ICESLN, ICEWIND, ICESNL, ICESDS, & ICEDDISP, ICEFDISP, NOLEAP, TRCKCMPR, & - BTBETA + BTBETA, DISTP END IF ! !/FLD1 WRITE(NDSO,2987) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 @@ -5643,6 +5642,7 @@ ' Wind area multiplier (-) :',F9.3/ & ' Cut-off wind sea fract. (-) :',F9.3/ & ' Combine wind seas : ',A/ & + ' Discrete peak period : ',L3/ & ' Number of swells in fld out :',I5) 967 FORMAT (/' Miche-style limiting wave height :'/ & ' Hs,max/d factor (-) :',F9.3/ & @@ -5742,7 +5742,7 @@ ', ICESNL = ',F6.2,', ICESDS = ',F5.2,','/ & ' ICEDDISP = ',F5.2,', ICEFDISP = ',F5.2, & ', NOLEAP = ',L3,' , TRCKCMPR = ', L3,','/ & - ' BTBET = ', F6.2, ' /') + ' BTBET = ', F6.2, ', DISTP = ',L3,' /') ! 2976 FORMAT ( ' &OUTS P2SF =',I2,', I1P2SF =',I2,', I2P2SF =',I3,','/& ' US3D =',I2,', I1US3D =',I3,', I2US3D =',I3,','/& From 985d216dab9ae39e235cf6da89a8e9c7890d8ed5 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Mon, 9 May 2022 13:04:00 +0000 Subject: [PATCH 5/7] :recycle: store DISTP parameter in mod_def.ww3 --- model/ftn/w3iogrmd.ftn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/ftn/w3iogrmd.ftn b/model/ftn/w3iogrmd.ftn index afe6cd145..6dbd42fea 100644 --- a/model/ftn/w3iogrmd.ftn +++ b/model/ftn/w3iogrmd.ftn @@ -915,11 +915,11 @@ IF ( WRITE ) THEN WRITE (NDSM) & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & - PTMETH, PTFCUT + PTMETH, PTFCUT, DISTP ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & - PTMETH, PTFCUT + PTMETH, PTFCUT, DISTP END IF !/DEBUGIOGR WRITE(740+IAPROC,*) 'W3IOGR, step 13' !/DEBUGIOGR FLUSH(740+IAPROC) From 0e3063d3f3aae834471c99b1f72e0794ef9226d5 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Tue, 10 May 2022 10:04:06 +0000 Subject: [PATCH 6/7] :pencil: remove debug statement --- model/ftn/ww3_grid.ftn | 1 - 1 file changed, 1 deletion(-) diff --git a/model/ftn/ww3_grid.ftn b/model/ftn/ww3_grid.ftn index 3fd43f30a..321a1b8cd 100644 --- a/model/ftn/ww3_grid.ftn +++ b/model/ftn/ww3_grid.ftn @@ -2504,7 +2504,6 @@ FLCOMB = FLC NOSWLL = MAX ( 1 , NOSW ) DISTP = DISCRTP ! output discrete peak period - write(6,*) DISCRTP PTMETH = PTM ! Partitioning method. Chris Bunney (Jan 2016) PTFCUT = PTFC ! Freq cutoff for partitiong method 5 PMNAM2 = "" From f40f665518209f6f93fe4d5a97dabfd9787305d3 Mon Sep 17 00:00:00 2001 From: sanderh Date: Tue, 10 May 2022 12:27:46 +0200 Subject: [PATCH 7/7] :pencil: correct namelist parameter in documentation --- model/ftn/w3partmd.ftn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/ftn/w3partmd.ftn b/model/ftn/w3partmd.ftn index 6c149c7e7..e3fa05fa3 100644 --- a/model/ftn/w3partmd.ftn +++ b/model/ftn/w3partmd.ftn @@ -148,7 +148,7 @@ ! 5) 2-band partitioning; produces hi and low freqency band partitions ! using a user-defined cutoff frequency (PTFCUT). [DIMXP = 2] ! -! set DTP = 1 in the MISC namelist to request discrete peak period +! set DISCRTP .TRUE. in the MISC namelist to request discrete peak period ! ! (Chris Bunney, UK Met Office, Jul 2018) !