Count cells whose top-of-column pressure does NOT carry the
isostatic ice load — the melt path’s guard that
configure_ocean_cavity (the sole ms%p_top producer) ran, and
ran before this check.
The test is p_top < p_ice_ref, which is exact rather than a
tolerance: ms%p_top = p_ice_ref + sf%p_surf with
sf%p_surf >= 0 by contract, so a loaded column satisfies it
with no rounding argument at all, and an unloaded one misses it
by the whole 5e6 Pa. A pure predicate, so the refusal can be
tested without provoking the error stop.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | p_top(nx,ny) |
|
||
| real(kind=wp), | intent(in) | :: | p_ice_ref(nx,ny) |
|
||
| integer, | intent(in) | :: | nx |
First dimension. |
||
| integer, | intent(in) | :: | ny |
Second dimension. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure function cavity_count_unloaded_p_top(p_top, p_ice_ref, nx, ny) result(n_unloaded) !! Count cells whose top-of-column pressure does NOT carry the !! isostatic ice load — the melt path's guard that !! `configure_ocean_cavity` (the sole `ms%p_top` producer) ran, and !! ran before this check. !! !! The test is `p_top < p_ice_ref`, which is exact rather than a !! tolerance: `ms%p_top = p_ice_ref + sf%p_surf` with !! `sf%p_surf >= 0` by contract, so a loaded column satisfies it !! with no rounding argument at all, and an unloaded one misses it !! by the whole 5e6 Pa. A `pure` predicate, so the refusal can be !! tested without provoking the `error stop`. integer, intent(in) :: nx !! First dimension. integer, intent(in) :: ny !! Second dimension. real(wp), intent(in) :: p_top(nx, ny) !! `multilayer_state_t%p_top` (Pa). real(wp), intent(in) :: p_ice_ref(nx, ny) !! `metrics%p_ice_ref` (Pa) = `rho_ref*GRAVITY*z_draft`. integer :: n_unloaded integer :: i, j n_unloaded = 0 do j = 1, ny do i = 1, nx if (p_top(i, j) < p_ice_ref(i, j)) n_unloaded = n_unloaded + 1 end do end do end function cavity_count_unloaded_p_top