      subroutine descinit_col( desc, n, nb, icsrc, ictxt, lld, info )
*
*     adaptation of scalapack routine descinit to block column distribution
*
*     .. Scalar Arguments ..
      INTEGER            N, NB, ICSRC, ICTXT, LLD, info
*     ..
*     .. Array Arguments ..
      INTEGER            DESC(*)
*     ..
*
*  Purpose
*  =======
*
*  DESCINIT initializes the descriptor vector with the 5 input arguments
*  N, NB, ICSRC, ICTXT, LLD.
*
*  cf. ScaLAPACK User's Guide, ch. 4.4
*
*  Arguments
*  =========
*
*  DESC    (output) INTEGER array of dimension DLEN_.
*          The array descriptor of a distributed matrix to be set.
*
*  N       (global input) INTEGER
*          The number of columns in the distributed matrix. N >= 0.
*
*  NB      (global input) INTEGER
*          The blocking factor used to distribute the columns of the
*          matrix. NB >= 1.
*
*  ICSRC   (global input) INTEGER
*          The process column over which the first column of the matrix is
*          distributed. 0 <= ICSRC < NPROW.
*
*  ICTXT   (global input) INTEGER
*          The BLACS context handle, indicating the global context of
*          the operation on the matrix. The context itself is global.
*
*  LLD     (local input)  INTEGER
*          The leading dimension of the local array storing the local
*          blocks of the distributed matrix. LLD >= MAX(1,LOCr(M)).
*
*  INFO    (output) INTEGER
*          = 0: successful exit
*          < 0: if INFO = -i, the i-th argument had an illegal value
*
*  =====================================================================
*
*     .. Parameters ..
      INTEGER            BLOCK_COL_1D, CTXT_, DLEN_, DTYPE_,
     $                   LLD_, NB_, N_, CSRC_
      PARAMETER          ( BLOCK_COL_1D = 501, DLEN_ = 7, DTYPE_ = 1,
     $                     CTXT_ = 2, N_ = 3, NB_ = 4,
     $                     CSRC_ = 5, LLD_ = 6 )
*     ..
*     .. Local Scalars ..
      INTEGER            MYROW, MYCOL, NPROW, NPCOL
*     ..
*     .. External Subroutines ..
      EXTERNAL           BLACS_GRIDINFO, PXERBLA
*     ..
*     .. External Functions ..
      INTEGER            NUMROC
      EXTERNAL           NUMROC
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          MAX, MIN
*     ..
*     .. Executable Statements ..
*
*     Get grid parameters
*
      call blacs_gridinfo(ictxt, nprow, npcol, myrow, mycol)
*
      INFO = 0
      IF( N.LT.0 ) THEN
         INFO = -2
      ELSE IF( NB.LT.1 ) THEN
         INFO = -3
      ELSE IF( ICSRC.LT.0 .OR. ICSRC.GE.NPCOL ) THEN
         INFO = -4
      ELSE IF( NPCOL.EQ.-1 ) THEN
         INFO = -5
      ELSE IF( LLD.LT. 1 ) THEN
         INFO = -6
      END IF
*
      IF( INFO.NE.0 )
     $   CALL PXERBLA( ICTXT, 'DESCINIT_COL', -INFO )
*
      DESC( DTYPE_ ) = BLOCK_COL_1D
      DESC( N_ )  = MAX( 0, N )
      DESC( NB_ ) = MAX( 1, NB )
      DESC( CSRC_ ) = MAX( 0, MIN( ICSRC, NPCOL-1 ) )
      DESC( CTXT_ ) = ICTXT
      DESC( LLD_ )  = MAX( LLD, 1 )
*
      RETURN
*
*     End DESCINIT_COL
*
      END
