C
C *** CALCULATION OF CQ,STQ, AND SDQ ***
C
      SUBROUTINE CSTD(WN,BM,CV,CB2,THK,CQ,STQ,SDQ)
C
      IMPLICIT REAL*8(A-H,O-Z)
C
      IF(BM-CV)10,20,30
C
   10   RBM=DSQRT(CB2-1.0D0)
        QM=WN*RBM*THK
        CQ=DCOS(QM)
        SQ=DSIN(QM)
        STQ=RBM*SQ
        SDQ=SQ/RBM
        GOTO 40
C
   20   CQ=1.0D0
        STQ=0.0D0
        SDQ=WN*THK
        GOTO 40
C
   30   RBM=DSQRT(1.0D0-CB2)
        QM=WN*RBM*THK
        EX1=DEXP(QM)
        EX2=DEXP(-QM)
        CQ=(EX1+EX2)/2.0D0
        EX12=(EX1-EX2)/2.0D0
        STQ=-RBM*EX12
        SDQ=EX12/RBM
C
   40 RETURN
      END
