Count the INTERIOR columns the cavity grounds: wet bed
(b >= LAND_DEPTH_THRESHOLD) but water thickness
b - z_draft < h_min. Interior-only, because the ghost band
carries extrapolated bathymetry and would bias the fraction the
grounded_max_frac sanity bound is taken against.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | b(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | z_draft(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | h_min | |||
| integer, | intent(in) | :: | ng | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(out) | :: | n_grounded | |||
| integer, | intent(out) | :: | n_interior |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure subroutine cavity_count_grounded(b, z_draft, h_min, ng, nx_phys, ny_phys, & nx, ny, n_grounded, n_interior) !! Count the INTERIOR columns the cavity grounds: wet bed !! (`b >= LAND_DEPTH_THRESHOLD`) but water thickness !! `b - z_draft < h_min`. Interior-only, because the ghost band !! carries extrapolated bathymetry and would bias the fraction the !! `grounded_max_frac` sanity bound is taken against. integer, intent(in) :: ng, nx_phys, ny_phys, nx, ny real(wp), intent(in) :: b(nx, ny) real(wp), intent(in) :: z_draft(nx, ny) real(wp), intent(in) :: h_min integer, intent(out) :: n_grounded integer, intent(out) :: n_interior integer :: i, j n_grounded = 0 n_interior = nx_phys*ny_phys do j = ng + 1, ng + ny_phys do i = ng + 1, ng + nx_phys if (b(i, j) >= LAND_DEPTH_THRESHOLD .and. & b(i, j) - z_draft(i, j) < h_min) then n_grounded = n_grounded + 1 end if end do end do end subroutine cavity_count_grounded