C*******************************************************************
C*******************************************************************
C
      SUBROUTINE CDCOEF
     I   ( CDTURB,
     O     CD1   , CD2   ,
     G     ZGRID ,
     D     NZ    , NZB     )
C
C*******************************************************************
      IMPLICIT REAL*8 ( A-H, O-Z )
C*******************************************************************
C
      DIMENSION
     \    CDTURB( -2:NZB ),
     \    CD1   ( -2:NZB ), 
     \    CD2   ( -2:NZB ),
     \    ZGRID ( -2:NZB )
C
C=================================================================
C
      DO 21 IZ=0,NZ-1
C
c         CDMAX= 2000.0D0
c         CDMAX= 6000.0D0
         CDMIN= 0.0D0
C
c         CD2( IZ ) = MIN ( CDMAX, MAX ( CDMIN, CDTURB(IZ) ) )
         CD2( IZ ) = MAX ( CDMIN, CDTURB(IZ) )
   21 CONTINUE
C
      CALL BOUND( CD2, NZ, NZB )
C
C---------------------------------------------------------------
C
      DO 31 IZ=0,NZ
         CD1( IZ )
     \         =  ( CD2( IZ ) + CD2( IZ-1 ) ) / 2.0D0
   31 CONTINUE
C
      CALL BOUND( CD1, NZ, NZB )
C
C---------------------------------------------------------------
C
      RETURN
      E N D
