Skip to content

Commit

Permalink
Add logic to do_diabatic check
Browse files Browse the repository at this point in the history
The do_diabatic check should only be done if do_thermo is true. This
is relevant when do_dyn or do_thermo are being used from outside
step_MOM to order the updates of the thermodynamics and dynamics,
such as when the interspesed coupling is used.
  • Loading branch information
Theresa Morrison authored and Theresa Morrison committed Dec 3, 2024
1 parent d1f89fb commit a31efd1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,12 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS

!===========================================================================
! This is the second place where the diabatic processes and remapping could occur.
if (thermo_does_span_coupling .or. .not.do_dyn) then
do_diabatic = (CS%t_dyn_rel_thermo + 0.5*dt > dt_therm)
else
do_diabatic = ((MOD(n,ntstep) == 0) .or. (n==n_max))
if (do_thermo) then
if (thermo_does_span_coupling .or. .not.do_dyn) then
do_diabatic = (CS%t_dyn_rel_thermo + 0.5*dt > dt_therm)
else
do_diabatic = ((MOD(n,ntstep) == 0) .or. (n==n_max))
endif
endif
if ((CS%t_dyn_rel_adv==0.0) .and. do_thermo .and. (.not.CS%diabatic_first) .and. do_diabatic) then

Expand Down

0 comments on commit a31efd1

Please sign in to comment.