ocean_ideal_age_apply Subroutine

public subroutine ocean_ideal_age_apply(grid, ms, dt, active)

Driver-facing entry point for the interior-aging SOURCE term. Self-gates on ms%idx_age <= 0 (no-op when the ideal-age tracer isn’t registered), else delegates to the flat-impl ocean_ideal_age_age_step kernel. Call once per RK2 stage with dt = therm_dt and active = dyn%is_thermo_step() — see the module header for the full contract.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(multilayer_state_t), intent(inout) :: ms
real(kind=wp), intent(in) :: dt
logical, intent(in), optional :: active

Optional gate (thermo cadence). Absent => kernel runs; present-and-false => early return.


Calls

proc~~ocean_ideal_age_apply~~CallsGraph proc~ocean_ideal_age_apply ocean_ideal_age_apply proc~ocean_ideal_age_age_step ocean_ideal_age_age_step proc~ocean_ideal_age_apply->proc~ocean_ideal_age_age_step

Called by

proc~~ocean_ideal_age_apply~~CalledByGraph proc~ocean_ideal_age_apply ocean_ideal_age_apply proc~run_stage run_stage proc~run_stage->proc~ocean_ideal_age_apply proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_ideal_age_apply proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split 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

   subroutine ocean_ideal_age_apply(grid, ms, dt, active)
      !! Driver-facing entry point for the interior-aging SOURCE term.
      !! Self-gates on `ms%idx_age <= 0` (no-op when the ideal-age
      !! tracer isn't registered), else delegates to the flat-impl
      !! `ocean_ideal_age_age_step` kernel. Call once per RK2 stage
      !! with `dt = therm_dt` and `active = dyn%is_thermo_step()` — see
      !! the module header for the full contract.
      type(hgrid_t), intent(in) :: grid
      type(multilayer_state_t), intent(inout) :: ms
      real(wp), intent(in) :: dt
      logical, intent(in), optional :: active
         !! Optional gate (thermo cadence). Absent => kernel runs;
         !! present-and-false => early return.

      if (present(active)) then
         if (.not. active) return
      end if
      if (ms%idx_age <= 0) return
      call ocean_ideal_age_age_step(ms%tracers(ms%idx_age)%hTr, ms%h_layer, &
                                    dt, grid%nx_total, grid%ny_total, ms%nz_ml)
   end subroutine ocean_ideal_age_apply