Console src term for a conserved tracer: the surface (+ any other
source, e.g. geothermal) contribution to the outer-step budget.
src = +RK2_STAGE_WEIGHT · source_sum · RHO_WATER
source_sum is the already-area-weighted interior reduction of the
per-cell source budget array(s) — i.e. compute_total_tracer
output, PRE-weight and PRE-RHO_WATER. Positive = added to the
ocean by the source. Sole home of the weight + ρ scaling on the
source side; both the reporter and the unit test call this, so a
mutation of either factor fails the test.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | source_sum | |||
| real(kind=wp), | intent(in), | optional | :: | stage_weight |
Per-outer-step weight that converts the accumulator’s raw sum
into the state change it must match. Absent ⇒ |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | w |
pure function ocean_budget_src(source_sum, stage_weight) result(src) !! Console `src` term for a conserved tracer: the surface (+ any other !! source, e.g. geothermal) contribution to the outer-step budget. !! !! src = +RK2_STAGE_WEIGHT · source_sum · RHO_WATER !! !! `source_sum` is the already-area-weighted interior reduction of the !! per-cell source budget array(s) — i.e. `compute_total_tracer` !! output, PRE-weight and PRE-`RHO_WATER`. Positive = added to the !! ocean by the source. Sole home of the weight + ρ scaling on the !! source side; both the reporter and the unit test call this, so a !! mutation of either factor fails the test. real(wp), intent(in) :: source_sum real(wp), intent(in), optional :: stage_weight !! Per-outer-step weight that converts the accumulator's raw sum !! into the state change it must match. Absent ⇒ `RK2_STAGE_WEIGHT` !! (0.5), the historical SSP-RK2 value — so every existing caller is !! bit-identical. Supply `ocean_budget_stage_weight(is_pc)` rather !! than a literal: that function is the sole home of the mapping. real(wp) :: src real(wp) :: w w = RK2_STAGE_WEIGHT if (present(stage_weight)) w = stage_weight src = w*source_sum*RHO_WATER end function ocean_budget_src