1 SUBROUTINE pdlascal( TYPE, M, N, ALPHA, A, IA, JA, DESCA )
11 DOUBLE PRECISION ALPHA
15 DOUBLE PRECISION A( * )
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_dlascal(
'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_dlascal( uplo, imbloc, inbloc, lcmt00, alpha,
287 $ a( iia+joffa*lda ), lda )
289 IF( upper .AND. nq.GT.inbloc )
290 $
CALL pb_dlascal(
'All', imbloc, nq-inbloc, 0, alpha,
291 $ a( iia+(joffa+inbloc)*lda ), lda )
295 IF( lower .AND. mp.GT.imbloc )
296 $
CALL pb_dlascal(
'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_dlascal( 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_dlascal(
'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_dlascal( 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_dlascal(
'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_dlascal( 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_dlascal(
'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 pdlagen( 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
523 DOUBLE PRECISION A( LDA, * )
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
726 DOUBLE PRECISION ALPHA
729 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
730 $ iran( 2 ), jmp( jmp_len ), muladd0( 4 )
746 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
757 ictxt = desca2( ctxt_ )
758 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
763 IF( nprow.EQ.-1 )
THEN
764 info = -( 1000 + ctxt_ )
766 symm = lsame( aform,
'S' )
767 herm = lsame( aform,
'H' )
768 notran = lsame( aform,
'N' )
769 diagdo = lsame( diag,
'D' )
770 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
771 $ .NOT.( lsame( aform,
'T' ) ) .AND.
772 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
774 ELSE IF( ( .NOT.diagdo ) .AND.
775 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
778 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
782 CALL pxerbla( ictxt,
'PDLAGEN', -info )
788 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
797 rsrc = desca2( rsrc_ )
798 csrc = desca2( csrc_ )
802 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
803 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
804 $ iacol, mrrow, mrcol )
816 ioffda = ja + offa - ia
817 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
818 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
819 $ lmbloc, lnbloc, ilow, low, iupp, upp )
827 itmp =
max( 0, -offa )
830 nvir = desca2( m_ ) + itmp
832 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
835 itmp =
max( 0, offa )
838 nvir =
max(
max( nvir, desca2( n_ ) + itmp ),
839 $ desca2( m_ ) + desca2( n_ ) - 1 )
841 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
844 IF( symm .OR. herm .OR. notran )
THEN
846 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
847 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
855 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
856 $ myrdist, mycdist, nprow, npcol, jmp,
859 CALL pb_dlagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
860 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
861 $ nb, lnbloc, jmp, imuladd )
865 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
867 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
868 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
876 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
877 $ myrdist, mycdist, nprow, npcol, jmp,
880 CALL pb_dlagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
881 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
882 $ nb, lnbloc, jmp, imuladd )
888 maxmn =
max( desca2( m_ ), desca2( n_ ) )
889 alpha = dble( maxmn )
891 IF( ioffda.GE.0 )
THEN
893 $ a,
min( ia+ioffda, ia+m-1 ), ja, desca )
896 $ a, ia,
min( ja-ioffda, ja+n-1 ), desca )
906 SUBROUTINE pdladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
916 DOUBLE PRECISION ALPHA
920 DOUBLE PRECISION A( * )
1034 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1035 $ dtype_, imb_, inb_, lld_, mb_, m_, nb_, n_,
1037 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1038 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1039 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1040 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1043 LOGICAL GODOWN, GOLEFT
1044 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
1045 $ imb1, imbloc, inb1, inbloc, ioffa, ioffd, iupp,
1046 $ jja, joffa, joffd, lcmt, lcmt00, lda, ldap1,
1047 $ lmbloc, lnbloc, low, mb, mblkd, mblks, mbloc,
1048 $ mrcol, mrrow, mycol, myrow, nb, nblkd, nblks,
1049 $ nbloc, np, npcol, nprow, nq, pmb, qnb, upp
1050 DOUBLE PRECISION ATMP
1053 INTEGER DESCA2( DLEN_ )
1070 ictxt = desca2( ctxt_ )
1071 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1076 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
1077 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
1078 $ iacol, mrrow, mrcol )
1093 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
1094 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
1095 $ lnbloc, ilow, low, iupp, upp )
1099 lda = desca2( lld_ )
1102 IF( desca2( rsrc_ ).LT.0 )
THEN
1107 IF( desca2( csrc_ ).LT.0 )
THEN
1116 godown = ( lcmt00.GT.iupp )
1117 goleft = ( lcmt00.LT.ilow )
1119 IF( .NOT.godown .AND. .NOT.goleft )
THEN
1123 IF( lcmt00.GE.0 )
THEN
1124 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
1125 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
1126 atmp = a( ijoffa + i*ldap1 )
1127 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1130 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
1131 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
1132 atmp = a( ijoffa + i*ldap1 )
1133 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1136 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
1137 godown = .NOT.goleft
1143 lcmt00 = lcmt00 - ( iupp - upp + pmb )
1145 ioffa = ioffa + imbloc
1148 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
1149 lcmt00 = lcmt00 - pmb
1161 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
1164 IF( lcmt.GE.0 )
THEN
1165 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
1166 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
1167 atmp = a( ijoffa + i*ldap1 )
1168 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1171 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
1172 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
1173 atmp = a( ijoffa + i*ldap1 )
1174 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1182 ioffd = ioffd + mbloc
1186 lcmt00 = lcmt00 + low - ilow + qnb
1188 joffa = joffa + inbloc
1190 ELSE IF( goleft )
THEN
1192 lcmt00 = lcmt00 + low - ilow + qnb
1194 joffa = joffa + inbloc
1197 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
1198 lcmt00 = lcmt00 + qnb
1210 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
1213 IF( lcmt.GE.0 )
THEN
1214 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
1215 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
1216 atmp = a( ijoffa + i*ldap1 )
1217 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1220 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
1221 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
1222 atmp = a( ijoffa + i*ldap1 )
1223 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1231 joffd = joffd + nbloc
1235 lcmt00 = lcmt00 - ( iupp - upp + pmb )
1237 ioffa = ioffa + imbloc
1243 IF( nblks.GT.0 )
THEN
1247 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
1248 lcmt00 = lcmt00 - pmb
1260 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
1263 IF( lcmt.GE.0 )
THEN
1264 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
1265 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
1266 atmp = a( ijoffa + i*ldap1 )
1267 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1270 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
1271 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
1272 atmp = a( ijoffa + i*ldap1 )
1273 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
1281 ioffd = ioffd + mbloc
1285 lcmt00 = lcmt00 + qnb
1287 joffa = joffa + nbloc
1297 SUBROUTINE pb_dlascal( UPLO, M, N, IOFFD, ALPHA, A, LDA )
1306 INTEGER IOFFD, LDA, M, N
1307 DOUBLE PRECISION ALPHA
1310 DOUBLE PRECISION A( LDA, * )
1400 INTEGER I, J, JTMP, MN
1413 IF( m.LE.0 .OR. n.LE.0 )
1418 IF( lsame( uplo,
'L' ) )
THEN
1422 mn =
max( 0, -ioffd )
1423 DO 20 j = 1,
min( mn, n )
1425 a( i, j ) = alpha * a( i, j )
1428 DO 40 j = mn + 1,
min( m - ioffd, n )
1429 DO 30 i = j + ioffd, m
1430 a( i, j ) = alpha * a( i, j )
1434 ELSE IF( lsame( uplo,
'U' ) )
THEN
1438 mn =
min( m - ioffd, n )
1439 DO 60 j =
max( 0, -ioffd ) + 1, mn
1440 DO 50 i = 1, j + ioffd
1441 a( i, j ) = alpha * a( i, j )
1444 DO 80 j =
max( 0, mn ) + 1, n
1446 a( i, j ) = alpha * a( i, j )
1450 ELSE IF( lsame( uplo,
'D' ) )
THEN
1454 DO 90 j =
max( 0, -ioffd ) + 1,
min( m - ioffd, n )
1456 a( jtmp, j ) = alpha * a( jtmp, j )
1465 a( i, j ) = alpha * a( i, j )
1476 SUBROUTINE pb_dlagen( UPLO, AFORM, A, LDA, LCMT00, IRAN, MBLKS,
1477 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
1478 $ LNBLOC, JMP, IMULADD )
1486 CHARACTER*1 UPLO, AFORM
1487 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
1488 $ MB, MBLKS, NB, NBLKS
1491 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
1492 DOUBLE PRECISION A( LDA, * )
1595 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
1596 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
1597 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
1598 parameter( jmp_1 = 1, jmp_row = 2, jmp_col = 3,
1599 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
1600 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
1601 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
1605 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
1606 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
1607 DOUBLE PRECISION DUMMY
1610 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
1617 DOUBLE PRECISION PB_DRAND
1618 EXTERNAL LSAME, PB_DRAND
1626 ib1( i ) = iran( i )
1627 ib2( i ) = iran( i )
1628 ib3( i ) = iran( i )
1631 IF( lsame( aform,
'N' ) )
THEN
1637 DO 50 jblk = 1, nblks
1639 IF( jblk.EQ.1 )
THEN
1641 ELSE IF( jblk.EQ.nblks )
THEN
1647 DO 40 jk = jj, jj + jb - 1
1651 DO 30 iblk = 1, mblks
1653 IF( iblk.EQ.1 )
THEN
1655 ELSE IF( iblk.EQ.mblks )
THEN
1663 DO 20 ik = ii, ii + ib - 1
1664 a( ik, jk ) = pb_drand( 0 )
1669 IF( iblk.EQ.1 )
THEN
1673 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
1680 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
1691 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
1702 IF( jblk.EQ.1 )
THEN
1706 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
1712 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
1725 ELSE IF( lsame( aform,
'T' ) .OR. lsame( aform,
'C' ) )
THEN
1732 DO 90 iblk = 1, mblks
1734 IF( iblk.EQ.1 )
THEN
1736 ELSE IF( iblk.EQ.mblks )
THEN
1742 DO 80 ik = ii, ii + ib - 1
1746 DO 70 jblk = 1, nblks
1748 IF( jblk.EQ.1 )
THEN
1750 ELSE IF( jblk.EQ.nblks )
THEN
1758 DO 60 jk = jj, jj + jb - 1
1759 a( ik, jk ) = pb_drand( 0 )
1764 IF( jblk.EQ.1 )
THEN
1768 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
1775 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
1786 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
1797 IF( iblk.EQ.1 )
THEN
1801 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
1807 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
1820 ELSE IF( ( lsame( aform,
'S' ) ).OR.( lsame( aform,
'H' ) ) )
THEN
1824 IF( lsame( uplo,
'L' ) )
THEN
1831 DO 170 jblk = 1, nblks
1833 IF( jblk.EQ.1 )
THEN
1836 ELSE IF( jblk.EQ.nblks )
THEN
1844 DO 160 jk = jj, jj + jb - 1
1849 DO 150 iblk = 1, mblks
1851 IF( iblk.EQ.1 )
THEN
1854 ELSE IF( iblk.EQ.mblks )
THEN
1864 IF( lcmtr.GT.upp )
THEN
1866 DO 100 ik = ii, ii + ib - 1
1867 dummy = pb_drand( 0 )
1870 ELSE IF( lcmtr.GE.low )
THEN
1873 mnb =
max( 0, -lcmtr )
1875 IF( jtmp.LE.
min( mnb, jb ) )
THEN
1877 DO 110 ik = ii, ii + ib - 1
1878 a( ik, jk ) = pb_drand( 0 )
1881 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
1882 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
1884 itmp = ii + jtmp + lcmtr - 1
1886 DO 120 ik = ii, itmp - 1
1887 dummy = pb_drand( 0 )
1890 DO 130 ik = itmp, ii + ib - 1
1891 a( ik, jk ) = pb_drand( 0 )
1898 DO 140 ik = ii, ii + ib - 1
1899 a( ik, jk ) = pb_drand( 0 )
1906 IF( iblk.EQ.1 )
THEN
1910 lcmtr = lcmtr - jmp( jmp_npimbloc )
1911 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
1918 lcmtr = lcmtr - jmp( jmp_npmb )
1919 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
1931 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
1942 IF( jblk.EQ.1 )
THEN
1946 lcmtc = lcmtc + jmp( jmp_nqinbloc )
1947 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
1953 lcmtc = lcmtc + jmp( jmp_nqnb )
1954 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
1974 DO 250 iblk = 1, mblks
1976 IF( iblk.EQ.1 )
THEN
1979 ELSE IF( iblk.EQ.mblks )
THEN
1987 DO 240 ik = ii, ii + ib - 1
1992 DO 230 jblk = 1, nblks
1994 IF( jblk.EQ.1 )
THEN
1997 ELSE IF( jblk.EQ.nblks )
THEN
2007 IF( lcmtc.LT.low )
THEN
2009 DO 180 jk = jj, jj + jb - 1
2010 dummy = pb_drand( 0 )
2013 ELSE IF( lcmtc.LE.upp )
THEN
2016 mnb =
max( 0, lcmtc )
2018 IF( itmp.LE.
min( mnb, ib ) )
THEN
2020 DO 190 jk = jj, jj + jb - 1
2021 a( ik, jk ) = pb_drand( 0 )
2024 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
2025 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
2027 jtmp = jj + itmp - lcmtc - 1
2029 DO 200 jk = jj, jtmp - 1
2030 dummy = pb_drand( 0 )
2033 DO 210 jk = jtmp, jj + jb - 1
2034 a( ik, jk ) = pb_drand( 0 )
2041 DO 220 jk = jj, jj + jb - 1
2042 a( ik, jk ) = pb_drand( 0 )
2049 IF( jblk.EQ.1 )
THEN
2053 lcmtc = lcmtc + jmp( jmp_nqinbloc )
2054 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
2061 lcmtc = lcmtc + jmp( jmp_nqnb )
2062 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
2074 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
2085 IF( iblk.EQ.1 )
THEN
2089 lcmtr = lcmtr - jmp( jmp_npimbloc )
2090 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
2096 lcmtr = lcmtr - jmp( jmp_npmb )
2097 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
2119 DOUBLE PRECISION FUNCTION pb_drand( IDUMM )
2165 DOUBLE PRECISION one, two
2166 PARAMETER ( one = 1.0d+0, two = 2.0d+0 )
2181 DOUBLE PRECISION FUNCTION pb_dran( IDUMM )
2226 DOUBLE PRECISION divfac, pow16
2227 PARAMETER ( divfac = 2.147483648d+9,
2228 $ pow16 = 6.5536d+4 )
2240 INTEGER iacs( 4 ), irand( 2 )
2241 common /rancom/ irand, iacs
2248 pb_dran = ( dble( irand( 1 ) ) + pow16 * dble( irand( 2 ) ) ) /
2251 CALL pb_lmul( irand, iacs, j )
2252 CALL pb_ladd( j, iacs( 3 ), irand )