1 SUBROUTINE pslascal( TYPE, M, N, ALPHA, A, IA, JA, DESCA )
136 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
137 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
139 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
140 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
141 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
142 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
146 LOGICAL GODOWN, GOLEFT, LOWER, UPPER
147 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
148 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, ITYPE,
149 $ IUPP, JJA, JJMAX, JOFFA, JOFFD, LCMT, LCMT00,
150 $ LDA, LMBLOC, LNBLOC, LOW, M1, MB, MBLKD, MBLKS,
151 $ MBLOC, MP, MRCOL, MRROW, MYCOL, MYROW, N1, NB,
152 $ NBLKD, NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB,
156 INTEGER DESCA2( DLEN_ )
165 EXTERNAL lsame, pb_numroc
178 ictxt = desca2( ctxt_ )
179 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
183 IF( m.EQ.0 .OR. n.EQ.0 )
186 IF( lsame(
TYPE,
'L' ) ) then
192 ELSE IF( lsame(
TYPE,
'U' ) ) then
198 ELSE IF( lsame(
TYPE,
'H' ) ) then
214 IF( itype.EQ.0 )
THEN
218 CALL pb_infog2l( ia, ja, desca2, nprow, npcol, myrow, mycol,
219 $ iia, jja, iarow, iacol )
220 mp = pb_numroc( m, ia, desca2( imb_ ), desca2( mb_ ), myrow,
221 $ desca2( rsrc_ ), nprow )
222 nq = pb_numroc( n, ja, desca2( inb_ ), desca2( nb_ ), mycol,
223 $ desca2( csrc_ ), npcol )
225 IF( mp.LE.0 .OR. nq.LE.0 )
229 ioffa = iia + ( jja - 1 ) * lda
231 CALL pb_slascal(
'All', mp, nq, 0, alpha, a( ioffa ), lda )
237 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
238 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
239 $ iacol, mrrow, mrcol )
241 IF( mp.LE.0 .OR. nq.LE.0 )
251 CALL pb_binfo( ioffd, mp, nq, imb1, inb1, mb, nb, mrrow,
252 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
253 $ lmbloc, lnbloc, ilow, low, iupp, upp )
262 IF( desca2( rsrc_ ).LT.0 )
THEN
267 IF( desca2( csrc_ ).LT.0 )
THEN
276 godown = ( lcmt00.GT.iupp )
277 goleft = ( lcmt00.LT.ilow )
279 IF( .NOT.godown .AND. .NOT.goleft )
THEN
283 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
286 CALL pb_slascal( uplo, imbloc, inbloc, lcmt00, alpha,
287 $ a( iia+joffa*lda ), lda )
289 IF( upper .AND. nq.GT.inbloc )
290 $
CALL pb_slascal(
'All', imbloc, nq-inbloc, 0, alpha,
291 $ a( iia+(joffa+inbloc)*lda ), lda )
295 IF( lower .AND. mp.GT.imbloc )
296 $
CALL pb_slascal(
'All', mp-imbloc, inbloc, 0, alpha,
297 $ a( iia+imbloc+joffa*lda ), lda )
306 lcmt00 = lcmt00 - ( iupp - upp + pmb )
308 ioffa = ioffa + imbloc
311 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
312 lcmt00 = lcmt00 - pmb
318 tmp1 =
min( ioffa, iimax ) - iia + 1
319 IF( upper .AND. tmp1.GT.0 )
THEN
321 $ a( iia+joffa*lda ), lda )
335 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
338 CALL pb_slascal( uplo, mbloc, inbloc, lcmt, alpha,
339 $ a( ioffd+1+joffa*lda ), lda )
345 ioffd = ioffd + mbloc
349 tmp1 = m1 - ioffd + iia - 1
350 IF( lower .AND. tmp1.GT.0 )
351 $
CALL pb_slascal(
'All', tmp1, inbloc, 0, alpha,
352 $ a( ioffd+1+joffa*lda ), lda )
354 tmp1 = ioffa - iia + 1
357 lcmt00 = lcmt00 + low - ilow + qnb
359 joffa = joffa + inbloc
361 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
363 $ a( iia+joffa*lda ), lda )
368 ELSE IF( goleft )
THEN
370 lcmt00 = lcmt00 + low - ilow + qnb
372 joffa = joffa + inbloc
375 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
376 lcmt00 = lcmt00 + qnb
382 tmp1 =
min( joffa, jjmax ) - jja + 1
383 IF( lower .AND. tmp1.GT.0 )
THEN
385 $ a( iia+(jja-1)*lda ), lda )
399 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
402 CALL pb_slascal( uplo, imbloc, nbloc, lcmt, alpha,
403 $ a( iia+joffd*lda ), lda )
409 joffd = joffd + nbloc
413 tmp1 = n1 - joffd + jja - 1
414 IF( upper .AND. tmp1.GT.0 )
415 $
CALL pb_slascal(
'All', imbloc, tmp1, 0, alpha,
416 $ a( iia+joffd*lda ), lda )
418 tmp1 = joffa - jja + 1
421 lcmt00 = lcmt00 - ( iupp - upp + pmb )
423 ioffa = ioffa + imbloc
425 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
427 $ a( ioffa+1+(jja-1)*lda ), lda )
436 IF( nblks.GT.0 )
THEN
440 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
441 lcmt00 = lcmt00 - pmb
447 tmp1 =
min( ioffa, iimax ) - iia + 1
448 IF( upper .AND. tmp1.GT.0 )
THEN
450 $ a( iia+joffa*lda ), lda )
464 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
467 CALL pb_slascal( uplo, mbloc, nbloc, lcmt, alpha,
468 $ a( ioffd+1+joffa*lda ), lda )
474 ioffd = ioffd + mbloc
478 tmp1 = m1 - ioffd + iia - 1
479 IF( lower .AND. tmp1.GT.0 )
480 $
CALL pb_slascal(
'All', tmp1, nbloc, 0, alpha,
481 $ a( ioffd+1+joffa*lda ), lda )
483 tmp1 =
min( ioffa, iimax ) - iia + 1
486 lcmt00 = lcmt00 + qnb
488 joffa = joffa + nbloc
490 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
492 $ a( iia+joffa*lda ), lda )
508 SUBROUTINE pslagen( INPLACE, AFORM, DIAG, OFFA, M, N, IA, JA,
509 $ DESCA, IASEED, A, LDA )
518 CHARACTER*1 aform, diag
519 INTEGER ia, iaseed, ja, lda, m, n, offa
701 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
702 $ dtype_, imb_, inb_, lld_, mb_, m_, nb_, n_,
704 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
705 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
706 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
707 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
708 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
709 $ jmp_mb, jmp_nb, jmp_npimbloc, jmp_npmb,
710 $ jmp_nqinbloc, jmp_nqnb, jmp_row
711 parameter( jmp_1 = 1, jmp_row = 2, jmp_col = 3,
712 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
713 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
714 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
718 LOGICAL DIAGDO, SYMM, HERM, NOTRAN
719 INTEGER CSRC, I, IACOL, IAROW, ICTXT, IIA, ILOCBLK,
720 $ ilocoff, ilow, imb, imb1, imbloc, imbvir, inb,
721 $ inb1, inbloc, inbvir, info, ioffda, itmp, iupp,
722 $ ivir, jja, jlocblk, jlocoff, jvir, lcmt00,
723 $ lmbloc, lnbloc, low, maxmn, mb, mblks, mp,
724 $ mrcol, mrrow, mycdist, mycol, myrdist, myrow,
725 $ nb, nblks, npcol, nprow, nq, nvir, rsrc, upp
729 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
730 $ iran( 2 ), jmp( jmp_len ), muladd0( 4 )
747 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
758 ictxt = desca2( ctxt_ )
759 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
764 IF( nprow.EQ.-1 )
THEN
765 info = -( 1000 + ctxt_ )
767 symm = lsame( aform,
'S' )
768 herm = lsame( aform,
'H' )
769 notran = lsame( aform,
'N' )
770 diagdo = lsame( diag,
'D' )
771 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
772 $ .NOT.( lsame( aform,
'T' ) ) .AND.
773 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
775 ELSE IF( ( .NOT.diagdo ) .AND.
776 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
779 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
783 CALL pxerbla( ictxt,
'PSLAGEN', -info )
789 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
798 rsrc = desca2( rsrc_ )
799 csrc = desca2( csrc_ )
803 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
804 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
805 $ iacol, mrrow, mrcol )
817 ioffda = ja + offa - ia
818 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
819 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
820 $ lmbloc, lnbloc, ilow, low, iupp, upp )
828 itmp =
max( 0, -offa )
831 nvir = desca2( m_ ) + itmp
833 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
836 itmp =
max( 0, offa )
839 nvir =
max(
max( nvir, desca2( n_ ) + itmp ),
840 $ desca2( m_ ) + desca2( n_ ) - 1 )
842 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
845 IF( symm .OR. herm .OR. notran )
THEN
847 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
848 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
856 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
857 $ myrdist, mycdist, nprow, npcol, jmp,
860 CALL pb_slagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
861 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
862 $ nb, lnbloc, jmp, imuladd )
866 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
868 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
869 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
877 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
878 $ myrdist, mycdist, nprow, npcol, jmp,
881 CALL pb_slagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
882 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
883 $ nb, lnbloc, jmp, imuladd )
889 maxmn =
max( desca2( m_ ), desca2( n_ ) )
890 alpha = real( maxmn )
892 IF( ioffda.GE.0 )
THEN
894 $ a,
min( ia+ioffda, ia+m-1 ), ja, desca )
897 $ a, ia,
min( ja-ioffda, ja+n-1 ), desca )
907 SUBROUTINE psladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
1035 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1036 $ dtype_, imb_, inb_, lld_, mb_, m_, nb_, n_,
1038 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1039 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1040 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1041 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1044 LOGICAL GODOWN, GOLEFT
1045 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
1046 $ imb1, imbloc, inb1, inbloc, ioffa, ioffd, iupp,
1047 $ jja, joffa, joffd, lcmt, lcmt00, lda, ldap1,
1048 $ lmbloc, lnbloc, low, mb, mblkd, mblks, mbloc,
1049 $ mrcol, mrrow, mycol, myrow, nb, nblkd, nblks,
1050 $ nbloc, np, npcol, nprow, nq, pmb, qnb, upp
1054 INTEGER DESCA2( DLEN_ )
1071 ictxt = desca2( ctxt_ )
1072 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1077 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
1078 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
1079 $ iacol, mrrow, mrcol )
1094 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
1095 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
1096 $ lnbloc, ilow, low, iupp, upp )
1100 lda = desca2( lld_ )
1103 IF( desca2( rsrc_ ).LT.0 )
THEN
1108 IF( desca2( csrc_ ).LT.0 )
THEN
1117 godown = ( lcmt00.GT.iupp )
1118 goleft = ( lcmt00.LT.ilow )
1120 IF( .NOT.godown .AND. .NOT.goleft )
THEN
1124 IF( lcmt00.GE.0 )
THEN
1125 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
1126 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
1127 atmp = a( ijoffa + i*ldap1 )
1128 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1131 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
1132 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
1133 atmp = a( ijoffa + i*ldap1 )
1134 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1137 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
1138 godown = .NOT.goleft
1144 lcmt00 = lcmt00 - ( iupp - upp + pmb )
1146 ioffa = ioffa + imbloc
1149 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
1150 lcmt00 = lcmt00 - pmb
1162 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
1165 IF( lcmt.GE.0 )
THEN
1166 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
1167 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
1168 atmp = a( ijoffa + i*ldap1 )
1169 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1172 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
1173 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
1174 atmp = a( ijoffa + i*ldap1 )
1175 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1183 ioffd = ioffd + mbloc
1187 lcmt00 = lcmt00 + low - ilow + qnb
1189 joffa = joffa + inbloc
1191 ELSE IF( goleft )
THEN
1193 lcmt00 = lcmt00 + low - ilow + qnb
1195 joffa = joffa + inbloc
1198 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
1199 lcmt00 = lcmt00 + qnb
1211 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
1214 IF( lcmt.GE.0 )
THEN
1215 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
1216 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
1217 atmp = a( ijoffa + i*ldap1 )
1218 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1221 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
1222 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
1223 atmp = a( ijoffa + i*ldap1 )
1224 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1232 joffd = joffd + nbloc
1236 lcmt00 = lcmt00 - ( iupp - upp + pmb )
1238 ioffa = ioffa + imbloc
1244 IF( nblks.GT.0 )
THEN
1248 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
1249 lcmt00 = lcmt00 - pmb
1261 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
1264 IF( lcmt.GE.0 )
THEN
1265 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
1266 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
1267 atmp = a( ijoffa + i*ldap1 )
1268 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1271 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
1272 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
1273 atmp = a( ijoffa + i*ldap1 )
1274 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1282 ioffd = ioffd + mbloc
1286 lcmt00 = lcmt00 + qnb
1288 joffa = joffa + nbloc
1298 SUBROUTINE pb_slascal( UPLO, M, N, IOFFD, ALPHA, A, LDA )
1307 INTEGER IOFFD, LDA, M, N
1401 INTEGER I, J, JTMP, MN
1414 IF( m.LE.0 .OR. n.LE.0 )
1419 IF( lsame( uplo,
'L' ) )
THEN
1423 mn =
max( 0, -ioffd )
1424 DO 20 j = 1,
min( mn, n )
1426 a( i, j ) = alpha * a( i, j )
1429 DO 40 j = mn + 1,
min( m - ioffd, n )
1430 DO 30 i = j + ioffd, m
1431 a( i, j ) = alpha * a( i, j )
1435 ELSE IF( lsame( uplo,
'U' ) )
THEN
1439 mn =
min( m - ioffd, n )
1440 DO 60 j =
max( 0, -ioffd ) + 1, mn
1441 DO 50 i = 1, j + ioffd
1442 a( i, j ) = alpha * a( i, j )
1445 DO 80 j =
max( 0, mn ) + 1, n
1447 a( i, j ) = alpha * a( i, j )
1451 ELSE IF( lsame( uplo,
'D' ) )
THEN
1455 DO 90 j =
max( 0, -ioffd ) + 1,
min( m - ioffd, n )
1457 a( jtmp, j ) = alpha * a( jtmp, j )
1466 a( i, j ) = alpha * a( i, j )
1477 SUBROUTINE pb_slagen( UPLO, AFORM, A, LDA, LCMT00, IRAN, MBLKS,
1478 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
1479 $ LNBLOC, JMP, IMULADD )
1487 CHARACTER*1 UPLO, AFORM
1488 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
1489 $ MB, MBLKS, NB, NBLKS
1492 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
1596 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
1597 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
1598 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
1599 parameter( jmp_1 = 1, jmp_row = 2, jmp_col = 3,
1600 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
1601 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
1602 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
1606 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
1607 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
1611 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
1619 EXTERNAL LSAME, PB_SRAND
1627 ib1( i ) = iran( i )
1628 ib2( i ) = iran( i )
1629 ib3( i ) = iran( i )
1632 IF( lsame( aform,
'N' ) )
THEN
1638 DO 50 jblk = 1, nblks
1640 IF( jblk.EQ.1 )
THEN
1642 ELSE IF( jblk.EQ.nblks )
THEN
1648 DO 40 jk = jj, jj + jb - 1
1652 DO 30 iblk = 1, mblks
1654 IF( iblk.EQ.1 )
THEN
1656 ELSE IF( iblk.EQ.mblks )
THEN
1664 DO 20 ik = ii, ii + ib - 1
1665 a( ik, jk ) = pb_srand( 0 )
1670 IF( iblk.EQ.1 )
THEN
1674 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
1681 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
1692 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
1703 IF( jblk.EQ.1 )
THEN
1707 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
1713 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
1726 ELSE IF( lsame( aform,
'T' ) .OR. lsame( aform,
'C' ) )
THEN
1733 DO 90 iblk = 1, mblks
1735 IF( iblk.EQ.1 )
THEN
1737 ELSE IF( iblk.EQ.mblks )
THEN
1743 DO 80 ik = ii, ii + ib - 1
1747 DO 70 jblk = 1, nblks
1749 IF( jblk.EQ.1 )
THEN
1751 ELSE IF( jblk.EQ.nblks )
THEN
1759 DO 60 jk = jj, jj + jb - 1
1760 a( ik, jk ) = pb_srand( 0 )
1765 IF( jblk.EQ.1 )
THEN
1769 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
1776 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
1787 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
1798 IF( iblk.EQ.1 )
THEN
1802 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
1808 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
1821 ELSE IF( ( lsame( aform,
'S' ) ).OR.( lsame( aform,
'H' ) ) )
THEN
1825 IF( lsame( uplo,
'L' ) )
THEN
1832 DO 170 jblk = 1, nblks
1834 IF( jblk.EQ.1 )
THEN
1837 ELSE IF( jblk.EQ.nblks )
THEN
1845 DO 160 jk = jj, jj + jb - 1
1850 DO 150 iblk = 1, mblks
1852 IF( iblk.EQ.1 )
THEN
1855 ELSE IF( iblk.EQ.mblks )
THEN
1865 IF( lcmtr.GT.upp )
THEN
1867 DO 100 ik = ii, ii + ib - 1
1868 dummy = pb_srand( 0 )
1871 ELSE IF( lcmtr.GE.low )
THEN
1874 mnb =
max( 0, -lcmtr )
1876 IF( jtmp.LE.
min( mnb, jb ) )
THEN
1878 DO 110 ik = ii, ii + ib - 1
1879 a( ik, jk ) = pb_srand( 0 )
1882 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
1883 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
1885 itmp = ii + jtmp + lcmtr - 1
1887 DO 120 ik = ii, itmp - 1
1888 dummy = pb_srand( 0 )
1891 DO 130 ik = itmp, ii + ib - 1
1892 a( ik, jk ) = pb_srand( 0 )
1899 DO 140 ik = ii, ii + ib - 1
1900 a( ik, jk ) = pb_srand( 0 )
1907 IF( iblk.EQ.1 )
THEN
1911 lcmtr = lcmtr - jmp( jmp_npimbloc )
1912 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
1919 lcmtr = lcmtr - jmp( jmp_npmb )
1920 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
1932 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
1943 IF( jblk.EQ.1 )
THEN
1947 lcmtc = lcmtc + jmp( jmp_nqinbloc )
1948 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
1954 lcmtc = lcmtc + jmp( jmp_nqnb )
1955 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
1975 DO 250 iblk = 1, mblks
1977 IF( iblk.EQ.1 )
THEN
1980 ELSE IF( iblk.EQ.mblks )
THEN
1988 DO 240 ik = ii, ii + ib - 1
1993 DO 230 jblk = 1, nblks
1995 IF( jblk.EQ.1 )
THEN
1998 ELSE IF( jblk.EQ.nblks )
THEN
2008 IF( lcmtc.LT.low )
THEN
2010 DO 180 jk = jj, jj + jb - 1
2011 dummy = pb_srand( 0 )
2014 ELSE IF( lcmtc.LE.upp )
THEN
2017 mnb =
max( 0, lcmtc )
2019 IF( itmp.LE.
min( mnb, ib ) )
THEN
2021 DO 190 jk = jj, jj + jb - 1
2022 a( ik, jk ) = pb_srand( 0 )
2025 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
2026 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
2028 jtmp = jj + itmp - lcmtc - 1
2030 DO 200 jk = jj, jtmp - 1
2031 dummy = pb_srand( 0 )
2034 DO 210 jk = jtmp, jj + jb - 1
2035 a( ik, jk ) = pb_srand( 0 )
2042 DO 220 jk = jj, jj + jb - 1
2043 a( ik, jk ) = pb_srand( 0 )
2050 IF( jblk.EQ.1 )
THEN
2054 lcmtc = lcmtc + jmp( jmp_nqinbloc )
2055 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
2062 lcmtc = lcmtc + jmp( jmp_nqnb )
2063 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
2075 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
2086 IF( iblk.EQ.1 )
THEN
2090 lcmtr = lcmtr - jmp( jmp_npimbloc )
2091 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
2097 lcmtr = lcmtr - jmp( jmp_npmb )
2098 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
2120 REAL FUNCTION PB_SRAND( IDUMM )
2167 PARAMETER ( one = 1.0e+0, two = 2.0e+0 )
2175 pb_srand = one - two *
pb_sran( idumm )
2182 REAL function
pb_sran( idumm )
2228 PARAMETER ( divfac = 2.147483648e+9,
2229 $ pow16 = 6.5536e+4 )
2241 INTEGER iacs( 4 ), irand( 2 )
2242 common /rancom/ irand, iacs
2249 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
2252 CALL pb_lmul( irand, iacs, j )
2253 CALL pb_ladd( j, iacs( 3 ), irand )