module OW_phsscr_areal

use OW_type
use OW_parms_areal
use OW_fftw_areal

implicit none

contains

!---------------------------------------------------------
subroutine owphsscr(iwa,inode,sign,ddws,wv,vel)

integer			:: sign, j, iwa, inode
complex			:: dwss(kxm%n),wv(:),ddws(:)
real			:: vel(:),c(5)
complex			:: tflds(kxm%n)

 c=(/1.,0.5,0.375,0.3125,0.2734375/)

do j=0,1
   dwss=sign*kxm%all**(2*j)*wv
   tflds=dwss
   call owifftexes(tflds,inode)
   dwss=tflds/sqrt(1.*kxm%n)*(vel/rec%w%all(iwa))**(2*j)*c(j+1)
   ddws=ddws+dwss
end do
ddws=ddws*img%z%d*rec%w%all(iwa)*exp(cmplx(0,pi/2))

end subroutine
end module
