1 SUBROUTINE descinit( DESC, M, N, MB, NB, IRSRC, ICSRC, ICTXT,
10 INTEGER ICSRC, ICTXT, INFO, IRSRC, LLD, M, MB, N, NB
128 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
129 $ lld_, mb_, m_, nb_, n_, rsrc_
130 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
131 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
132 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
135 INTEGER MYCOL, MYROW, NPCOL, NPROW
138 EXTERNAL blacs_gridinfo,
pxerbla
151 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
156 ELSE IF( n.LT.0 )
THEN
158 ELSE IF( mb.LT.1 )
THEN
160 ELSE IF( nb.LT.1 )
THEN
162 ELSE IF( irsrc.LT.0 .OR. irsrc.GE.nprow )
THEN
164 ELSE IF( icsrc.LT.0 .OR. icsrc.GE.npcol )
THEN
166 ELSE IF( nprow.EQ.-1 )
THEN
168 ELSE IF( lld.LT.
max( 1, numroc( m, mb, myrow, irsrc,
174 $
CALL pxerbla( ictxt,
'DESCINIT', -info )
176 desc( dtype_ ) = block_cyclic_2d
177 desc( m_ ) =
max( 0, m )
178 desc( n_ ) =
max( 0, n )
179 desc( mb_ ) =
max( 1, mb )
180 desc( nb_ ) =
max( 1, nb )
181 desc( rsrc_ ) =
max( 0,
min( irsrc, nprow-1 ) )
182 desc( csrc_ ) =
max( 0,
min( icsrc, npcol-1 ) )
183 desc( ctxt_ ) = ictxt
184 desc( lld_ ) =
max( lld,
max( 1, numroc( desc( m_ ), desc( mb_ ),
185 $ myrow, desc( rsrc_ ), nprow ) ) )