Skip to content

Commit

Permalink
♻️ request discrete tp is a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderHulst committed May 6, 2022
1 parent 91f6696 commit c118c33
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 3 additions & 1 deletion 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,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
!/ ------------------------------------------------------------------- /
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions model/ftn/w3partmd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -1276,15 +1276,15 @@
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
CALL WAVNU1 ( SIGP, DEPTH, WNP, CGP )
!
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
Expand Down
20 changes: 10 additions & 10 deletions model/ftn/ww3_grid.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, &
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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, &
Expand All @@ -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
Expand Down Expand Up @@ -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/ &
Expand Down Expand Up @@ -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,','/&
Expand Down

0 comments on commit c118c33

Please sign in to comment.