       subroutine gpress(i,rh,zh,tauray,zray,dzdr,aray,w,press)
	  
c***********************************************************************
c      Get ray PRESSure
c      Written by Orlando Camargo Rodriguez
c      orodrig@ualg.pt
c      Universidade do Algarve
c      Physics Department
c      Signal Processing Laboratory
c      Faro, 21/11/2010 at 14:30
c****&******************************************************************
c      Include global (common) variables:

       include 'global.for'

c      Define local variables:

       integer*4 i

       real*8 es(2),e1(2),deltar(2)

       real*8 rh,zh,delay,n,sray,tauray,zray,dr,dz,dzdr,thta,w,phi

       complex*16 aray

       complex*16 press

c***********************************************************************
       
       omega = 2*pi*freqx 
       
       thta = atan( dzdr )
       
       es(1) = cos( thta )
       es(2) = sin( thta )

       e1(1) = -es(2)
       e1(2) =  es(1)

       deltar(1) = 0.0
       deltar(2) = zh - zray

       dr = r(i+1) - r(i)
       dz = z(i+1) - z(i)

       call dot(deltar,e1,n)
       call dot(deltar,es,sray)

       n = abs( n )

       sray = sray/sqrt( dr*dr + dz*dz )

       nxn = n*n

       delay = tauray + sray*( tau(i+1) - tau(i) )

       if (n.lt.w) then
       
       phi = (w-n)/w 

c      Acoustic pressure a la Bellhop:
       press = phi*abs( aray )*
     & exp( -imunit*( omega*delay - phase(i) - caustc(i) ) )

       else 
       
       press = (0.0 , 0.0)
       
       end if 
 
c***********************************************************************
c      Back to main:
c*********************************************************************** 

       return 
        
       end
