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.
| Type | Intent | Optional | 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. |
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