C
      SUBROUTINE FNC2(WN,FW,FU,XX,DNS,VP,VS,THK,ML)
C
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION DNS(ML),THK(ML)
      COMPLEX*16 FW,FU,VP(ML),VS(ML)
     *          ,AA(4,4),SA(4,4),SB(4,4),CPX
     *          ,WP2,WS2,CMP,CMS,BM2,PM,QM,RBM,RAM
     *          ,CQ,SQ,STQ,SDQ,CP,SP,STP,SDP,GM
     *          ,C11,C12,C13,C14,C15,C16,D11,D12,D13,D14,D15
     *          ,GN,RAN,RBN,RL,RK,RN,RM,GS2,RS2,HS2,SS2
     *          ,FWZ0,FWX0,FUZ0,FUX0,FR,EPD,ESD,CMPN,CMSN
     *          ,B11,B12,B13,B14,B21,B22,B23,B24
     *          ,AS2(4,4),AR1(4,4),AR2(4,4),FWZR,FWXR,FUZR,FUXR
     *          ,FWZN,FWXN,FUZN,FUXN,FSZN,FSXN,FNZN,FNXN
     *          ,AN11,AN12,AN21,AN22,GAB,EAO,EBO,GAB1
     *          ,AS1(4,4),FWZS,FWXS,FUZS,FUXS
      COMMON /FDAT/ OM,NL,SDEP,LS,ODEP,LO,QX,QZ
C
      WN2=WN*WN
      OM2=OM*OM
      CV=OM/WN
      CV2=CV*CV
      CPX=DCMPLX(0.D0,1.D0)
C
C *** AA MATRIX ***
C
      DO 100 I=1,4
        DO 110 J=1,4
          AA(I,J) =(0.0D0,0.0D0)
  110   CONTINUE
        AA(I,I)=(1.0D0,0.0D0)
  100 CONTINUE
C
      DO 150 IL=NL-1,1,-1
C
        DO 160 I=1,4
          DO 170 J=1,4
            SA(I,J) =AA(I,J)
  170     CONTINUE
  160   CONTINUE
C
        BM2=VS(IL)*VS(IL)
        WP2=OM2/(VP(IL)*VP(IL))
        WS2=OM2/BM2
C
        CMP=CDSQRT(WP2-WN2)
        CMS=CDSQRT(WS2-WN2)
        IF(IMAG(CMP).GT.0.D0)CMP=-CMP
        IF(IMAG(CMS).GT.0.D0)CMS=-CMS
C
        RAM=CMP/WN
        PM=CMP*THK(IL)
        CP=CDCOS(PM)
        SP=CDSIN(PM)
        STP=RAM*SP
        SDP=SP/RAM
C
        RBM=CMS/WN
        QM=CMS*THK(IL)
        CQ=CDCOS(QM)
        SQ=CDSIN(QM)
        STQ=RBM*SQ
        SDQ=SQ/RBM
C
        GM=2.D0*BM2/CV2
        C11=GM
        C12=GM-1.D0
        C13=GM*GM
        C14=C12*C12
        C16=DNS(IL)*CV2
        C15=1.D0/C16
C
        D11=CP-CQ
        D12=SDP+STQ
        D13=STP+SDQ
        D14=C14*SDP+C13*STQ
        D15=C13*STP+C14*SDQ
C
        SB(1,1)= C11*CP-C12*CQ
        SB(1,2)= (C12*SDP+C11*STQ)*CPX
        SB(1,3)=-C15*D11
        SB(1,4)= C15*D12*CPX
        SB(2,1)=-(C11*STP+C12*SDQ)*CPX
        SB(2,2)=-C12*CP+C11*CQ
        SB(2,3)= C15*D13*CPX
        SB(2,4)= SB(1,3)
        SB(3,1)= C16*C11*C12*D11
        SB(3,2)= C16*D14*CPX
        SB(3,3)= SB(2,2)
        SB(3,4)= SB(1,2)
        SB(4,1)= C16*D15*CPX
        SB(4,2)= SB(3,1)
        SB(4,3)= SB(2,1)
        SB(4,4)= SB(1,1)
