C
C *** CALUCULATION OF FLK, FLW AND SO ON ***
C
      SUBROUTINE FLFK(ML,NL,DNS,VS,THK,CV,WN,FLK,FLW,RBN,SM)
C
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION VS(ML),THK(ML),DNS(ML)
      COMPLEX*16 R11,R12,R21,R22,SA11,SA12,SA21,SA22
     *          ,SB11,SB12,SB21,SB22
     *          ,RK11,RK12,RK21,RK22,SAK11,SAK12,SAK21,SAK22
     *          ,SBK11,SBK12,SBK21,SBK22
     *          ,RW11,RW12,RW21,RW22,SAW11,SAW12,SAW21,SAW22
     *          ,SBW11,SBW12,SBW21,SBW22,RBN,RR11,RR12,RR21,RR22
C
      R11=(1.0D0,0.0D0)
      R12=(0.0D0,0.0D0)
      R21=(0.0D0,0.0D0)
      R22=(1.0D0,0.0D0)
C
      RK11=(0.0D0,0.0D0)
      RK12=(0.0D0,0.0D0)
      RK21=(0.0D0,0.0D0)
      RK22=(0.0D0,0.0D0)
C
      RW11=(0.0D0,0.0D0)
      RW12=(0.0D0,0.0D0)
      RW21=(0.0D0,0.0D0)
      RW22=(0.0D0,0.0D0)
C
C *** AL11, AL12, AL21 AND AL22 (=RR11,RR12,RR21,RR22) ***
C
      DO 120 IL=NL-1, 1, -1 
C
        SA11=R11
        SA12=R12
        SA21=R21
        SA22=R22
C
        SAK11=RK11
        SAK12=RK12
        SAK21=RK21
        SAK22=RK22
C
        SAW11=RW11
        SAW12=RW12
        SAW21=RW21
        SAW22=RW22
C
        BM=VS(IL)
        SM=DNS(IL)*BM*BM
        CB2=CV*CV/(BM*BM)
        CALL CSTD(WN,BM,CV,CB2,THK(IL),CQ,STQ,SDQ)
C
        DSG=THK(IL)*SDQ
        DC=THK(IL)*CQ
        SGK=SDQ/WN
        RBM2=CB2-1.D0
        SG2=SM*RBM2
C
        SB11=DCMPLX(CQ,0.0D0)
        SB12=DCMPLX(0.0D0,SDQ/SM)
        SB21=DCMPLX(0.0D0,STQ*SM)
        SB22=DCMPLX(CQ,0.0D0)
C
        SBK11=DCMPLX(DSG,0.0D0)
        SBK12=DCMPLX(0.0D0,(CB2*SGK-DC)/SG2)
        SBK21=DCMPLX(0.0D0,-SM*(CB2*SGK+DC))
        SBK22=DCMPLX(DSG,0.0D0)
C
        CVM2=CV/(BM*BM)
        SBW11=CVM2*DCMPLX(-DSG,0.0D0)
        SBW12=CVM2*DCMPLX(0.0D0,(-SGK+DC)/SG2)
        SBW21=CVM2*DCMPLX(0.0D0,SM*(SGK+DC))
        SBW22=CVM2*DCMPLX(-DSG,0.0D0)
C
        R11=SA11*SB11+SA12*SB21
        R12=SA11*SB12+SA12*SB22
        R21=SA21*SB11+SA22*SB21
        R22=SA21*SB12+SA22*SB22
C
        RK11=SAK11*SB11+SAK12*SB21+SA11*SBK11+SA12*SBK21
        RK12=SAK11*SB12+SAK12*SB22+SA11*SBK12+SA12*SBK22
        RK21=SAK21*SB11+SAK22*SB21+SA21*SBK11+SA22*SBK21
        RK22=SAK21*SB12+SAK22*SB22+SA21*SBK12+SA22*SBK22
C
        RW11=SAW11*SB11+SAW12*SB21+SA11*SBW11+SA12*SBW21
        RW12=SAW11*SB12+SAW12*SB22+SA11*SBW12+SA12*SBW22
        RW21=SAW21*SB11+SAW22*SB21+SA21*SBW11+SA22*SBW21
        RW22=SAW21*SB12+SAW22*SB22+SA21*SBW12+SA22*SBW22
C
  120 CONTINUE
C
      RR11=R11
      RR12=R12
      RR21=R21
      RR22=R22
C
C *** U AND AL ***
C
      BM=VS(NL)
      CB2=CV*CV/(BM*BM)
      RRBN=DSQRT(1.D0-CB2)
      RBN=DCMPLX(0.D0,-RRBN)
      SM=DNS(NL)*BM*BM
C
      FLK= -IMAG(RK21+SM*(RBN*RK11-CB2*RR11/(RBN*WN)))
      FLW= -IMAG(RW21+SM*(RBN*RW11+CB2*RR11/(CV*RBN*WN)))
C
      RETURN
      END
