cavity_comp_withdrawal Function

public pure function cavity_comp_withdrawal(vol_melt, area_open) result(dw)

The uniform per-unit-area thickness the uniform_open_ocean sink removes: vol_melt/area_open, and exactly zero when there is no open ocean to remove it from (a fully ice-covered domain — the sink then does nothing rather than dividing by zero, and the volume stays in, which the mass budget reports honestly as a growing total).

pure, separate from the kernels, so the test suite can assert the arithmetic and the no-open-ocean fallback directly.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: vol_melt

Meltwater volume this step (m^3); either sign.

real(kind=wp), intent(in) :: area_open

Uncovered wet area (m^2), >= 0.

Return Value real(kind=wp)


Called by

proc~~cavity_comp_withdrawal~~CalledByGraph proc~cavity_comp_withdrawal cavity_comp_withdrawal proc~ocean_cavity_mass_step ocean_cavity_mass_step proc~ocean_cavity_mass_step->proc~cavity_comp_withdrawal proc~run_stage run_stage proc~run_stage->proc~ocean_cavity_mass_step proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_cavity_mass_step 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

Source Code

   pure function cavity_comp_withdrawal(vol_melt, area_open) result(dw)
      !! The uniform per-unit-area thickness the `uniform_open_ocean`
      !! sink removes: `vol_melt/area_open`, and exactly zero when there
      !! is no open ocean to remove it from (a fully ice-covered domain —
      !! the sink then does nothing rather than dividing by zero, and the
      !! volume stays in, which the mass budget reports honestly as a
      !! growing total).
      !!
      !! `pure`, separate from the kernels, so the test suite can assert
      !! the arithmetic and the no-open-ocean fallback directly.
      real(wp), intent(in) :: vol_melt
         !! Meltwater volume this step (m^3); either sign.
      real(wp), intent(in) :: area_open
         !! Uncovered wet area (m^2), >= 0.
      real(wp) :: dw
      if (area_open > H_DIV_EPS) then
         dw = vol_melt/area_open
      else
         dw = 0.0_wp
      end if
   end function cavity_comp_withdrawal