C
        DO 180 I=1,4
          DO 190 J=1,4
            AA(I,J)=(0.D0,0.D0)
            DO 195 K=1,4
              AA(I,J) =AA(I,J) +SA(I,K)*SB(K,J)
  195       CONTINUE
  190     CONTINUE
  180   CONTINUE
C
  150 CONTINUE
C
C *** RL-RM AND FR ***
C
      BM2=VS(NL)*VS(NL)
      WP2=OM2/(VP(NL)*VP(NL))
      WS2=OM2/BM2
      CMPN=CDSQRT(WP2-WN2)
      CMSN=CDSQRT(WS2-WN2)
      IF(IMAG(CMPN).GT.0.D0)CMPN=-CMPN
      IF(IMAG(CMSN).GT.0.D0)CMSN=-CMSN
C
      GN=2.D0*BM2/CV2
      RAN=CMPN/WN
      RBN=CMSN/WN
C
      B11=GN*RAN
      B12=GN-1.D0
      B14=1.D0/(DNS(NL)*CV2)
      B13=-RAN*B14
      B21=-B12
      B22=GN*RBN
      B23=B14
      B24=RBN*B14
C
      RL=B11*AA(1,1)+B12*AA(2,1)+B13*AA(3,1)+B14*AA(4,1)
      RK=B11*AA(1,2)+B12*AA(2,2)+B13*AA(3,2)+B14*AA(4,2)
      RN=B21*AA(1,1)+B22*AA(2,1)+B23*AA(3,1)+B24*AA(4,1)
      RM=B21*AA(1,2)+B22*AA(2,2)+B23*AA(3,2)+B24*AA(4,2)
C
      FR=RN*RK-RL*RM
C
C *** SP AND OB ***
C
      IF(LS.EQ.NL)THEN
C
        EPD=CDEXP(-CPX*CMPN*SDEP)
        ESD=CDEXP(-CPX*CMSN*SDEP)
        RS2= B14*EPD
        GS2=-RAN*RS2
        HS2= B14*ESD
        SS2= RBN*HS2
C
        FWZ0=GS2*RN-HS2*RL
        FWX0=RS2*RN-SS2*RL
        FUZ0=GS2*RM-HS2*RK
        FUX0=RS2*RM-SS2*RK
C
        IF((LO.LT.LS).OR.((LO.EQ.LS).AND.(ODEP.LE.SDEP)))THEN
C
          DO 200 I=1,4
            DO 210 J=1,4
              AR1(I,J) =(0.0D0,0.0D0)
  210       CONTINUE
            AR1(I,I)=(1.0D0,0.0D0)
  200     CONTINUE
C
          DO 250 IL=LO,1,-1
C
            DO 260 I=1,4
              DO 270 J=1,4
                SA(I,J) =AR1(I,J)
  270         CONTINUE
  260       CONTINUE
C
            BM2=VS(IL)*VS(IL)
            WP2=OM2/(VP(IL)*VP(IL))
            WS2=OM2/BM2
C
            CMP=CDSQRT(WP2-WN2)
            CMS=CDSQRT(WS2-WN2)
            IF(IMAG(CMP).GT.0.D0)CMP=-CMP
            IF(IMAG(CMS).GT.0.D0)CMS=-CMS
C
            RAM=CMP/WN
            PM=CMP*THK(IL)
            IF(IL.EQ.LO)PM=CMP*ODEP
            CP=CDCOS(PM)
            SP=CDSIN(PM)
            STP=RAM*SP
            SDP=SP/RAM
C
            RBM=CMS/WN
            QM=CMS*THK(IL)
            IF(IL.EQ.LO)QM=CMS*ODEP
            CQ=CDCOS(QM)
            SQ=CDSIN(QM)
            STQ=RBM*SQ
            SDQ=SQ/RBM
C
            GM=2.D0*BM2/CV2
            C11=GM
            C12=GM-1.D0
            C13=GM*GM
            C14=C12*C12
            C16=DNS(IL)*CV2
            C15=1.D0/C16
