module OW_grabvel_areal
use OW_type
use OW_parms_areal
implicit none
contains
!------------------------------------
subroutine owgrab_velim(velint,vel,ni)
integer   			:: ni
integer				:: nv,j,k
real				:: velint(:), vel(kxm%n,nz),owrk

   nv = floor((xmin-v%xm%o)/v%xm%d)+1
   vel=0
   do k=nzmin,nzmax
   do j=nv,nv+kxm%n-1
      if (velint((k-1)*v%xm%n+j) == 0) then
         vel(j-nv+1,k-nzmin+1)=0
      else
         vel(j-nv+1,k-nzmin+1)=velint((k-1)*v%xm%n+j)
      end if
   end do
   end do

end subroutine
!=========================
end module
