copy3_impl Subroutine

private pure subroutine copy3_impl(src, buf)

Shared device copy buf = src with shape clipping — every direct-copy derived field routes through here.

Arguments

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

Called by

proc~~copy3_impl~~CalledByGraph proc~copy3_impl copy3_impl proc~fill_h_layer fill_h_layer proc~fill_h_layer->proc~copy3_impl

Variables

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

Source Code

   pure subroutine copy3_impl(src, buf)
      !! Shared device copy `buf = src` with shape clipping — every
      !! direct-copy derived field routes through here.
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded).
      real(wp), intent(in)    :: src(:, :, :)
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, k, nx, ny, nz
      nx = min(size(buf, 1), size(src, 1))
      ny = min(size(buf, 2), size(src, 2))
      nz = min(size(buf, 3), size(src, 3))
      do concurrent(k=1:nz, j=1:ny, i=1:nx)
         buf(i, j, k) = src(i, j, k)
      end do
   end subroutine copy3_impl