C
            D11=CP-CQ
            D12=SDP+STQ
            D13=STP+SDQ
            D14=C14*SDP+C13*STQ
            D15=C13*STP+C14*SDQ
C
            SB(1,1)= C11*CP-C12*CQ
            SB(1,2)= (C12*SDP+C11*STQ)*CPX
            SB(1,3)=-C15*D11
            SB(1,4)= C15*D12*CPX
            SB(2,1)=-(C11*STP+C12*SDQ)*CPX
            SB(2,2)=-C12*CP+C11*CQ
            SB(2,3)= C15*D13*CPX
            SB(2,4)= SB(1,3)
            SB(3,1)= C16*C11*C12*D11
            SB(3,2)= C16*D14*CPX
            SB(3,3)= SB(2,2)
            SB(3,4)= SB(1,2)
            SB(4,1)= C16*D15*CPX
            SB(4,2)= SB(3,1)
            SB(4,3)= SB(2,1)
            SB(4,4)= SB(1,1)
C
            DO 280 I=1,4
              DO 290 J=1,4
                AR1(I,J)=(0.D0,0.D0)
                DO 295 K=1,4
                  AR1(I,J) =AR1(I,J) +SA(I,K)*SB(K,J)
  295           CONTINUE
  290         CONTINUE
  280       CONTINUE
C
  250     CONTINUE
C
          FWZR=AR1(2,2)*FWZ0-AR1(2,1)*FUZ0
          FWXR=AR1(2,2)*FWX0-AR1(2,1)*FUX0
          FUZR=AR1(1,1)*FUZ0-AR1(1,2)*FWZ0
          FUXR=AR1(1,1)*FUX0-AR1(1,2)*FWX0
C
        ELSE
C
          DO 300 I=1,4
            DO 310 J=1,4
              AS1(I,J) =(0.0D0,0.0D0)
  310       CONTINUE
            AS1(I,I)=(1.0D0,0.0D0)
  300     CONTINUE
C
          DO 350 IL=LS,1,-1
C
            DO 360 I=1,4
              DO 370 J=1,4
                SA(I,J) =AS1(I,J)
  370         CONTINUE
  360       CONTINUE
C
            BM2=VS(IL)*VS(IL)
            WP2=OM2/(VP(IL)*VP(IL))
            WS2=OM2/BM2
C
            CMP=CDSQRT(WP2-WN2)
            CMS=CDSQRT(WS2-WN2)
            IF(IMAG(CMP).GT.0.D0)CMP=-CMP
            IF(IMAG(CMS).GT.0.D0)CMS=-CMS
C
            RAM=CMP/WN
            PM=CMP*THK(IL)
            IF(IL.EQ.LS)PM=CMP*SDEP
            CP=CDCOS(PM)
            SP=CDSIN(PM)
            STP=RAM*SP
            SDP=SP/RAM
C
            RBM=CMS/WN
            QM=CMS*THK(IL)
            IF(IL.EQ.LS)QM=CMS*SDEP
            CQ=CDCOS(QM)
            SQ=CDSIN(QM)
            STQ=RBM*SQ
            SDQ=SQ/RBM
C
            GM=2.D0*BM2/CV2
            C11=GM
            C12=GM-1.D0
            C13=GM*GM
            C14=C12*C12
            C16=DNS(IL)*CV2
            C15=1.D0/C16
C
            D11=CP-CQ
            D12=SDP+STQ
            D13=STP+SDQ
            D14=C14*SDP+C13*STQ
            D15=C13*STP+C14*SDQ
C
            SB(1,1)= C11*CP-C12*CQ
            SB(1,2)= (C12*SDP+C11*STQ)*CPX
            SB(1,3)=-C15*D11
            SB(1,4)= C15*D12*CPX
            SB(2,1)=-(C11*STP+C12*SDQ)*CPX
            SB(2,2)=-C12*CP+C11*CQ
            SB(2,3)= C15*D13*CPX
            SB(2,4)= SB(1,3)
            SB(3,1)= C16*C11*C12*D11
            SB(3,2)= C16*D14*CPX
            SB(3,3)= SB(2,2)
            SB(3,4)= SB(1,2)
            SB(4,1)= C16*D15*CPX
            SB(4,2)= SB(3,1)
            SB(4,3)= SB(2,1)
            SB(4,4)= SB(1,1)
