fill_ice_speed_impl Subroutine

private pure subroutine fill_ice_speed_impl(u_ice, v_ice, buf)

Arguments

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

Calls

proc~~fill_ice_speed_impl~~CallsGraph proc~fill_ice_speed_impl fill_ice_speed_impl local local proc~fill_ice_speed_impl->local

Called by

proc~~fill_ice_speed_impl~~CalledByGraph proc~fill_ice_speed_impl fill_ice_speed_impl proc~fill_ice_speed fill_ice_speed proc~fill_ice_speed->proc~fill_ice_speed_impl

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: nx
integer, private :: ny
real(kind=wp), private :: uc
real(kind=wp), private :: vc

Source Code

   pure subroutine fill_ice_speed_impl(u_ice, v_ice, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded);
      ! face-sized u_ice/v_ice have nx+1/ny+1 dims; size() min-clips at call.
      real(wp), intent(in)    :: u_ice(:, :), v_ice(:, :)
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, nx, ny
      real(wp) :: uc, vc
      nx = min(size(buf, 1), size(u_ice, 1) - 1, size(v_ice, 1))
      ny = min(size(buf, 2), size(u_ice, 2), size(v_ice, 2) - 1)
      do concurrent(j=1:ny, i=1:nx) local(uc, vc)
         uc = 0.5_wp*(u_ice(i, j) + u_ice(i + 1, j))
         vc = 0.5_wp*(v_ice(i, j) + v_ice(i, j + 1))
         buf(i, j, 1) = sqrt(uc*uc + vc*vc)
      end do
   end subroutine fill_ice_speed_impl