1 SUBROUTINE pclascal( 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_clascal(
'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_clascal( uplo, imbloc, inbloc, lcmt00, alpha,
287 $ a( iia+joffa*lda ), lda )
289 IF( upper .AND. nq.GT.inbloc )
290 $
CALL pb_clascal(
'All', imbloc, nq-inbloc, 0, alpha,
291 $ a( iia+(joffa+inbloc)*lda ), lda )
295 IF( lower .AND. mp.GT.imbloc )
296 $
CALL pb_clascal(
'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_clascal( 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_clascal(
'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_clascal( 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_clascal(
'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_clascal( 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_clascal(
'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 pclagen( 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,
717 parameter( zero = 0.0e+0 )
720 LOGICAL DIAGDO, SYMM, HERM, NOTRAN
721 INTEGER CSRC, I, IACOL, IAROW, ICTXT, IIA, ILOCBLK,
722 $ ilocoff, ilow, imb, imb1, imbloc, imbvir, inb,
723 $ inb1, inbloc, inbvir, info, ioffda, itmp, iupp,
724 $ ivir, jja, jlocblk, jlocoff, jvir, lcmt00,
725 $ lmbloc, lnbloc, low, maxmn, mb, mblks, mp,
726 $ mrcol, mrrow, mycdist, mycol, myrdist, myrow,
727 $ nb, nblks, npcol, nprow, nq, nvir, rsrc, upp
731 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
732 $ iran( 2 ), jmp( jmp_len ), muladd0( 4 )
748 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
759 ictxt = desca2( ctxt_ )
760 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
765 IF( nprow.EQ.-1 )
THEN
766 info = -( 1000 + ctxt_ )
768 symm = lsame( aform,
'S' )
769 herm = lsame( aform,
'H' )
770 notran = lsame( aform,
'N' )
771 diagdo = lsame( diag,
'D' )
772 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
773 $ .NOT.( lsame( aform,
'T' ) ) .AND.
774 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
776 ELSE IF( ( .NOT.diagdo ) .AND.
777 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
780 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
784 CALL pxerbla( ictxt,
'PCLAGEN', -info )
790 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
799 rsrc = desca2( rsrc_ )
800 csrc = desca2( csrc_ )
804 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
805 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
806 $ iacol, mrrow, mrcol )
818 ioffda = ja + offa - ia
819 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
820 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
821 $ lmbloc, lnbloc, ilow, low, iupp, upp )
829 itmp =
max( 0, -offa )
832 nvir = desca2( m_ ) + itmp
834 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
837 itmp =
max( 0, offa )
840 nvir =
max(
max( nvir, desca2( n_ ) + itmp ),
841 $ desca2( m_ ) + desca2( n_ ) - 1 )
843 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
846 IF( symm .OR. herm .OR. notran )
THEN
848 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
849 $ mb, nb, rsrc, csrc, nprow, npcol, 2, jmp )
857 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
858 $ myrdist, mycdist, nprow, npcol, jmp,
861 CALL pb_clagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
862 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
863 $ nb, lnbloc, jmp, imuladd )
867 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
869 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
870 $ mb, nb, rsrc, csrc, nprow, npcol, 2, jmp )
878 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
879 $ myrdist, mycdist, nprow, npcol, jmp,
882 CALL pb_clagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
883 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
884 $ nb, lnbloc, jmp, imuladd )
890 maxmn =
max( desca2( m_ ), desca2( n_ ) )
892 alpha =
cmplx( real( 2 * maxmn ), zero )
894 alpha =
cmplx( real( maxmn ), real( maxmn ) )
897 IF( ioffda.GE.0 )
THEN
899 $ a,
min( ia+ioffda, ia+m-1 ), ja, desca )
902 $ a, ia,
min( ja-ioffda, ja+n-1 ), desca )
912 SUBROUTINE pcladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
1040 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1041 $ dtype_, imb_, inb_, lld_, mb_, m_, nb_, n_,
1043 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1044 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1045 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1046 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1049 LOGICAL GODOWN, GOLEFT
1050 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
1051 $ imb1, imbloc, inb1, inbloc, ioffa, ioffd, iupp,
1052 $ jja, joffa, joffd, lcmt, lcmt00, lda, ldap1,
1053 $ lmbloc, lnbloc, low, mb, mblkd, mblks, mbloc,
1054 $ mrcol, mrrow, mycol, myrow, nb, nblkd, nblks,
1055 $ nbloc, np, npcol, nprow, nq, pmb, qnb, upp
1059 INTEGER DESCA2( DLEN_ )
1076 ictxt = desca2( ctxt_ )
1077 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1082 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
1083 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
1084 $ iacol, mrrow, mrcol )
1099 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
1100 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
1101 $ lnbloc, ilow, low, iupp, upp )
1105 lda = desca2( lld_ )
1108 IF( desca2( rsrc_ ).LT.0 )
THEN
1113 IF( desca2( csrc_ ).LT.0 )
THEN
1122 godown = ( lcmt00.GT.iupp )
1123 goleft = ( lcmt00.LT.ilow )
1125 IF( .NOT.godown .AND. .NOT.goleft )
THEN
1129 IF( lcmt00.GE.0 )
THEN
1130 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
1131 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
1132 atmp = a( ijoffa + i*ldap1 )
1133 a( ijoffa + i*ldap1 ) = alpha +
1134 $
cmplx( abs( real( atmp ) ),
1135 $ abs( aimag( atmp ) ) )
1138 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
1139 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
1140 atmp = a( ijoffa + i*ldap1 )
1141 a( ijoffa + i*ldap1 ) = alpha +
1142 $
cmplx( abs( real( atmp ) ),
1143 $ abs( aimag( atmp ) ) )
1146 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
1147 godown = .NOT.goleft
1153 lcmt00 = lcmt00 - ( iupp - upp + pmb )
1155 ioffa = ioffa + imbloc
1158 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
1159 lcmt00 = lcmt00 - pmb
1171 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
1174 IF( lcmt.GE.0 )
THEN
1175 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
1176 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
1177 atmp = a( ijoffa + i*ldap1 )
1178 a( ijoffa + i*ldap1 ) = alpha +
1179 $
cmplx( abs( real( atmp ) ),
1180 $ abs( aimag( atmp ) ) )
1183 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
1184 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
1185 atmp = a( ijoffa + i*ldap1 )
1186 a( ijoffa + i*ldap1 ) = alpha +
1187 $
cmplx( abs( real( atmp ) ),
1188 $ abs( aimag( atmp ) ) )
1196 ioffd = ioffd + mbloc
1200 lcmt00 = lcmt00 + low - ilow + qnb
1202 joffa = joffa + inbloc
1204 ELSE IF( goleft )
THEN
1206 lcmt00 = lcmt00 + low - ilow + qnb
1208 joffa = joffa + inbloc
1211 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
1212 lcmt00 = lcmt00 + qnb
1224 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
1227 IF( lcmt.GE.0 )
THEN
1228 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
1229 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
1230 atmp = a( ijoffa + i*ldap1 )
1231 a( ijoffa + i*ldap1 ) = alpha +
1232 $
cmplx( abs( real( atmp ) ),
1233 $ abs( aimag( atmp ) ) )
1236 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
1237 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
1238 atmp = a( ijoffa + i*ldap1 )
1239 a( ijoffa + i*ldap1 ) = alpha +
1240 $
cmplx( abs( real( atmp ) ),
1241 $ abs( aimag( atmp ) ) )
1249 joffd = joffd + nbloc
1253 lcmt00 = lcmt00 - ( iupp - upp + pmb )
1255 ioffa = ioffa + imbloc
1261 IF( nblks.GT.0 )
THEN
1265 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
1266 lcmt00 = lcmt00 - pmb
1278 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
1281 IF( lcmt.GE.0 )
THEN
1282 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
1283 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
1284 atmp = a( ijoffa + i*ldap1 )
1285 a( ijoffa + i*ldap1 ) = alpha +
1286 $
cmplx( abs( real( atmp ) ),
1287 $ abs( aimag( atmp ) ) )
1290 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
1291 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
1292 atmp = a( ijoffa + i*ldap1 )
1293 a( ijoffa + i*ldap1 ) = alpha +
1294 $
cmplx( abs( real( atmp ) ),
1295 $ abs( aimag( atmp ) ) )
1303 ioffd = ioffd + mbloc
1307 lcmt00 = lcmt00 + qnb
1309 joffa = joffa + nbloc
1319 SUBROUTINE pb_clascal( UPLO, M, N, IOFFD, ALPHA, A, LDA )
1328 INTEGER IOFFD, LDA, M, N
1422 INTEGER I, J, JTMP, MN
1435 IF( m.LE.0 .OR. n.LE.0 )
1440 IF( lsame( uplo,
'L' ) )
THEN
1444 mn =
max( 0, -ioffd )
1445 DO 20 j = 1,
min( mn, n )
1447 a( i, j ) = alpha * a( i, j )
1450 DO 40 j = mn + 1,
min( m - ioffd, n )
1451 DO 30 i = j + ioffd, m
1452 a( i, j ) = alpha * a( i, j )
1456 ELSE IF( lsame( uplo,
'U' ) )
THEN
1460 mn =
min( m - ioffd, n )
1461 DO 60 j =
max( 0, -ioffd ) + 1, mn
1462 DO 50 i = 1, j + ioffd
1463 a( i, j ) = alpha * a( i, j )
1466 DO 80 j =
max( 0, mn ) + 1, n
1468 a( i, j ) = alpha * a( i, j )
1472 ELSE IF( lsame( uplo,
'D' ) )
THEN
1476 DO 90 j =
max( 0, -ioffd ) + 1,
min( m - ioffd, n )
1478 a( jtmp, j ) = alpha * a( jtmp, j )
1487 a( i, j ) = alpha * a( i, j )
1498 SUBROUTINE pb_clagen( UPLO, AFORM, A, LDA, LCMT00, IRAN, MBLKS,
1499 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
1500 $ LNBLOC, JMP, IMULADD )
1508 CHARACTER*1 UPLO, AFORM
1509 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
1510 $ MB, MBLKS, NB, NBLKS
1513 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
1617 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
1618 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
1619 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
1620 parameter( jmp_1 = 1, jmp_row = 2, jmp_col = 3,
1621 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
1622 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
1623 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
1626 PARAMETER ( ZERO = 0.0e+0 )
1629 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
1630 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
1634 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
1642 EXTERNAL LSAME, PB_SRAND
1650 ib1( i ) = iran( i )
1651 ib2( i ) = iran( i )
1652 ib3( i ) = iran( i )
1655 IF( lsame( aform,
'N' ) )
THEN
1661 DO 50 jblk = 1, nblks
1663 IF( jblk.EQ.1 )
THEN
1665 ELSE IF( jblk.EQ.nblks )
THEN
1671 DO 40 jk = jj, jj + jb - 1
1675 DO 30 iblk = 1, mblks
1677 IF( iblk.EQ.1 )
THEN
1679 ELSE IF( iblk.EQ.mblks )
THEN
1687 DO 20 ik = ii, ii + ib - 1
1688 a( ik, jk ) =
cmplx( pb_srand( 0 ), pb_srand( 0 ) )
1693 IF( iblk.EQ.1 )
THEN
1697 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
1704 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
1715 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
1726 IF( jblk.EQ.1 )
THEN
1730 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
1736 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
1749 ELSE IF( lsame( aform,
'T' ) )
THEN
1756 DO 90 iblk = 1, mblks
1758 IF( iblk.EQ.1 )
THEN
1760 ELSE IF( iblk.EQ.mblks )
THEN
1766 DO 80 ik = ii, ii + ib - 1
1770 DO 70 jblk = 1, nblks
1772 IF( jblk.EQ.1 )
THEN
1774 ELSE IF( jblk.EQ.nblks )
THEN
1782 DO 60 jk = jj, jj + jb - 1
1783 a( ik, jk ) =
cmplx( pb_srand( 0 ), pb_srand( 0 ) )
1788 IF( jblk.EQ.1 )
THEN
1792 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
1799 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
1810 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
1821 IF( iblk.EQ.1 )
THEN
1825 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
1831 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
1844 ELSE IF( lsame( aform,
'S' ) )
THEN
1848 IF( lsame( uplo,
'L' ) )
THEN
1855 DO 170 jblk = 1, nblks
1857 IF( jblk.EQ.1 )
THEN
1860 ELSE IF( jblk.EQ.nblks )
THEN
1868 DO 160 jk = jj, jj + jb - 1
1873 DO 150 iblk = 1, mblks
1875 IF( iblk.EQ.1 )
THEN
1878 ELSE IF( iblk.EQ.mblks )
THEN
1888 IF( lcmtr.GT.upp )
THEN
1890 DO 100 ik = ii, ii + ib - 1
1891 dummy =
cmplx( pb_srand( 0 ),
1895 ELSE IF( lcmtr.GE.low )
THEN
1898 mnb =
max( 0, -lcmtr )
1900 IF( jtmp.LE.
min( mnb, jb ) )
THEN
1902 DO 110 ik = ii, ii + ib - 1
1903 a( ik, jk ) =
cmplx( pb_srand( 0 ),
1907 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
1908 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
1910 itmp = ii + jtmp + lcmtr - 1
1912 DO 120 ik = ii, itmp - 1
1913 dummy =
cmplx( pb_srand( 0 ),
1917 DO 130 ik = itmp, ii + ib - 1
1918 a( ik, jk ) =
cmplx( pb_srand( 0 ),
1926 DO 140 ik = ii, ii + ib - 1
1927 a( ik, jk ) =
cmplx( pb_srand( 0 ),
1935 IF( iblk.EQ.1 )
THEN
1939 lcmtr = lcmtr - jmp( jmp_npimbloc )
1940 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
1947 lcmtr = lcmtr - jmp( jmp_npmb )
1948 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
1960 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
1971 IF( jblk.EQ.1 )
THEN
1975 lcmtc = lcmtc + jmp( jmp_nqinbloc )
1976 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
1982 lcmtc = lcmtc + jmp( jmp_nqnb )
1983 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
2003 DO 250 iblk = 1, mblks
2005 IF( iblk.EQ.1 )
THEN
2008 ELSE IF( iblk.EQ.mblks )
THEN
2016 DO 240 ik = ii, ii + ib - 1
2021 DO 230 jblk = 1, nblks
2023 IF( jblk.EQ.1 )
THEN
2026 ELSE IF( jblk.EQ.nblks )
THEN
2036 IF( lcmtc.LT.low )
THEN
2038 DO 180 jk = jj, jj + jb - 1
2039 dummy =
cmplx( pb_srand( 0 ), pb_srand( 0 ) )
2042 ELSE IF( lcmtc.LE.upp )
THEN
2045 mnb =
max( 0, lcmtc )
2047 IF( itmp.LE.
min( mnb, ib ) )
THEN
2049 DO 190 jk = jj, jj + jb - 1
2050 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2054 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
2055 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
2057 jtmp = jj + itmp - lcmtc - 1
2059 DO 200 jk = jj, jtmp - 1
2060 dummy =
cmplx( pb_srand( 0 ),
2064 DO 210 jk = jtmp, jj + jb - 1
2065 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2073 DO 220 jk = jj, jj + jb - 1
2074 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2082 IF( jblk.EQ.1 )
THEN
2086 lcmtc = lcmtc + jmp( jmp_nqinbloc )
2087 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
2094 lcmtc = lcmtc + jmp( jmp_nqnb )
2095 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
2107 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
2118 IF( iblk.EQ.1 )
THEN
2122 lcmtr = lcmtr - jmp( jmp_npimbloc )
2123 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
2129 lcmtr = lcmtr - jmp( jmp_npmb )
2130 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
2145 ELSE IF( lsame( aform,
'C' ) )
THEN
2152 DO 290 iblk = 1, mblks
2154 IF( iblk.EQ.1 )
THEN
2156 ELSE IF( iblk.EQ.mblks )
THEN
2162 DO 280 ik = ii, ii + ib - 1
2166 DO 270 jblk = 1, nblks
2168 IF( jblk.EQ.1 )
THEN
2170 ELSE IF( jblk.EQ.nblks )
THEN
2178 DO 260 jk = jj, jj + jb - 1
2179 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2185 IF( jblk.EQ.1 )
THEN
2189 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
2196 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
2208 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
2219 IF( iblk.EQ.1 )
THEN
2223 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
2229 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
2242 ELSE IF( lsame( aform,
'H' ) )
THEN
2246 IF( lsame( uplo,
'L' ) )
THEN
2253 DO 370 jblk = 1, nblks
2255 IF( jblk.EQ.1 )
THEN
2258 ELSE IF( jblk.EQ.nblks )
THEN
2266 DO 360 jk = jj, jj + jb - 1
2271 DO 350 iblk = 1, mblks
2273 IF( iblk.EQ.1 )
THEN
2276 ELSE IF( iblk.EQ.mblks )
THEN
2286 IF( lcmtr.GT.upp )
THEN
2288 DO 300 ik = ii, ii + ib - 1
2289 dummy =
cmplx( pb_srand( 0 ),
2293 ELSE IF( lcmtr.GE.low )
THEN
2296 mnb =
max( 0, -lcmtr )
2298 IF( jtmp.LE.
min( mnb, jb ) )
THEN
2300 DO 310 ik = ii, ii + ib - 1
2301 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2305 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
2306 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
2308 itmp = ii + jtmp + lcmtr - 1
2310 DO 320 ik = ii, itmp - 1
2311 dummy =
cmplx( pb_srand( 0 ),
2315 IF( itmp.LE.( ii + ib - 1 ) )
THEN
2316 dummy =
cmplx( pb_srand( 0 ),
2318 a( itmp, jk ) =
cmplx( real( dummy ),
2322 DO 330 ik = itmp + 1, ii + ib - 1
2323 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2331 DO 340 ik = ii, ii + ib - 1
2332 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2340 IF( iblk.EQ.1 )
THEN
2344 lcmtr = lcmtr - jmp( jmp_npimbloc )
2345 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
2352 lcmtr = lcmtr - jmp( jmp_npmb )
2353 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
2365 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
2376 IF( jblk.EQ.1 )
THEN
2380 lcmtc = lcmtc + jmp( jmp_nqinbloc )
2381 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
2387 lcmtc = lcmtc + jmp( jmp_nqnb )
2388 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
2408 DO 450 iblk = 1, mblks
2410 IF( iblk.EQ.1 )
THEN
2413 ELSE IF( iblk.EQ.mblks )
THEN
2421 DO 440 ik = ii, ii + ib - 1
2426 DO 430 jblk = 1, nblks
2428 IF( jblk.EQ.1 )
THEN
2431 ELSE IF( jblk.EQ.nblks )
THEN
2441 IF( lcmtc.LT.low )
THEN
2443 DO 380 jk = jj, jj + jb - 1
2444 dummy =
cmplx( pb_srand( 0 ),
2448 ELSE IF( lcmtc.LE.upp )
THEN
2451 mnb =
max( 0, lcmtc )
2453 IF( itmp.LE.
min( mnb, ib ) )
THEN
2455 DO 390 jk = jj, jj + jb - 1
2456 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2460 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
2461 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
2463 jtmp = jj + itmp - lcmtc - 1
2465 DO 400 jk = jj, jtmp - 1
2466 dummy =
cmplx( pb_srand( 0 ),
2470 IF( jtmp.LE.( jj + jb - 1 ) )
THEN
2471 dummy =
cmplx( pb_srand( 0 ),
2473 a( ik, jtmp ) =
cmplx( real( dummy ),
2477 DO 410 jk = jtmp + 1, jj + jb - 1
2478 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2486 DO 420 jk = jj, jj + jb - 1
2487 a( ik, jk ) =
cmplx( pb_srand( 0 ),
2495 IF( jblk.EQ.1 )
THEN
2499 lcmtc = lcmtc + jmp( jmp_nqinbloc )
2500 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
2507 lcmtc = lcmtc + jmp( jmp_nqnb )
2508 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
2520 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
2531 IF( iblk.EQ.1 )
THEN
2535 lcmtr = lcmtr - jmp( jmp_npimbloc )
2536 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
2542 lcmtr = lcmtr - jmp( jmp_npmb )
2543 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
2565 REAL FUNCTION PB_SRAND( IDUMM )
2612 PARAMETER ( one = 1.0e+0, two = 2.0e+0 )
2620 pb_srand = one - two *
pb_sran( idumm )
2627 REAL function
pb_sran( idumm )
2673 PARAMETER ( divfac = 2.147483648e+9,
2674 $ pow16 = 6.5536e+4 )
2686 INTEGER iacs( 4 ), irand( 2 )
2687 common /rancom/ irand, iacs
2694 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
2697 CALL pb_lmul( irand, iacs, j )
2698 CALL pb_ladd( j, iacs( 3 ), irand )