C
      COMPLEX FUNCTION FNC*16 (WN)
C
      IMPLICIT REAL*8(A-H,O-Z)
      COMPLEX*16 SM1,SM2,WB1,WB2,CM1,CM2,CQ1,SQ1,SCM
      COMMON /DATA/ OM,X,WB1,WB2,SM1,SM2,THK
C
      W2=WN*WN
      CM1=CDSQRT(WB1-W2)
      CM2=CDSQRT(WB2-W2)
      IF(IMAG(CM1).GT.0.D0)CM1=-CM1
      IF(IMAG(CM2).GT.0.D0)CM2=-CM2
C
      SCM=SM2*CM2/(SM1*CM1)
      CQ1=CDCOS(THK*CM1)
      SQ1=CDSIN(THK*CM1)
      FNC=DCMPLX(0.D0,1.D0)*SM2*CM2*CQ1-SM1*CM1*SQ1
      FNC=DCOS(WN*X)*(CQ1+DCMPLX(0.D0,1.D0)*SCM*SQ1)/FNC
C
      RETURN
      END
