module submod

contains
  subroutine vecadd (n, a, b, c)
  real(4), device :: a(:), b(:), c(:)
 !real(4)         :: a(:), b(:), c(:)   !  runtime error

  integer(4) :: n

   !$acc kernels deviceptr(a,b,c)
    do i = 1, n
      c(i) = a(i) + b(i)
    end do
   !$acc end kernels
  end subroutine

end module submod

