1 SUBROUTINE pctzrzf( M, N, A, IA, JA, DESCA, TAU, WORK, LWORK,
10 INTEGER IA, INFO, JA, LWORK, M, N
14 COMPLEX A( * ), TAU( * ), WORK( * )
185 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
186 $ lld_, mb_, m_, nb_, n_, rsrc_
187 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
188 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
189 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
191 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
195 CHARACTER COLBTOP, ROWBTOP
196 INTEGER I, IACOL, IAROW, IB, ICTXT, IIA, IL, IN, IPW,
197 $ iroffa, j, jm1, l, lwmin, mp0, mycol, myrow,
201 INTEGER IDUM1( 1 ), IDUM2( 1 )
209 INTEGER ICEIL, INDXG2P, NUMROC
210 EXTERNAL iceil, indxg2p, numroc
219 ictxt = desca( ctxt_ )
220 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
225 IF( nprow.EQ.-1 )
THEN
228 CALL chk1mat( m, 1, n, 2, ia, ja, desca, 6, info )
230 iroffa = mod( ia-1, desca( mb_ ) )
231 iarow = indxg2p( ia, desca( mb_ ), myrow, desca( rsrc_ ),
233 iacol = indxg2p( ja, desca( nb_ ), mycol, desca( csrc_ ),
235 mp0 = numroc( m+iroffa, desca( mb_ ), myrow, iarow, nprow )
236 nq0 = numroc( n+mod( ja-1, desca( nb_ ) ), desca( nb_ ),
237 $ mycol, iacol, npcol )
238 lwmin = desca( mb_ ) * ( mp0 + nq0 + desca( mb_ ) )
240 work( 1 ) =
cmplx( real( lwmin ) )
241 lquery = ( lwork.EQ.-1 )
244 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
254 CALL pchk1mat( m, 1, n, 2, ia, ja, desca, 6, 1, idum1, idum2,
259 CALL pxerbla( ictxt,
'PCTZRZF', -info )
261 ELSE IF( lquery )
THEN
267 IF( m.EQ.0 .OR. n.EQ.0 )
272 CALL infog1l( ia, desca( mb_ ), nprow, myrow, desca( rsrc_ ),
276 DO 10 i = iia, iia+mp0-1
283 jm1 = ja +
min( m+1, n ) - 1
284 ipw = desca( mb_ ) * desca( mb_ ) + 1
285 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+m-1 )
286 il =
max( ( (ia+m-2) / desca( mb_ ) ) * desca( mb_ ) + 1, ia )
287 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
288 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
289 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
290 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'D-ring' )
294 DO 20 i = il, in+1, -desca( mb_ )
295 ib =
min( ia+m-i, desca( mb_ ) )
301 CALL pclatrz( ib, ja+n-j, l, a, i, j, desca, tau, work )
308 CALL pclarzt(
'Backward',
'Rowwise', l, ib, a, i, jm1,
309 $ desca, tau, work, work( ipw ) )
313 CALL pclarzb(
'Right',
'No transpose',
'Backward',
314 $
'Rowwise', i-ia, ja+n-j, ib, l, a, i, jm1,
315 $ desca, work, a, ia, j, desca, work( ipw ) )
322 CALL pclatrz( in-ia+1, n, n-m, a, ia, ja, desca, tau, work )
324 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
325 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )
329 work( 1 ) =
cmplx( real( lwmin ) )