C
            DO 380 I=1,4
              DO 390 J=1,4
                AS1(I,J)=(0.D0,0.D0)
                DO 395 K=1,4
                  AS1(I,J) =AS1(I,J) +SA(I,K)*SB(K,J)
  395           CONTINUE
  390         CONTINUE
  380       CONTINUE
C
  350     CONTINUE
C
          FWZS=AS1(2,2)*FWZ0-AS1(2,1)*FUZ0
          FWXS=AS1(2,2)*FWX0-AS1(2,1)*FUX0
          FUZS=AS1(1,1)*FUZ0-AS1(1,2)*FWZ0
          FUXS=AS1(1,1)*FUX0-AS1(1,2)*FWX0
C
          BM2=VS(NL)*VS(NL)
          WP2=OM2/(VP(NL)*VP(NL))
          WS2=OM2/BM2
          CMPN=CDSQRT(WP2-WN2)
          CMSN=CDSQRT(WS2-WN2)
          IF(IMAG(CMPN).GT.0.D0)CMPN=-CMPN
          IF(IMAG(CMSN).GT.0.D0)CMSN=-CMSN
C
          GN=2.D0*BM2/CV2
          RAN=CMPN/WN
          RBN=CMSN/WN
C
          GAB=RAN*RBN
          GAB1=1.D0/(1.D0+GAB)
          EAO=CDEXP(DCMPLX(0.D0,-CMPN*(ODEP-SDEP)))
          EBO=CDEXP(DCMPLX(0.D0,-CMSN*(ODEP-SDEP)))
C
          AN11=GAB1*(EAO+GAB*EBO)
          AN12=RBN*GAB1*(EAO-EBO)
          AN21=RAN*GAB1*(EAO-EBO)
          AN22=GAB1*(GAB*EAO+EBO)
C
          FWZR=AN22*FWZS-AN21*FUZS
          FWXR=AN22*FWXS-AN21*FUXS
          FUZR=AN12*FWZS-AN11*FUZS
          FUXR=AN12*FWXS-AN11*FUXS
C
        END IF
C
      ELSE
C
        DO 400 I=1,4
          DO 410 J=1,4
            AS2(I,J) =(0.0D0,0.0D0)
  410     CONTINUE
          AS2(I,I)=(1.0D0,0.0D0)
  400   CONTINUE
C
        DO 450 IL=NL-1,LS,-1
C
          DO 460 I=1,4
            DO 470 J=1,4
              SA(I,J) =AS2(I,J)
  470       CONTINUE
  460     CONTINUE
C
          BM2=VS(IL)*VS(IL)
          WP2=OM2/(VP(IL)*VP(IL))
          WS2=OM2/BM2
C
          CMP=CDSQRT(WP2-WN2)
          CMS=CDSQRT(WS2-WN2)
          IF(IMAG(CMP).GT.0.D0)CMP=-CMP
          IF(IMAG(CMS).GT.0.D0)CMS=-CMS
C
          RAM=CMP/WN
          PM=CMP*THK(IL)
          IF(IL.EQ.LS)PM=CMP*(THK(IL)-SDEP)
          CP=CDCOS(PM)
          SP=CDSIN(PM)
          STP=RAM*SP
          SDP=SP/RAM
C
          RBM=CMS/WN
          QM=CMS*THK(IL)
          IF(IL.EQ.LS)QM=CMS*(THK(IL)-SDEP)
          CQ=CDCOS(QM)
          SQ=CDSIN(QM)
          STQ=RBM*SQ
          SDQ=SQ/RBM
C
          GM=2.D0*BM2/CV2
          C11=GM
          C12=GM-1.D0
          C13=GM*GM
          C14=C12*C12
          C16=DNS(IL)*CV2
          C15=1.D0/C16
