1 SUBROUTINE pclassq( N, X, IX, JX, DESCX, INCX, SCALE, SUMSQ )
9 INTEGER IX, INCX, JX, N
142 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
143 $ LLD_, MB_, M_, NB_, N_, RSRC_
144 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
145 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
146 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
148 parameter( zero = 0.0e+0 )
151 INTEGER I, ICOFF, ICTXT, IIX, IOFF, IROFF, IXCOL,
152 $ IXROW, JJX, LDX, MYCOL, MYROW, NP, NPCOL,
167 INTRINSIC abs, aimag, mod, real
173 ictxt = descx( ctxt_ )
174 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
178 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
182 IF( incx.EQ.descx( m_ ) )
THEN
188 icoff = mod( jx, descx( nb_ ) )
189 nq = numroc( n+icoff, descx( nb_ ), mycol, ixcol, npcol )
196 ioff = iix + ( jjx - 1 ) * ldx
198 IF( real( x( ioff ) ).NE.zero )
THEN
199 temp1 = abs( real( x( ioff ) ) )
200 IF( scale.LT.temp1 )
THEN
201 sumsq = 1 + sumsq * ( scale / temp1 )**2
204 sumsq = sumsq + ( temp1 / scale )**2
207 IF( aimag( x( ioff ) ).NE.zero )
THEN
208 temp1 = abs( aimag( x( ioff ) ) )
209 IF( scale.LT.temp1 )
THEN
210 sumsq = 1 + sumsq*( scale / temp1 )**2
213 sumsq = sumsq + ( temp1 / scale )**2
225 CALL pstreecomb( ictxt,
'Rowwise', 2, work, -1, ixcol,
231 ELSE IF( incx.EQ.1 )
THEN
237 iroff = mod( ix, descx( mb_ ) )
238 np = numroc( n+iroff, descx( mb_ ), myrow, ixrow, nprow )
245 ioff = iix + ( jjx - 1 ) * ldx
247 IF( real( x( ioff ) ).NE.zero )
THEN
248 temp1 = abs( real( x( ioff ) ) )
249 IF( scale.LT.temp1 )
THEN
250 sumsq = 1 + sumsq*( scale / temp1 )**2
253 sumsq = sumsq + ( temp1 / scale )**2
256 IF( aimag( x( ioff ) ).NE.zero )
THEN
257 temp1 = abs( aimag( x( ioff ) ) )
258 IF( scale.LT.temp1 )
THEN
259 sumsq = 1 + sumsq*( scale / temp1 )**2
262 sumsq = sumsq + ( temp1 / scale )**2
274 CALL pstreecomb( ictxt,
'Columnwise', 2, work, -1, ixcol,