top_drag_fill_face_cover_impl Subroutine

public 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.

Arguments

Type IntentOptional 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

Called by

proc~~top_drag_fill_face_cover_impl~~CalledByGraph proc~top_drag_fill_face_cover_impl top_drag_fill_face_cover_impl proc~configure_ocean_top_drag configure_ocean_top_drag proc~configure_ocean_top_drag->proc~top_drag_fill_face_cover_impl proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_top_drag proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j

Source Code

   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