C     *********************
C     *  FUNCTION FAULTN  *
C     *********************
C
      COMPLEX FUNCTION FAULTN*16 (FX,FY)
C
      IMPLICIT REAL*8(A-H,O-Z)
      COMPLEX*16 A1,A2,B0,B1,B2,EA,EB,P12,P22,P32, 
     *           U121,U122,U123,U221,U222,U223,U321,U322,U323
C
      COMMON /FPOSI/ X0,Y0,Z0
     *       /SPOSI/ XS,YS,ZS
     *       /CAL01/ DX,DY,DZ,XN,YN,ZN
     *       /CAL02/ SINT,COST,SIND,COSD
     *       /PCONS/ PMU,PLAM,VR,PAI 
     *       /WAVEN/ AK,AK2,AK3,BK,TBK1,TBK2
     *       /OMEGA/ OM
C
      X   =FX*COST-FY*COSD*SINT+X0
      Y   =FX*SINT+FY*COSD*COST+Y0
      Z   =        FY*SIND     +Z0
C
      RX  =X-XS
      RY  =Y-YS
      RZ  =Z-ZS
      R   =DSQRT(RX*RX+RY*RY+RZ*RZ)
C
      TR2 =1.D0/R/R
      TR3 =TR2/R
      TR4 =TR3/R
      TR5 =TR4/R
      TR6 =TR5/R
      TR7 =TR6/R
C
      A1  =DCMPLX(    -AK2*TR3 +3.D0*TR5,          3.D0*AK*TR4)*TBK2
      A2  =DCMPLX(6.D0*AK2*TR5-15.D0*TR7, AK3*TR4-15.D0*AK*TR6)*TBK2
      B0  =DCMPLX(    -TR3               ,-BK*TR2               )
      B1  =DCMPLX(    -TR3 +3.D0*TBK2*TR5,         3.D0*TBK1*TR4)
      B2  =DCMPLX(6.D0*TR5-15.D0*TBK2*TR7, BK*TR4-15.D0*TBK1*TR6)
C
      EA  =CDEXP(DCMPLX(0.D0,-AK*R))
      EB  =CDEXP(DCMPLX(0.D0,-BK*R))
C
      X2Y =RX*RX*RY
      XY2 =RX*RY*RY
      Y2Z =RY*RY*RZ
      YZ2 =RY*RZ*RZ
      Y3  =RY*RY*RY
C
      U121=(RY*B1+X2Y*B2)*EB-(RY*A1+X2Y*A2)*EA
      U122=(RX*B1+XY2*B2)*EB-(RX*A1+XY2*A2)*EA
      U123=RX*RY*RZ*(B2*EB-A2*EA)
      U221=(RX*B0     +RX*B1+XY2*B2)*EB-(     RX*A1+XY2*A2)*EA
      U222=(RY*B0+3.D0*RY*B1 +Y3*B2)*EB-(3.D0*RY*A1 +Y3*A2)*EA
      U223=(RZ*B0     +RZ*B1+Y2Z*B2)*EB-(     RZ*A1+Y2Z*A2)*EA
      U321=U123
      U322=(RZ*B1+Y2Z*B2)*EB-(RZ*A1+Y2Z*A2)*EA
      U323=(RY*B1+YZ2*B2)*EB-(RY*A1+YZ2*A2)*EA
C
      P12 =PLAM*XN*(U121+U222+U323)
     *    +PMU*((U121+U121)*XN+(U221+U122)*YN+(U321+U123)*ZN)
      P22 =PLAM*YN*(U121+U222+U323)
     *    +PMU*((U122+U221)*XN+(U222+U222)*YN+(U322+U223)*ZN)   
      P32 =PLAM*ZN*(U121+U222+U323)
     *    +PMU*((U123+U321)*XN+(U223+U322)*YN+(U323+U323)*ZN)
C
      A   =0.25D0/PAI/PMU
C
      FAULTN=A*(DX*P12+DY*P22+DZ*P32)
C
      END
