






















































































































 


































































































































































 





































































































































































































 






















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                





































      REAL*8 function phif(x,y)

      implicit none

      REAL*8 x,y
      REAL*8 zero,half,one,two,pi

c

      zero = 0.0D0
      half = 0.5D0
      one  = 1.0D0
      two  = 2.0D0

      pi = acos(-one)

c

      if (abs(x).gt.abs(y)) then
         phif = atan(abs(y/x))
      else if (abs(x).lt.abs(y)) then
         phif = half*pi - atan(abs(x/y))
      else
         phif = 0.25D0*pi
      end if

c

      if ((x.eq.zero).and.(y.eq.zero)) then
         phif = zero
      else if ((x.le.zero).and.(y.ge.zero)) then
         phif = pi - phif
      else if ((x.le.zero).and.(y.le.zero)) then
         phif = pi + phif
      else if ((x.ge.zero).and.(y.le.zero)) then
         phif = two*pi - phif
      end if

      return
      end
