1 SUBROUTINE psqrt13( SCALE, M, N, A, IA, JA, DESCA, NORMA, ISEED,
10 INTEGER IA, ISEED, JA, M, N, SCALE
130 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
131 $ lld_, mb_, m_, nb_, n_, rsrc_
132 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
133 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
134 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
136 parameter( one = 1.0e0 )
139 INTEGER I, IACOL, IAROW, ICOFFA, ICTXT, IIA, INFO,
140 $ iroffa, j, jja, mp, mycol, myrow, npcol,
142 REAL AJJ, ASUM, BIGNUM, SMLNUM
146 REAL PSLAMCH, PSLANGE
147 EXTERNAL numroc, pslamch, pslange
158 ictxt = desca( ctxt_ )
159 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
161 IF( m.LE.0 .OR. n.LE.0 )
166 iroffa = mod( ia-1, desca( mb_ ) )
167 icoffa = mod( ja-1, desca( nb_ ) )
168 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia,
169 $ jja, iarow, iacol )
170 mp = numroc( m+iroffa, desca( mb_ ), myrow, iarow, nprow )
171 nq = numroc( n+icoffa, desca( nb_ ), mycol, iacol, npcol )
177 CALL psmatgen( ictxt,
'N',
'N', desca( m_ ), desca( n_ ),
178 $ desca( mb_ ), desca( nb_ ), a, desca( lld_ ),
179 $ desca( rsrc_ ), desca( csrc_ ), iseed, iia-1, mp,
180 $ jja-1, nq, myrow, mycol, nprow, npcol )
184 IF( i.LE.ia+m-1 )
THEN
185 CALL psasum( m, asum, a, ia, j, desca, 1 )
186 CALL pselget(
'Column',
' ', ajj, a, i, j, desca )
187 ajj = ajj + sign( asum, ajj )
188 CALL pselset( a, i, j, desca, ajj )
194 IF( scale.NE.1 )
THEN
196 norma = pslange(
'M', m, n, a, ia, ja, desca, work )
197 smlnum = pslamch( ictxt,
'Safe minimum' )
198 bignum = one / smlnum
199 CALL pslabad( ictxt, smlnum, bignum )
200 smlnum = smlnum / pslamch( ictxt,
'Epsilon' )
201 bignum = one / smlnum
203 IF( scale.EQ.2 )
THEN
207 CALL pslascl(
'General', norma, bignum, m, n, a, ia,
210 ELSE IF( scale.EQ.3 )
THEN
214 CALL pslascl(
'General', norma, smlnum, m, n, a, ia,
221 norma = pslange(
'One-norm', m, n, a, ia, ja, desca, work )