module OW_grabvel2_areal
use OW_type
use OW_parms_areal

implicit none
contains
!-------------------------------------------------
subroutine owgrab_velim(velint,vel)
integer				:: nv,j,k
real				:: velint(v%xm%n,v%z%n), vel(img%xm%n,img%z%n),owrk
   nv = floor((img%xm%o-v%xm%o)/v%xm%d)+1
   vel=0
   do k=nzmin,nzmax
   do j=nv,nv+img%xm%n-1
         vel(j-nv+1,k-nzmin+1)=velint(j,k)
   end do
   end do
end subroutine
!-------------------------------------------------
subroutine owgrab_velsht(velint,vel,ni,ixs)
integer    			:: ni,ixs
integer				:: nv,j,k
real				:: velint(img%xm%n,img%z%n), vel(kxm%n,img%z%n),owrk
   owrk=(ixs-1)*rec%xd%d+rec%xd%o+rec%h%o-(padtraces+tapertr)*rec%h%d
   ni = (owrk-img%xm%o)/img%xm%d+1.5
   vel=0
   do k=1,img%z%n
   do j=ni,ni+kxm%n-1
      vel(j-ni+1,k)=velint(j,k)
   end do
   end do
end subroutine
!=========================
end module
