Skip to content

Commit

Permalink
Merge pull request #3 from SanderHulst/release/6.07.4
Browse files Browse the repository at this point in the history
⭐ DISCRTP .TRUE. in misc namelist requests discrete peak period
  • Loading branch information
SanderHulst authored May 10, 2022
2 parents 9d5f8f5 + f40f665 commit a2663c2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions model/ftn/w3iogrmd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions model/ftn/w3odatmd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -492,6 +493,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
!/ ------------------------------------------------------------------- /
Expand Down Expand Up @@ -1646,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
Expand Down
11 changes: 7 additions & 4 deletions model/ftn/w3partmd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
!
!/ ------------------------------------------------------------------- /
!
USE W3ODATMD, ONLY: IHMAX, HSPMIN, WSMULT, DIMP, PTMETH, PTFCUT
USE W3ODATMD, ONLY: IHMAX, HSPMIN, WSMULT, DIMP, PTMETH, PTFCUT, &
DISTP
!
PUBLIC
!
Expand Down Expand Up @@ -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 DISCRTP .TRUE. in the MISC namelist to request discrete peak period
!
! (Chris Bunney, UK Met Office, Jul 2018)
!
! 8. Structure :
Expand Down Expand Up @@ -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
Expand Down
21 changes: 12 additions & 9 deletions model/ftn/ww3_grid.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -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
!
Expand Down Expand Up @@ -703,9 +703,9 @@
ICEHDISP, ICEFDISP, ICEDDISP, BTBET
!
REAL(8) :: GSHIFT ! see notes in WMGHGH
LOGICAL :: FLC, ICEDISP, TRCKCMPR
INTEGER :: PTM ! Partitioning method
REAL :: PTFC ! Part. cut off freq (for method 5)
LOGICAL :: FLC, ICEDISP, TRCKCMPR, DISCRTP
INTEGER :: PTM ! Partitioning method
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
Expand Down Expand Up @@ -886,7 +886,7 @@
STDX, STDY, STDT, ICEHMIN, ICEHINIT, ICEDISP, &
ICESLN, ICEWIND, ICESNL, ICESDS, ICEHFAC, &
ICEHDISP, ICEDDISP, ICEFDISP, NOLEAP, TRCKCMPR, &
PTM, PTFC, BTBET
PTM, DISCRTP, PTFC, BTBET
NAMELIST /OUTS/ P2SF, I1P2SF, I2P2SF, &
US3D, I1US3D, I2US3D, &
USSP, IUSSP, STK_WN, &
Expand Down Expand Up @@ -2191,6 +2191,7 @@
TRCKCMPR = .TRUE.
NOSW = 5
PTM = 1 ! Default to standard WW3 partitioning. C. Bunney
DISCRTP= .FALSE. ! Default to smoothed tp
PTFC = 0.1 ! Part. method 5 cutoff freq default. C. Bunney
FMICHE = 1.6
RWNDC = 1.
Expand Down Expand Up @@ -2502,6 +2503,7 @@
WSCUT = MIN ( 1.0001 , MAX ( 0. , WSC ) )
FLCOMB = FLC
NOSWLL = MAX ( 1 , NOSW )
DISTP = DISCRTP ! output discrete peak period
PTMETH = PTM ! Partitioning method. Chris Bunney (Jan 2016)
PTFCUT = PTFC ! Freq cutoff for partitiong method 5
PMNAM2 = ""
Expand Down Expand Up @@ -2534,7 +2536,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)
Expand Down Expand Up @@ -2722,7 +2724,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, &
Expand All @@ -2732,7 +2734,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
Expand Down Expand Up @@ -5639,6 +5641,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/ &
Expand Down Expand Up @@ -5738,7 +5741,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,','/&
Expand Down

0 comments on commit a2663c2

Please sign in to comment.