Skip to content

Commit

Permalink
Nan tide on equator (#222)
Browse files Browse the repository at this point in the history
* 🐛 inconsistent check and deallocation

* ⭐ improved tidal output around equator

* 🐛 TIDECON_NAME and TIDE_FREQC are not deallocated/allocated as pairs

* ♻️ restored TIDECON_NAME allocation/deallocation

Co-authored-by: sanderh <[email protected]>
  • Loading branch information
SanderHulst and SanderHulst authored Mar 26, 2021
1 parent c4926b5 commit fc3576f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions model/ftn/w3tidemd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,20 @@
REAL(KIND=4), PARAMETER :: PI=3.1415926536
REAL(KIND=4), PARAMETER :: TWOPI=2.*3.1415926536

REAL :: SLAT, VDBL, RR, SUMC, SUMS, UUDBL, UU
REAL :: SLAT, VDBL, RR, SUMC, SUMS, UUDBL, UU, CXLAT
INTEGER :: IUU, IV

SLAT=SIN(PI*XLAT/180.)
! This comment was taken from t_tide, a matlab tidal prediction suite
!
! Apparently the second-order terms in the tidal potential go to zero
! at the equator, but the third-order terms do not. Hence when trying
! to infer the third-order terms from the second-order terms, the
! nodal correction factors blow up. In order to prevent this, it is
! assumed that the equatorial forcing is due to second-order forcing
! OFF the equator, from about the 5 degree location. Latitudes are
! hence (somewhat arbitrarily) forced to be no closer than 5 deg to
! the equator, as per note in Foreman.
CXLAT = MAX(ABS(XLAT), 5.)
SLAT=SIN(PI*CXLAT/180.)

JBASE=0
! All
Expand Down Expand Up @@ -1869,12 +1879,13 @@
REAL(KIND=4), PARAMETER :: TWOPI=2.*3.1415926536
!
REAL :: SLAT, VDBL, VV, SUMC, SUMS, RR, &
UUDBL, UU
UUDBL, UU, CXLAT
REAL(KIND=8) :: d1,h,pp,s,p,enp,dh,dpp,ds,dp,dnp,hh,tau

INTEGER :: indx(170)

SLAT=SIN(PI*XLAT/180.)
CXLAT = MAX(ABS(XLAT), 5.)
SLAT=SIN(PI*CXLAT/180.)
!
!***********************************************************************
!* THE ASTRONOMICAL ARGUMENTS ARE CALCULATED BY LINEAR APPROXIMATION
Expand Down

0 comments on commit fc3576f

Please sign in to comment.