C
          D11=CP-CQ
          D12=SDP+STQ
          D13=STP+SDQ
          D14=C14*SDP+C13*STQ
          D15=C13*STP+C14*SDQ
C
          SB(1,1)= C11*CP-C12*CQ
          SB(1,2)= (C12*SDP+C11*STQ)*CPX
          SB(1,3)=-C15*D11
          SB(1,4)= C15*D12*CPX
          SB(2,1)=-(C11*STP+C12*SDQ)*CPX
          SB(2,2)=-C12*CP+C11*CQ
          SB(2,3)= C15*D13*CPX
          SB(2,4)= SB(1,3)
          SB(3,1)= C16*C11*C12*D11
          SB(3,2)= C16*D14*CPX
          SB(3,3)= SB(2,2)
          SB(3,4)= SB(1,2)
          SB(4,1)= C16*D15*CPX
          SB(4,2)= SB(3,1)
          SB(4,3)= SB(2,1)
          SB(4,4)= SB(1,1)
C
          DO 480 I=1,4
            DO 490 J=1,4
              AS2(I,J)=(0.D0,0.D0)
              DO 495 K=1,4
                AS2(I,J) =AS2(I,J) +SA(I,K)*SB(K,J)
  495         CONTINUE
  490       CONTINUE
  480     CONTINUE
C
  450   CONTINUE
C
C
        GS2=B11*AS2(1,3)+B12*AS2(2,3)+B13*AS2(3,3)+B14*AS2(4,3)
        RS2=B11*AS2(1,4)+B12*AS2(2,4)+B13*AS2(3,4)+B14*AS2(4,4)
        HS2=B21*AS2(1,3)+B22*AS2(2,3)+B23*AS2(3,3)+B24*AS2(4,3)
        SS2=B21*AS2(1,4)+B22*AS2(2,4)+B23*AS2(3,4)+B24*AS2(4,4)
C
        FWZ0=GS2*RN-HS2*RL
        FWX0=RS2*RN-SS2*RL
        FUZ0=GS2*RM-HS2*RK
        FUX0=RS2*RM-SS2*RK
C
C *** OP : FWZR - FURX ***
C
        IF((LO.LT.LS).OR.((LO.EQ.LS).AND.(ODEP.LE.SDEP)))THEN
C
          DO 500 I=1,4
            DO 510 J=1,4
              AR1(I,J) =(0.0D0,0.0D0)
  510       CONTINUE
            AR1(I,I)=(1.0D0,0.0D0)
  500     CONTINUE
C
          DO 550 IL=LO,1,-1
C
            DO 560 I=1,4
              DO 570 J=1,4
                SA(I,J) =AR1(I,J)
  570         CONTINUE
  560       CONTINUE
C
            BM2=VS(IL)*VS(IL)
            WP2=OM2/(VP(IL)*VP(IL))
            WS2=OM2/BM2
C
            CMP=CDSQRT(WP2-WN2)
            CMS=CDSQRT(WS2-WN2)
            IF(IMAG(CMP).GT.0.D0)CMP=-CMP
            IF(IMAG(CMS).GT.0.D0)CMS=-CMS
C
            RAM=CMP/WN
            PM=CMP*THK(IL)
            IF(IL.EQ.LO)PM=CMP*ODEP
            CP=CDCOS(PM)
            SP=CDSIN(PM)
            STP=RAM*SP
            SDP=SP/RAM
C
            RBM=CMS/WN
            QM=CMS*THK(IL)
            IF(IL.EQ.LO)QM=CMS*ODEP
            CQ=CDCOS(QM)
            SQ=CDSIN(QM)
            STQ=RBM*SQ
            SDQ=SQ/RBM
C
            GM=2.D0*BM2/CV2
            C11=GM
            C12=GM-1.D0
            C13=GM*GM
            C14=C12*C12
            C16=DNS(IL)*CV2
            C15=1.D0/C16
