ocean_heat_src_sum Function

public pure function ocean_heat_src_sum(surface_sum, geothermal_sum, sponge_sum) result(s)

Assemble the total HEAT source integral (pre-weight, pre-ρ) that feeds ocean_budget_src: surface flux + geothermal bottom flux + (PR-23) the map-driven sponge’s tracer-relaxation source.

s = surface_sum + geothermal_sum + sponge_sum

Geothermal and the sponge are both unaccounted-for-elsewhere heat sources when enabled; folding them in keeps the Heat Error a true numerical-leak residual instead of flagging the source as a spurious leak (all three terms share the “positive into the ocean” sign convention). sponge_sum is ms%heat_budget_sponge’s area-weighted reduction — zero unless &ocean_sponge_nml enable=.true., relax_tracers=.true. (the legacy band sponge’s tracer sink stays un-instrumented; PR-23 replaced that gate with this fold, see ocean_budget_is_active’s docstring). Sole home of the geothermal + sponge FOLD — the reporter and the unit tests both call it, so deleting either term fails test_geothermal_folds_into_heat_src / sponge_source_closes_the_heat_budget.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: surface_sum
real(kind=wp), intent(in) :: geothermal_sum
real(kind=wp), intent(in) :: sponge_sum

Return Value real(kind=wp)


Called by

proc~~ocean_heat_src_sum~~CalledByGraph proc~ocean_heat_src_sum ocean_heat_src_sum proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~ocean_heat_src_sum proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_console_stats_report proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Source Code

   pure function ocean_heat_src_sum(surface_sum, geothermal_sum, sponge_sum) result(s)
      !! Assemble the total HEAT source integral (pre-weight, pre-ρ) that
      !! feeds `ocean_budget_src`: surface flux + geothermal bottom flux +
      !! (PR-23) the map-driven sponge's tracer-relaxation source.
      !!
      !!   s = surface_sum + geothermal_sum + sponge_sum
      !!
      !! Geothermal and the sponge are both unaccounted-for-elsewhere heat
      !! sources when enabled; folding them in keeps the Heat Error a true
      !! numerical-leak residual instead of flagging the source as a
      !! spurious leak (all three terms share the "positive into the ocean"
      !! sign convention). `sponge_sum` is `ms%heat_budget_sponge`'s
      !! area-weighted reduction — zero unless `&ocean_sponge_nml
      !! enable=.true., relax_tracers=.true.` (the legacy band sponge's
      !! tracer sink stays un-instrumented; PR-23 replaced that gate with
      !! this fold, see `ocean_budget_is_active`'s docstring). Sole home of
      !! the geothermal + sponge FOLD — the reporter and the unit tests
      !! both call it, so deleting either term fails
      !! `test_geothermal_folds_into_heat_src` /
      !! `sponge_source_closes_the_heat_budget`.
      real(wp), intent(in) :: surface_sum, geothermal_sum, sponge_sum
      real(wp) :: s
      s = surface_sum + geothermal_sum + sponge_sum
   end function ocean_heat_src_sum