NO ICE OVER LAND (design rule R2): force z_draft = 0 on every
column the bathymetry already calls land (b <
LAND_DEPTH_THRESHOLD), and report how many were touched so the
caller can log it.
Why zero rather than refuse: a formula shelf box drawn over a
continent is a normal thing to write, and the physical meaning is
unambiguous (there is no ocean there). Zeroing it keeps land
columns byte-identical to a cavity-free run AND keeps the datum
invariant (I) exact everywhere — bt_H_ref = b - z_draft and
p_ice_ref = rho_ref*g*z_draft are then consistent on every
column, land included, with no merge anywhere downstream.
GROUNDED columns (wet bed, but too little water under the ice) are NOT touched here: they keep their draft and are removed by the wet mask instead, which is what makes the metric-zeroing land mask do the rest.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | z_draft(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | b(nx,ny) | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(out) | :: | n_over_land |
Count of columns whose draft was zeroed (ghosts included). |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure subroutine cavity_apply_land_exclusion(z_draft, b, nx, ny, n_over_land) !! NO ICE OVER LAND (design rule R2): force `z_draft = 0` on every !! column the bathymetry already calls land (`b < !! LAND_DEPTH_THRESHOLD`), and report how many were touched so the !! caller can log it. !! !! Why zero rather than refuse: a formula shelf box drawn over a !! continent is a normal thing to write, and the physical meaning is !! unambiguous (there is no ocean there). Zeroing it keeps land !! columns byte-identical to a cavity-free run AND keeps the datum !! invariant (I) exact everywhere — `bt_H_ref = b - z_draft` and !! `p_ice_ref = rho_ref*g*z_draft` are then consistent on every !! column, land included, with no `merge` anywhere downstream. !! !! GROUNDED columns (wet bed, but too little water under the ice) !! are NOT touched here: they keep their draft and are removed by !! the wet mask instead, which is what makes the metric-zeroing land !! mask do the rest. integer, intent(in) :: nx, ny real(wp), intent(inout) :: z_draft(nx, ny) real(wp), intent(in) :: b(nx, ny) integer, intent(out) :: n_over_land !! Count of columns whose draft was zeroed (ghosts included). integer :: i, j n_over_land = 0 do j = 1, ny do i = 1, nx if (b(i, j) < LAND_DEPTH_THRESHOLD .and. z_draft(i, j) /= 0.0_wp) then z_draft(i, j) = 0.0_wp n_over_land = n_over_land + 1 end if end do end do end subroutine cavity_apply_land_exclusion