C
            D11=CP-CQ
            D12=SDP+STQ
            D13=STP+SDQ
            D14=C14*SDP+C13*STQ
            D15=C13*STP+C14*SDQ
C
            SB(1,1)= C11*CP-C12*CQ
            SB(1,2)= (C12*SDP+C11*STQ)*CPX
            SB(1,3)=-C15*D11
            SB(1,4)= C15*D12*CPX
            SB(2,1)=-(C11*STP+C12*SDQ)*CPX
            SB(2,2)=-C12*CP+C11*CQ
            SB(2,3)= C15*D13*CPX
            SB(2,4)= SB(1,3)
            SB(3,1)= C16*C11*C12*D11
            SB(3,2)= C16*D14*CPX
            SB(3,3)= SB(2,2)
            SB(3,4)= SB(1,2)
            SB(4,1)= C16*D15*CPX
            SB(4,2)= SB(3,1)
            SB(4,3)= SB(2,1)
            SB(4,4)= SB(1,1)
C
            DO 580 I=1,4
              DO 590 J=1,4
                AR1(I,J)=(0.D0,0.D0)
                DO 595 K=1,4
                  AR1(I,J) =AR1(I,J) +SA(I,K)*SB(K,J)
  595           CONTINUE
  590         CONTINUE
  580       CONTINUE
C
  550     CONTINUE
C
          FWZR=AR1(2,2)*FWZ0-AR1(2,1)*FUZ0
          FWXR=AR1(2,2)*FWX0-AR1(2,1)*FUX0
          FUZR=AR1(1,1)*FUZ0-AR1(1,2)*FWZ0
          FUXR=AR1(1,1)*FUX0-AR1(1,2)*FWX0
C
        ELSE
C
          FWZN=AA(2,2)*FWZ0-AA(2,1)*FUZ0-AS2(2,3)*FR
          FWXN=AA(2,2)*FWX0-AA(2,1)*FUX0-AS2(2,4)*FR
          FUZN=AA(1,1)*FUZ0-AA(1,2)*FWZ0+AS2(1,3)*FR
          FUXN=AA(1,1)*FUX0-AA(1,2)*FWX0+AS2(1,4)*FR
          FSZN=AA(4,2)*FWZ0-AA(4,1)*FUZ0-AS2(4,3)*FR
          FSXN=AA(4,2)*FWX0-AA(4,1)*FUX0-AS2(4,4)*FR
          FNZN=AA(3,1)*FUZ0-AA(3,2)*FWZ0+AS2(3,3)*FR
          FNXN=AA(3,1)*FUX0-AA(3,2)*FWX0+AS2(3,4)*FR
C
          IF(LO.NE.NL)THEN
C
            DO 600 I=1,4
              DO 610 J=1,4
                AR2(I,J) =(0.0D0,0.0D0)
  610         CONTINUE
              AR2(I,I)=(1.0D0,0.0D0)
  600       CONTINUE
C
            DO 650 IL=NL-1,LO,-1
C
              DO 660 I=1,4
                DO 670 J=1,4
                  SA(I,J) =AR2(I,J)
  670           CONTINUE
  660         CONTINUE
C
              BM2=VS(IL)*VS(IL)
              WP2=OM2/(VP(IL)*VP(IL))
              WS2=OM2/BM2
C
              CMP=CDSQRT(WP2-WN2)
              CMS=CDSQRT(WS2-WN2)
              IF(IMAG(CMP).GT.0.D0)CMP=-CMP
              IF(IMAG(CMS).GT.0.D0)CMS=-CMS
C
              RAM=CMP/WN
              PM=CMP*THK(IL)
              IF(IL.EQ.LO)PM=CMP*(THK(IL)-ODEP)
              CP=CDCOS(PM)
              SP=CDSIN(PM)
              STP=RAM*SP
              SDP=SP/RAM
C
              RBM=CMS/WN
              QM=CMS*THK(IL)
              IF(IL.EQ.LO)QM=CMS*(THK(IL)-ODEP)
              CQ=CDCOS(QM)
              SQ=CDSIN(QM)
              STQ=RBM*SQ
              SDQ=SQ/RBM
