1 SUBROUTINE pdlahrd( 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 DOUBLE PRECISION 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 )
137 DOUBLE PRECISION ONE, ZERO
138 parameter( one = 1.0d+0, zero = 0.0d+0 )
142 INTEGER I, IACOL, IAROW, ICTXT, IOFF, II, J, JJ, JL,
143 $ jt, jw, l, myrow, mycol, npcol, nprow, nq
147 INTEGER DESCW( DLEN_ )
154 EXTERNAL blacs_gridinfo, daxpy,
descset, dcopy,
168 ictxt = desca( ctxt_ )
169 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
171 ioff = mod( ja-1, desca( nb_ ) )
172 CALL infog2l( ia+k, ja, desca, nprow, npcol, myrow, mycol, ii,
175 iproc = ( myrow.EQ.iarow .AND. mycol.EQ.iacol )
176 nq = numroc( n+ja-1, desca( nb_ ), mycol, iacol, npcol )
183 CALL descset( descw, 1, desca( mb_ ), 1, desca( mb_ ), iarow,
196 CALL pdgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
197 $ a, i, ja, desca, desca( m_ ), one, a, ia, j,
211 CALL dcopy( l-1, a( (jj+l-2)*desca( lld_ )+ii ), 1,
213 CALL dtrmv(
'Lower',
'Transpose',
'Unit', l-1,
214 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
220 CALL pdgemv(
'Transpose', n-k-l+1, l-1, one, a, i+1, ja,
221 $ desca, a, i+1, j, desca, 1, one, work, 1, jw,
222 $ descw, descw( m_ ) )
227 $
CALL dtrmv(
'Upper',
'Transpose',
'Non-unit', l-1, t,
228 $ desca( nb_ ), work( jw ), 1 )
232 CALL pdgemv(
'No transpose', n-k-l+1, l-1, -one, a, i+1, ja,
233 $ desca, work, 1, jw, descw, descw( m_ ), one,
234 $ a, i+1, j, desca, 1 )
239 CALL dtrmv(
'Lower',
'No transpose',
'Unit', l-1,
240 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
242 CALL daxpy( l-1, -one, work( jw ), 1,
243 $ a( ( jj+l-2 )*desca( lld_ )+ii ), 1 )
245 CALL pdelset( a, i, j-1, desca, ei )
251 CALL pdlarfg( n-k-l+1, ei, i+1, j, a,
min( i+2, n+ia-1 ), j,
253 CALL pdelset( a, i+1, j, desca, one )
257 CALL pdgemv(
'No transpose', n, n-k-l+1, one, a, ia, j+1,
258 $ desca, a, i+1, j, desca, 1, zero, y, iy, jy+l-1,
260 CALL pdgemv(
'Transpose', n-k-l+1, l-1, one, a, i+1, ja, desca,
261 $ a, i+1, j, desca, 1, zero, work, 1, jw, descw,
263 CALL pdgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
264 $ work, 1, jw, descw, descw( m_ ), one, y, iy,
266 jl =
min( jj+l-1, ja+nq-1 )
267 CALL pdscal( n, tau( jl ), y, iy, jy+l-1, descy, 1 )
272 jt = ( l-1 ) * desca( nb_ )
273 CALL dscal( l-1, -tau( jl ), work( jw ), 1 )
274 CALL dcopy( l-1, work( jw ), 1, t( jt+1 ), 1 )
275 CALL dtrmv(
'Upper',
'No transpose',
'Non-unit', l-1, t,
276 $ desca( nb_ ), t( jt+1 ), 1 )
277 t( jt+l ) = tau( jl )
281 CALL pdelset( a, k+nb+ia-1, j, desca, ei )