ocean_dyn_is_tracer_advect_step Function

private pure function ocean_dyn_is_tracer_advect_step(this) result(yes)

Returns .true. when the windowed horizontal tracer-advect drain should fire on the current outer step, evaluated with the PRE-increment outer_step_count so it aligns bit-for-bit with is_thermo_step() (which gates the ALE remap on the same count).

Cadence reasoning: at outer_step_count = 0 the IC-aligned first window has not accumulated yet, so the drain must NOT fire then. It fires when mod(outer_step_count, ratio) == 0 .and. outer_step_count > 0 — i.e. exactly ratio accumulate-steps have completed since the last reset. Because the config constraint forces dt_therm_ratio to be an integer multiple of dt_tracer_advect_ratio, every thermo step (where ALE fires) is also a tracer-advect step, so the drain always precedes the ALE remap and no accumulation window is ever cut by a remap. ratio <= 1 ⇒ never (the every-step bypass owns that case).

Type Bound

ocean_dyn_t

Arguments

Type IntentOptional Attributes Name
class(ocean_dyn_t), intent(in) :: this

Return Value logical


Called by

proc~~ocean_dyn_is_tracer_advect_step~~CalledByGraph proc~ocean_dyn_is_tracer_advect_step ocean_dyn_t%ocean_dyn_is_tracer_advect_step proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~ocean_dyn_is_tracer_advect_step proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~ocean_dyn_is_tracer_advect_step proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Source Code

   pure function ocean_dyn_is_tracer_advect_step(this) result(yes)
      !! Returns `.true.` when the windowed horizontal tracer-advect drain
      !! should fire on the current outer step, evaluated with the
      !! PRE-increment `outer_step_count` so it aligns bit-for-bit with
      !! `is_thermo_step()` (which gates the ALE remap on the same count).
      !!
      !! Cadence reasoning: at `outer_step_count = 0` the IC-aligned first
      !! window has not accumulated yet, so the drain must NOT fire then.
      !! It fires when `mod(outer_step_count, ratio) == 0 .and.
      !! outer_step_count > 0` — i.e. exactly `ratio` accumulate-steps have
      !! completed since the last reset.  Because the config constraint
      !! forces `dt_therm_ratio` to be an integer multiple of
      !! `dt_tracer_advect_ratio`, every thermo step (where ALE fires) is
      !! also a tracer-advect step, so the drain always precedes the ALE
      !! remap and no accumulation window is ever cut by a remap.
      !! `ratio <= 1` ⇒ never (the every-step bypass owns that case).
      class(ocean_dyn_t), intent(in) :: this
      logical :: yes
      if (this%dt_tracer_advect_ratio <= 1) then
         yes = .false.
      else
         yes = (this%outer_step_count > 0) .and. &
               (mod(this%outer_step_count, this%dt_tracer_advect_ratio) == 0)
      end if
   end function ocean_dyn_is_tracer_advect_step