fill_ice_v_impl Subroutine

private pure subroutine fill_ice_v_impl(v_ice, buf)

Arguments

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

Called by

proc~~fill_ice_v_impl~~CalledByGraph proc~fill_ice_v_impl fill_ice_v_impl proc~fill_ice_v fill_ice_v proc~fill_ice_v->proc~fill_ice_v_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_v_impl(v_ice, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded);
      ! face-sized v_ice(:,:) has ny+1 second dim, incompatible with cell-sized buf.
      real(wp), intent(in)    :: v_ice(:, :)
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, nx, ny
      nx = min(size(buf, 1), size(v_ice, 1))
      ny = min(size(buf, 2), size(v_ice, 2) - 1)
      do concurrent(j=1:ny, i=1:nx)
         buf(i, j, 1) = 0.5_wp*(v_ice(i, j) + v_ice(i, j + 1))
      end do
   end subroutine fill_ice_v_impl