module OW_blur_areal
!
! Imaging Condition -- crosscorrelation
!

use OW_type
use OW_parms_areal

implicit none

contains
!----------------------------------------------------------
subroutine owblur(ws,recset,souset,GGR,GGS) 

integer					:: ish, ihso, ixw,iw,igap
real					:: recset(:,:),souset(:,:)
complex					:: GGR(:),GGS(:),ws(:)

do igap=1,ngap
   do ish=1,sog%sh%n
      ihso=nint(((ish-1)*sog%sh%d+sog%sh%o)/(sog%xm%d))
      do ixw=1,nx
         if (ixw-ihso >= 1 .and. ixw-ihso <= nx .and. ixw+ihso >= 1 .and. ixw+ihso <= nx) then
             GGR(ixw)=GGR(ixw)+ws(ixw-ihso)*souset(ixw,igap)
             GGS(ixw)=GGS(ixw)+ws(ixw+ihso)*recset(ixw,igap)
         end if
      end do
   end do
end do

end subroutine

end module
