Project the cell-centred cover_frac onto velocity faces with
the OR rule (see the module docstring for why OR and not AND
at a calving front). Host-side, once, at configure.
Faces outside the drag stencil (i = 1 and i > nx for u,
j = 1 and j > ny for v) are left at zero: they are wall /
ghost faces that carry no prognostic velocity, so an exact zero
there is not an approximation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(out) | :: | cover_u(nx+1,ny) | |||
| real(kind=wp), | intent(out) | :: | cover_v(nx,ny+1) | |||
| real(kind=wp), | intent(in) | :: | cover_frac(nx,ny) | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure subroutine top_drag_fill_face_cover_impl(cover_u, cover_v, cover_frac, nx, ny) !! Project the cell-centred `cover_frac` onto velocity faces with !! the **OR** rule (see the module docstring for why OR and not AND !! at a calving front). Host-side, once, at configure. !! !! Faces outside the drag stencil (`i = 1` and `i > nx` for u, !! `j = 1` and `j > ny` for v) are left at zero: they are wall / !! ghost faces that carry no prognostic velocity, so an exact zero !! there is not an approximation. integer, intent(in) :: nx, ny real(wp), intent(in) :: cover_frac(nx, ny) real(wp), intent(out) :: cover_u(nx + 1, ny) real(wp), intent(out) :: cover_v(nx, ny + 1) integer :: i, j do concurrent(j=1:ny, i=1:nx + 1) cover_u(i, j) = 0.0_wp end do do concurrent(j=1:ny + 1, i=1:nx) cover_v(i, j) = 0.0_wp end do do concurrent(j=1:ny, i=2:nx) cover_u(i, j) = max(cover_frac(i - 1, j), cover_frac(i, j)) end do do concurrent(j=2:ny, i=1:nx) cover_v(i, j) = max(cover_frac(i, j - 1), cover_frac(i, j)) end do end subroutine top_drag_fill_face_cover_impl