module OW_grabvel_areal

use OW_type
use OW_parms_areal

implicit none

contains

subroutine owgrab_vel(velint,vel,ni)

integer						:: ni, nv
real						:: velint(:,:), vel(:,:)

! grab velocity in the workspace       
!    if (rec%h%o < img%xm%o .or. rec%h%o > img%xm%o+img%xm%d*(img%xm%n-1)) then
!         call seperr('WORKING SPACE GREATER THAN THE IMAGE SPACE')
!    else
         ni = int((rec%h%o-v%xm%o)/v%xm%d)+1.5
         vel=0;
         vel(:,:)=velint(:,ni:ni+img%xm%n-1);
         write(0,*) "****ni****  ", ni
!    end if

end subroutine

end module
