Skip to content

Commit b3aa2bc

Browse files
committed
Inline Harmonic Analysis
Update 3: A logical flag is set to control whether harmonic analysis is to be enabled.
1 parent a04a9aa commit b3aa2bc

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/core/MOM_dynamics_split_RK2.F90

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ module MOM_dynamics_split_RK2
172172
!! of restart files.
173173
logical :: calculate_SAL !< If true, calculate self-attraction and loading.
174174
logical :: use_tides !< If true, tidal forcing is enabled.
175+
logical :: use_HA !< If true, perform inline harmonic analysis.
175176
logical :: remap_aux !< If true, apply ALE remapping to all of the auxiliary 3-D
176177
!! variables that are needed to reproduce across restarts,
177178
!! similarly to what is done with the primary state variables.
@@ -1434,6 +1435,8 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
14341435
"If true, apply tidal momentum forcing.", default=.false.)
14351436
call get_param(param_file, mdl, "CALCULATE_SAL", CS%calculate_SAL, &
14361437
"If true, calculate self-attraction and loading.", default=CS%use_tides)
1438+
call get_param(param_file, mdl, "USE_HA", CS%use_HA, &
1439+
"If true, perform inline harmonic analysis.", default=.false.)
14371440
call get_param(param_file, mdl, "BE", CS%be, &
14381441
"If SPLIT is true, BE determines the relative weighting "//&
14391442
"of a 2nd-order Runga-Kutta baroclinic time stepping "//&
@@ -1564,8 +1567,13 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
15641567
call CoriolisAdv_init(Time, G, GV, US, param_file, diag, CS%ADp, CS%CoriolisAdv)
15651568
if (CS%calculate_SAL) call SAL_init(h, tv, G, GV, US, param_file, CS%SAL_CSp, restart_CS)
15661569
if (CS%use_tides) then
1567-
call tidal_forcing_init(Time, G, US, param_file, CS%tides_CSp, CS%HA_CSp)
1568-
HA_CSp => CS%HA_CSp
1570+
if (CS%use_HA) then
1571+
call tidal_forcing_init(Time, G, US, param_file, CS%tides_CSp, CS%HA_CSp)
1572+
HA_CSp => CS%HA_CSp
1573+
else
1574+
call tidal_forcing_init(Time, G, US, param_file, CS%tides_CSp)
1575+
HA_CSp => NULL()
1576+
endif
15691577
else
15701578
HA_CSp => NULL()
15711579
endif

src/core/MOM_dynamics_split_RK2b.F90

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ module MOM_dynamics_split_RK2b
163163
logical :: dtbt_use_bt_cont !< If true, use BT_cont to calculate DTBT.
164164
logical :: calculate_SAL !< If true, calculate self-attraction and loading.
165165
logical :: use_tides !< If true, tidal forcing is enabled.
166+
logical :: use_HA !< If true, perform inline harmonic analysis.
166167
logical :: remap_aux !< If true, apply ALE remapping to all of the auxiliary 3-D
167168
!! variables that are needed to reproduce across restarts,
168169
!! similarly to what is done with the primary state variables.
@@ -1334,6 +1335,8 @@ subroutine initialize_dyn_split_RK2b(u, v, h, tv, uh, vh, eta, Time, G, GV, US,
13341335
"If true, apply tidal momentum forcing.", default=.false.)
13351336
call get_param(param_file, mdl, "CALCULATE_SAL", CS%calculate_SAL, &
13361337
"If true, calculate self-attraction and loading.", default=CS%use_tides)
1338+
call get_param(param_file, mdl, "USE_HA", CS%use_HA, &
1339+
"If true, perform inline harmonic analysis.", default=.false.)
13371340
call get_param(param_file, mdl, "BE", CS%be, &
13381341
"If SPLIT is true, BE determines the relative weighting "//&
13391342
"of a 2nd-order Runga-Kutta baroclinic time stepping "//&
@@ -1447,8 +1450,13 @@ subroutine initialize_dyn_split_RK2b(u, v, h, tv, uh, vh, eta, Time, G, GV, US,
14471450
call CoriolisAdv_init(Time, G, GV, US, param_file, diag, CS%ADp, CS%CoriolisAdv)
14481451
if (CS%calculate_SAL) call SAL_init(h, tv, G, GV, US, param_file, CS%SAL_CSp, restart_CS)
14491452
if (CS%use_tides) then
1450-
call tidal_forcing_init(Time, G, US, param_file, CS%tides_CSp, CS%HA_CSp)
1451-
HA_CSp => CS%HA_CSp
1453+
if (CS%use_HA) then
1454+
call tidal_forcing_init(Time, G, US, param_file, CS%tides_CSp, CS%HA_CSp)
1455+
HA_CSp => CS%HA_CSp
1456+
else
1457+
call tidal_forcing_init(Time, G, US, param_file, CS%tides_CSp)
1458+
HA_CSp => NULL()
1459+
endif
14521460
else
14531461
HA_CSp => NULL()
14541462
endif

0 commit comments

Comments
 (0)