Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline harmonic analysis #718

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4504,9 +4504,6 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
if (present(SAL_CSp)) then
CS%SAL_CSp => SAL_CSp
endif
if (present(HA_CSp)) then
CS%HA_CSp => HA_CSp
endif

! Read all relevant parameters and write them to the model log.
call get_param(param_file, mdl, "SPLIT", CS%split, default=.true., do_not_log=.true.)
Expand Down Expand Up @@ -4639,6 +4636,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
default=.not.visc_rem_bug)
call get_param(param_file, mdl, "TIDES", use_tides, &
"If true, apply tidal momentum forcing.", default=.false.)
if (use_tides .and. present(HA_CSp)) CS%HA_CSp => HA_CSp
call get_param(param_file, mdl, "CALCULATE_SAL", CS%calculate_SAL, &
"If true, calculate self-attraction and loading.", default=use_tides)
det_de = 0.0
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
do j=js,je ; do i=is,ie ; eta(i,j) = CS%eta(i,j) ; enddo ; enddo

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

if (.not. query_initialized(CS%diffu, "diffu", restart_CS) .or. &
.not. query_initialized(CS%diffv, "diffv", restart_CS)) then
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_dynamics_split_RK2b.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ subroutine initialize_dyn_split_RK2b(u, v, h, tv, uh, vh, eta, Time, G, GV, US,

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

flux_units = get_flux_units(GV)
thickness_units = get_thickness_units(GV)
Expand Down
4 changes: 3 additions & 1 deletion src/diagnostics/MOM_harmonic_analysis.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module MOM_harmonic_analysis

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

CS%HAready = .true.

if (HA_start_time < 0.0) then
HA_start_time = HA_end_time + HA_start_time
if (HA_start_time <= 0.0) HA_start_time = 0.0
Expand Down
Loading