Skip to content

Commit 15f16bb

Browse files
committed
Inline harmonic analysis
Set default HAready = False Also made additional adjustment to ensure harmonic analysis is not activated if tide is not used in the model.
1 parent d234bce commit 15f16bb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/core/MOM_barotropic.F90

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4504,9 +4504,6 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
45044504
if (present(SAL_CSp)) then
45054505
CS%SAL_CSp => SAL_CSp
45064506
endif
4507-
if (present(HA_CSp)) then
4508-
CS%HA_CSp => HA_CSp
4509-
endif
45104507

45114508
! Read all relevant parameters and write them to the model log.
45124509
call get_param(param_file, mdl, "SPLIT", CS%split, default=.true., do_not_log=.true.)
@@ -4639,6 +4636,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
46394636
default=.not.visc_rem_bug)
46404637
call get_param(param_file, mdl, "TIDES", use_tides, &
46414638
"If true, apply tidal momentum forcing.", default=.false.)
4639+
if (use_tides .and. present(HA_CSp)) CS%HA_CSp => HA_CSp
46424640
call get_param(param_file, mdl, "CALCULATE_SAL", CS%calculate_SAL, &
46434641
"If true, calculate self-attraction and loading.", default=use_tides)
46444642
det_de = 0.0

src/core/MOM_dynamics_split_RK2.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
15471547
do j=js,je ; do i=is,ie ; eta(i,j) = CS%eta(i,j) ; enddo ; enddo
15481548

15491549
call barotropic_init(u, v, h, CS%eta, Time, G, GV, US, param_file, diag, &
1550-
CS%barotropic_CSp, restart_CS, calc_dtbt, CS%BT_cont, CS%SAL_CSp, CS%HA_CSp)
1550+
CS%barotropic_CSp, restart_CS, calc_dtbt, CS%BT_cont, CS%SAL_CSp, HA_CSp)
15511551

15521552
if (.not. query_initialized(CS%diffu, "diffu", restart_CS) .or. &
15531553
.not. query_initialized(CS%diffv, "diffv", restart_CS)) then

src/core/MOM_dynamics_split_RK2b.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ subroutine initialize_dyn_split_RK2b(u, v, h, tv, uh, vh, eta, Time, G, GV, US,
14631463

14641464
call barotropic_init(u, v, h, CS%eta, Time, G, GV, US, param_file, diag, &
14651465
CS%barotropic_CSp, restart_CS, calc_dtbt, CS%BT_cont, &
1466-
CS%SAL_CSp, CS%HA_CSp)
1466+
CS%SAL_CSp, HA_CSp)
14671467

14681468
flux_units = get_flux_units(GV)
14691469
thickness_units = get_thickness_units(GV)

src/diagnostics/MOM_harmonic_analysis.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module MOM_harmonic_analysis
3939

4040
!> The public control structure of the MOM_harmonic_analysis module
4141
type, public :: harmonic_analysis_CS ; private
42-
logical :: HAready = .true. !< If true, perform harmonic analysis
42+
logical :: HAready = .false. !< If true, perform harmonic analysis
4343
type(time_type) :: &
4444
time_start, & !< Start time of harmonic analysis
4545
time_end, & !< End time of harmonic analysis
@@ -107,6 +107,8 @@ subroutine HA_init(Time, US, param_file, time_ref, nc, freq, phase0, const_name,
107107
CS%HAready = .false. ; return
108108
endif
109109

110+
CS%HAready = .true.
111+
110112
if (HA_start_time < 0.0) then
111113
HA_start_time = HA_end_time + HA_start_time
112114
if (HA_start_time <= 0.0) HA_start_time = 0.0

0 commit comments

Comments
 (0)