fill_ice_u_impl Subroutine

private pure subroutine fill_ice_u_impl(u_ice, buf)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: u_ice(:,:)
real(kind=wp), intent(inout) :: buf(:,:,:)

Called by

proc~~fill_ice_u_impl~~CalledByGraph proc~fill_ice_u_impl fill_ice_u_impl proc~fill_ice_u fill_ice_u proc~fill_ice_u->proc~fill_ice_u_impl

Variables

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

Source Code

   pure subroutine fill_ice_u_impl(u_ice, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded);
      ! face-sized u_ice(:,:) has nx+1 first dim, incompatible with cell-sized buf.
      real(wp), intent(in)    :: u_ice(:, :)
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, nx, ny
      nx = min(size(buf, 1), size(u_ice, 1) - 1)
      ny = min(size(buf, 2), size(u_ice, 2))
      do concurrent(j=1:ny, i=1:nx)
         buf(i, j, 1) = 0.5_wp*(u_ice(i, j) + u_ice(i + 1, j))
      end do
   end subroutine fill_ice_u_impl