ocean_budget_out Function

public pure function ocean_budget_out(adv_sum, hdiff_sum, stage_weight) result(out)

Console out term for a conserved tracer: the boundary transport out of the domain, from the horizontal-advection + horizontal- diffusion budgets.

out = −RK2_STAGE_WEIGHT · (adv_sum + hdiff_sum) · RHO_WATER

adv_sum / hdiff_sum are the already-area-weighted interior reductions of the per-cell budget arrays (PRE-weight, PRE-RHO_WATER). The leading MINUS converts an interior loss (negative divergence integral) into a positive “left the domain” quantity. Sole home of the weight + sign + ρ scaling on the transport side.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: adv_sum
real(kind=wp), intent(in) :: hdiff_sum
real(kind=wp), intent(in), optional :: stage_weight

See ocean_budget_src. Absent ⇒ RK2_STAGE_WEIGHT (0.5).

Return Value real(kind=wp)


Called by

proc~~ocean_budget_out~~CalledByGraph proc~ocean_budget_out ocean_budget_out proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~ocean_budget_out 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: w

Source Code

   pure function ocean_budget_out(adv_sum, hdiff_sum, stage_weight) result(out)
      !! Console `out` term for a conserved tracer: the boundary transport
      !! out of the domain, from the horizontal-advection + horizontal-
      !! diffusion budgets.
      !!
      !!   out = −RK2_STAGE_WEIGHT · (adv_sum + hdiff_sum) · RHO_WATER
      !!
      !! `adv_sum` / `hdiff_sum` are the already-area-weighted interior
      !! reductions of the per-cell budget arrays (PRE-weight, PRE-`RHO_WATER`).
      !! The leading MINUS converts an interior loss (negative divergence
      !! integral) into a positive "left the domain" quantity.  Sole home of
      !! the weight + sign + ρ scaling on the transport side.
      real(wp), intent(in) :: adv_sum, hdiff_sum
      real(wp), intent(in), optional :: stage_weight
         !! See `ocean_budget_src`.  Absent ⇒ `RK2_STAGE_WEIGHT` (0.5).
      real(wp) :: out
      real(wp) :: w
      w = RK2_STAGE_WEIGHT
      if (present(stage_weight)) w = stage_weight
      out = -w*(adv_sum + hdiff_sum)*RHO_WATER
   end function ocean_budget_out