Copy 4D real arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension(:, :, :, :) | :: | array_in | ||
real, | intent(out), | dimension(:, :, :, :) | :: | array_out |
subroutine copy_real_array_4(array_in, array_out)
implicit none
real, dimension(:, :, :, :), intent(in) :: array_in
real, dimension(:, :, :, :), intent(out) :: array_out
integer :: counter, start, end
! In a debug build we might want to add a check here that the arrays have
! compatible shape.
start = lbound(array_in, dim = 4)
end = ubound(array_in, dim = 4)
!$OMP PARALLEL DO DEFAULT(none) &
!$OMP SHARED(start, end, array_out, array_in) &
!$OMP SCHEDULE(static)
do counter = start, end
array_out(:, :, :, counter) = array_in(:, :, :, counter)
end do
!$OMP END PARALLEL DO
end subroutine copy_real_array_4