ocean_dt_tracer_advect_ratios_ok Function

public pure function ocean_dt_tracer_advect_ratios_ok(dt_therm_ratio, dt_tracer_advect_ratio) result(ok)

Configure-time validity of the (dt_therm_ratio, dt_tracer_advect_ratio) pair. Both must be >= 1 and dt_therm_ratio must be an integer multiple of dt_tracer_advect_ratio so the ALE remap (which fires at the DT_THERM cadence) never lands inside an open tracer-flux accumulation window. The setup layer (configure_ocean_vmix) calls this and error stops with a descriptive message on .false.; exposed as a pure predicate so the validation logic is unit-testable without constructing a full ocean state.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: dt_therm_ratio
integer, intent(in) :: dt_tracer_advect_ratio

Return Value logical


Called by

proc~~ocean_dt_tracer_advect_ratios_ok~~CalledByGraph proc~ocean_dt_tracer_advect_ratios_ok ocean_dt_tracer_advect_ratios_ok proc~configure_ocean_vmix configure_ocean_vmix proc~configure_ocean_vmix->proc~ocean_dt_tracer_advect_ratios_ok proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_vmix proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   pure function ocean_dt_tracer_advect_ratios_ok(dt_therm_ratio, &
                                                  dt_tracer_advect_ratio) result(ok)
      !! Configure-time validity of the (`dt_therm_ratio`,
      !! `dt_tracer_advect_ratio`) pair.  Both must be >= 1 and
      !! `dt_therm_ratio` must be an integer multiple of
      !! `dt_tracer_advect_ratio` so the ALE remap (which fires at the
      !! DT_THERM cadence) never lands inside an open tracer-flux
      !! accumulation window.  The setup layer (`configure_ocean_vmix`)
      !! calls this and `error stop`s with a descriptive message on
      !! `.false.`; exposed as a pure predicate so the validation logic
      !! is unit-testable without constructing a full ocean state.
      integer, intent(in) :: dt_therm_ratio
      integer, intent(in) :: dt_tracer_advect_ratio
      logical :: ok
      ok = .true.
      if (dt_tracer_advect_ratio < 1) ok = .false.
      if (dt_therm_ratio < 1) ok = .false.
      if (ok) then
         if (mod(dt_therm_ratio, dt_tracer_advect_ratio) /= 0) ok = .false.
      end if
   end function ocean_dt_tracer_advect_ratios_ok