1 SUBROUTINE pclahrd( N, K, NB, A, IA, JA, DESCA, TAU, T, Y, IY, JY,
10 INTEGER IA, IY, JA, JY, K, N, NB
13 INTEGER DESCA( * ), DESCY( * )
14 COMPLEX A( * ), T( * ), TAU( * ), WORK( * ), Y( * )
132 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
133 $ lld_, mb_, m_, nb_, n_, rsrc_
134 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
135 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
136 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
138 parameter( one = ( 1.0e+0, 0.0e+0 ),
139 $ zero = ( 0.0e+0, 0.0e+0 ) )
143 INTEGER I, IACOL, IAROW, ICTXT, IOFF, II, J, JJ, JL,
144 $ jt, jw, l, myrow, mycol, npcol, nprow, nq
148 INTEGER DESCW( DLEN_ )
155 EXTERNAL blacs_gridinfo, caxpy, ccopy, cscal,
169 ictxt = desca( ctxt_ )
170 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
172 ioff = mod( ja-1, desca( nb_ ) )
173 CALL infog2l( ia+k, ja, desca, nprow, npcol, myrow, mycol, ii,
176 iproc = ( myrow.EQ.iarow .AND. mycol.EQ.iacol )
177 nq = numroc( n+ja-1, desca( nb_ ), mycol, iacol, npcol )
184 CALL descset( descw, 1, desca( mb_ ), 1, desca( mb_ ), iarow,
197 CALL pclacgv( l-1, a, i, ja, desca, desca( m_ ) )
198 CALL pcgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
199 $ a, i, ja, desca, desca( m_ ), one, a, ia, j,
201 CALL pclacgv( l-1, a, i, ja, desca, desca( m_ ) )
214 CALL ccopy( l-1, a( (jj+l-2)*desca( lld_ )+ii ), 1,
216 CALL ctrmv(
'Lower',
'Conjugate transpose',
'Unit', l-1,
217 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
223 CALL pcgemv(
'Conjugate transpose', n-k-l+1, l-1, one, a,
224 $ i+1, ja, desca, a, i+1, j, desca, 1, one, work,
225 $ 1, jw, descw, descw( m_ ) )
230 $
CALL ctrmv(
'Upper',
'Conjugate transpose',
'Non-unit',
231 $ l-1, t, desca( nb_ ), work( jw ), 1 )
235 CALL pcgemv(
'No transpose', n-k-l+1, l-1, -one, a, i+1, ja,
236 $ desca, work, 1, jw, descw, descw( m_ ), one,
237 $ a, i+1, j, desca, 1 )
242 CALL ctrmv(
'Lower',
'No transpose',
'Unit', l-1,
243 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
245 CALL caxpy( l-1, -one, work( jw ), 1,
246 $ a( ( jj+l-2 )*desca( lld_ )+ii ), 1 )
248 CALL pcelset( a, i, j-1, desca, ei )
254 CALL pclarfg( n-k-l+1, ei, i+1, j, a,
min( i+2, n+ia-1 ), j,
256 CALL pcelset( a, i+1, j, desca, one )
260 CALL pcgemv(
'No transpose', n, n-k-l+1, one, a, ia, j+1,
261 $ desca, a, i+1, j, desca, 1, zero, y, iy, jy+l-1,
263 CALL pcgemv(
'Conjugate transpose', n-k-l+1, l-1, one, a, i+1,
264 $ ja, desca, a, i+1, j, desca, 1, zero, work, 1, jw,
265 $ descw, descw( m_ ) )
266 CALL pcgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
267 $ work, 1, jw, descw, descw( m_ ), one, y, iy,
269 jl =
min( jj+l-1, ja+nq-1 )
270 CALL pcscal( n, tau( jl ), y, iy, jy+l-1, descy, 1 )
275 jt = ( l-1 ) * desca( nb_ )
276 CALL cscal( l-1, -tau( jl ), work( jw ), 1 )
277 CALL ccopy( l-1, work( jw ), 1, t( jt+1 ), 1 )
278 CALL ctrmv(
'Upper',
'No transpose',
'Non-unit', l-1, t,
279 $ desca( nb_ ), t( jt+1 ), 1 )
280 t( jt+l ) = tau( jl )
284 CALL pcelset( a, k+nb+ia-1, j, desca, ei )