C
              GM=2.D0*BM2/CV2
              C11=GM
              C12=GM-1.D0
              C13=GM*GM
              C14=C12*C12
              C16=DNS(IL)*CV2
              C15=1.D0/C16
C
              D11=CP-CQ
              D12=SDP+STQ
              D13=STP+SDQ
              D14=C14*SDP+C13*STQ
              D15=C13*STP+C14*SDQ
C
              SB(1,1)= C11*CP-C12*CQ
              SB(1,2)= (C12*SDP+C11*STQ)*CPX
              SB(1,3)=-C15*D11
              SB(1,4)= C15*D12*CPX
              SB(2,1)=-(C11*STP+C12*SDQ)*CPX
              SB(2,2)=-C12*CP+C11*CQ
              SB(2,3)= C15*D13*CPX
              SB(2,4)= SB(1,3)
              SB(3,1)= C16*C11*C12*D11
              SB(3,2)= C16*D14*CPX
              SB(3,3)= SB(2,2)
              SB(3,4)= SB(1,2)
              SB(4,1)= C16*D15*CPX
              SB(4,2)= SB(3,1)
              SB(4,3)= SB(2,1)
              SB(4,4)= SB(1,1)
C
              DO 680 I=1,4
                DO 690 J=1,4
                  AR2(I,J)=(0.D0,0.D0)
                  DO 695 K=1,4
                    AR2(I,J) =AR2(I,J) +SA(I,K)*SB(K,J)
  695             CONTINUE
  690           CONTINUE
  680         CONTINUE
C
  650       CONTINUE
C
            FWZR=AR2(4,3)*FUZN+AR2(3,3)*FWZN
     *          +AR2(2,3)*FNZN+AR2(1,3)*FSZN
            FWXR=AR2(4,3)*FUXN+AR2(3,3)*FWXN
     *          +AR2(2,3)*FNXN+AR2(1,3)*FSXN
            FUZR=AR2(4,4)*FUZN+AR2(3,4)*FWZN
     *          +AR2(2,4)*FNZN+AR2(1,4)*FSZN
            FUXR=AR2(4,4)*FUXN+AR2(3,4)*FWXN
     *          +AR2(2,4)*FNXN+AR2(1,4)*FSXN
C
          ELSE
C
            BM2=VS(NL)*VS(NL)
            WP2=OM2/(VP(NL)*VP(NL))
            WS2=OM2/BM2
            CMPN=CDSQRT(WP2-WN2)
            CMSN=CDSQRT(WS2-WN2)
            IF(IMAG(CMPN).GT.0.D0)CMPN=-CMPN
            IF(IMAG(CMSN).GT.0.D0)CMSN=-CMSN
C
            GN=2.D0*BM2/CV2
            RAN=CMPN/WN
            RBN=CMSN/WN
C
            GAB=RAN*RBN
            GAB1=1.D0/(1.D0+GAB)
            EAO=CDEXP(DCMPLX(0.D0,-CMPN*ODEP))
            EBO=CDEXP(DCMPLX(0.D0,-CMSN*ODEP))
C
            AN11=GAB1*(EAO+GAB*EBO)
            AN12=RBN*GAB1*(EAO-EBO)
            AN21=RAN*GAB1*(EAO-EBO)
            AN22=GAB1*(GAB*EAO+EBO)
C
            FWZR=AN22*FWZN-AN21*FUZN
            FWXR=AN22*FWXN-AN21*FUXN
            FUZR=AN12*FWZN-AN11*FUZN
            FUXR=AN12*FWXN-AN11*FUXN
C
          END IF
C
        END IF
C
      END IF
C
      WNX=WN*XX
      CKX=DCOS(WNX)
      SKX=DSIN(WNX)
C
      FW=( FWZR*CKX*QZ-CPX*FWXR*SKX*QX)/(WN*FR)
      FU=(-CPX*FUZR*SKX*QZ+FUXR*CKX*QX)/(WN*FR)
C
      RETURN
      END
