1 SUBROUTINE pzgehdrv( N, ILO, IHI, A, IA, JA, DESCA, TAU, WORK )
9 INTEGER IA, IHI, ILO, JA, N
13 COMPLEX*16 A( * ), TAU( * ), WORK( * )
90 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
91 $ LLD_, MB_, M_, NB_, N_, RSRC_
92 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
93 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
94 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
96 parameter( zero = ( 0.0d+0, 0.0d+0 ) )
99 INTEGER I, IACOL, IAROW, ICTXT, IHLP, II, IOFF, IPT,
100 $ IPV, IPW, IV, J, JB, JJ, JL, K, MYCOL, MYROW,
104 INTEGER DESCV( DLEN_ )
107 INTEGER INDXG2P, NUMROC
108 EXTERNAL indxg2p, numroc
121 ictxt = desca( ctxt_ )
122 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
130 ioff = mod( ia+ilo-2, nb )
131 CALL infog2l( ia+ilo-1, ja+ilo-1, desca, nprow, npcol, myrow,
132 $ mycol, ii, jj, iarow, iacol )
133 ihlp = numroc( ihi-ilo+ioff+1, nb, myrow, iarow, nprow )
137 ipw = ipv + ihlp * nb
138 jl =
max( ( ( ja+ihi-2 ) / nb ) * nb + 1, ja + ilo - 1 )
139 CALL descset( descv, ihi-ilo+ioff+1, nb, nb, nb, iarow,
140 $ indxg2p( jl, desca( nb_ ), mycol, desca( csrc_ ),
141 $ npcol ), ictxt,
max( 1, ihlp ) )
143 DO 10 j = jl, ilo+ja+nb-ioff-1, -nb
144 jb =
min( ja+ihi-j-1, nb )
147 iv = k - ilo + ioff + 1
151 CALL pzlarft(
'Forward',
'Columnwise', ihi-k, jb, a, i+1, j,
152 $ desca, tau, work( ipt ), work( ipw ) )
156 CALL pzlacpy(
'All', ihi-k, jb, a, i+1, j, desca, work( ipv ),
161 CALL pzlaset(
'Lower', ihi-k-1, jb, zero, zero, a, i+2, j,
166 CALL pzlarfb(
'Left',
'No transpose',
'Forward',
'Columnwise',
167 $ ihi-k, n-k+1, jb, work( ipv ), iv+1, 1, descv,
168 $ work( ipt ), a, i+1, j, desca, work( ipw ) )
172 CALL pzlarfb(
'Right',
'Conjugate transpose',
'Forward',
173 $
'Columnwise', ihi, ihi-k, jb, work( ipv ), iv+1,
174 $ 1, descv, work( ipt ), a, ia, j+1, desca,
177 descv( csrc_ ) = mod( descv( csrc_ ) + npcol - 1, npcol )
186 jb =
min( nb-ioff, ja+ihi-j-1 )
190 CALL pzlarft(
'Forward',
'Columnwise', ihi-ilo, jb, a, i+1, j,
191 $ desca, tau, work( ipt ), work( ipw ) )
195 CALL pzlacpy(
'All', ihi-ilo, jb, a, i+1, j, desca, work( ipv ),
201 $
CALL pzlaset(
'Lower', ihi-ilo-1, jb, zero, zero, a, i+2, j,
206 CALL pzlarfb(
'Left',
'No transpose',
'Forward',
'Columnwise',
207 $ ihi-ilo, n-ilo+1, jb, work( ipv ), iv+1, 1, descv,
208 $ work( ipt ), a, i+1, j, desca, work( ipw ) )
212 CALL pzlarfb(
'Right',
'Conjugate transpose',
'Forward',
213 $
'Columnwise', ihi, ihi-ilo, jb, work( ipv ), iv+1,
214 $ 1, descv, work( ipt ), a, ia, j+1, desca,