Skip to content

Commit dcae198

Browse files
c2xuHallberg-NOAA
authored andcommitted
Bug fix in MOM_open_boundary
Fixed the inconsistency for defining the reference time of tides in MOM_tidal_forcing and MOM_open_boundary.
1 parent 00fde81 commit dcae198

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/core/MOM_open_boundary.F90

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,17 +1330,20 @@ subroutine initialize_obc_tides(OBC, US, param_file)
13301330
"Fixed reference date to use for nodal modulation of boundary tides.", &
13311331
old_name="OBC_TIDE_NODAL_REF_DATE", defaults=(/0, 0, 0/), do_not_log=tides)
13321332

1333-
if (.not. OBC%add_eq_phase) then
1334-
! If equilibrium phase argument is not added, the input phases
1335-
! should already be relative to the reference time.
1336-
call MOM_mesg('OBC tidal phases will *not* be corrected with equilibrium arguments.')
1337-
endif
1338-
13391333
allocate(OBC%tide_names(OBC%n_tide_constituents))
13401334
read(tide_constituent_str, *) OBC%tide_names
13411335

13421336
! Set reference time (t = 0) for boundary tidal forcing.
1343-
OBC%time_ref = set_date(tide_ref_date(1), tide_ref_date(2), tide_ref_date(3), 0, 0, 0)
1337+
if (sum(tide_ref_date) == 0) then ! tide_ref_date defaults to 0.
1338+
OBC%time_ref = set_date(1, 1, 1, 0, 0, 0)
1339+
else
1340+
if (.not. OBC%add_eq_phase) then
1341+
! If equilibrium phase argument is not added, the input phases
1342+
! should already be relative to the reference time.
1343+
call MOM_mesg('OBC tidal phases will *not* be corrected with equilibrium arguments.')
1344+
endif
1345+
OBC%time_ref = set_date(tide_ref_date(1), tide_ref_date(2), tide_ref_date(3), 0, 0, 0)
1346+
endif
13441347

13451348
! Find relevant lunar and solar longitudes at the reference time
13461349
if (OBC%add_eq_phase) call astro_longitudes_init(OBC%time_ref, OBC%tidal_longitudes)

0 commit comments

Comments
 (0)