1 SUBROUTINE pdoptee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
9 INTEGER ICTXT, NOUT, SCODE
156 IF( scode.EQ.21 )
THEN
161 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
163 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
169 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
171 ELSE IF( scode.EQ.23 )
THEN
176 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
181 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
186 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
190 ELSE IF( scode.EQ.31 )
THEN
195 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
200 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'B', apos )
202 ELSE IF( scode.EQ.32 )
THEN
207 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
212 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
214 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 .OR. scode.EQ.35 .OR.
215 $ scode.EQ.36 .OR. scode.EQ.40 )
THEN
220 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
225 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
227 ELSE IF( scode.EQ.38 )
THEN
232 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
237 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
242 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
247 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
250 ELSE IF( scode.EQ.39 )
THEN
255 CALL pdchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
264 SUBROUTINE pdchkopt( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
274 INTEGER ARGPOS, ICTXT, NOUT, SCODE
399 CHARACTER DIAG, SIDE, TRANSA, TRANSB, UPLO
400 COMMON /pblasc/diag, side, transa, transb, uplo
408 IF( lsame( argnam,
'D' ) )
THEN
414 ELSE IF( lsame( argnam,
'S' ) )
THEN
420 ELSE IF( lsame( argnam,
'A' ) )
THEN
426 ELSE IF( lsame( argnam,
'B' ) )
THEN
432 ELSE IF( lsame( argnam,
'U' ) )
THEN
447 CALL pchkpbe( ictxt, nout, sname, infot )
454 SUBROUTINE pddimee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
462 INTEGER ICTXT, NOUT, SCODE
609 IF( scode.EQ.11 .OR. scode.EQ.12 .OR. scode.EQ.13 .OR.
610 $ scode.EQ.14 .OR. scode.EQ.15 )
THEN
615 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
619 ELSE IF( scode.EQ.21 )
THEN
624 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
629 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
631 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
637 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
639 ELSE IF( scode.EQ.23 )
THEN
644 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
646 ELSE IF( scode.EQ.24 )
THEN
651 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
656 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
660 ELSE IF( scode.EQ.31 )
THEN
665 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
670 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
675 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
677 ELSE IF( scode.EQ.32 )
THEN
682 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
687 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
689 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 .OR. scode.EQ.35 .OR.
695 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
700 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
702 ELSE IF( scode.EQ.37 )
THEN
707 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
712 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
714 ELSE IF( scode.EQ.38 )
THEN
719 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
724 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
726 ELSE IF( scode.EQ.39 )
THEN
731 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
736 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
738 ELSE IF( scode.EQ.40 )
THEN
743 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
748 CALL pdchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
757 SUBROUTINE pdchkdim( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
767 INTEGER ARGPOS, ICTXT, NOUT, SCODE
892 INTEGER KDIM, MDIM, NDIM
893 COMMON /PBLASN/KDIM, MDIM, NDIM
901 IF( lsame( argnam,
'M' ) )
THEN
907 ELSE IF( lsame( argnam,
'N' ) )
THEN
928 CALL pchkpbe( ictxt, nout, sname, infot )
935 SUBROUTINE pdvecee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
943 INTEGER ICTXT, NOUT, SCODE
1092 IF( scode.EQ.11 )
THEN
1097 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1102 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1104 ELSE IF( scode.EQ.12 .OR. scode.EQ.15 )
THEN
1109 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1111 ELSE IF( scode.EQ.13 )
THEN
1116 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1121 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1123 ELSE IF( scode.EQ.14 )
THEN
1128 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1132 ELSE IF( scode.EQ.21 )
THEN
1137 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1142 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1144 ELSE IF( scode.EQ.22 )
THEN
1149 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1154 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1156 ELSE IF( scode.EQ.23 )
THEN
1161 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1163 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1168 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1173 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1175 ELSE IF( scode.EQ.26 .OR. scode.EQ.27 )
THEN
1180 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1189 SUBROUTINE pdmatee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
1197 INTEGER ICTXT, NOUT, SCODE
1346 IF( scode.EQ.21 .OR. scode.EQ.23 )
THEN
1351 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1353 ELSE IF( scode.EQ.22 )
THEN
1358 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1360 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1365 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1367 ELSE IF( scode.EQ.25 .OR. scode.EQ.26 )
THEN
1372 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1376 ELSE IF( scode.EQ.31 )
THEN
1381 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1386 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1391 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1393 ELSE IF( scode.EQ.32 .OR. scode.EQ.35 .OR. scode.EQ.36 )
THEN
1398 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1403 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1408 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1410 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 )
THEN
1415 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1420 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1422 ELSE IF( scode.EQ.37 )
THEN
1427 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1432 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1434 ELSE IF( scode.EQ.38 )
THEN
1439 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1444 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1446 ELSE IF( scode.EQ.39 )
THEN
1451 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1456 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1458 ELSE IF( scode.EQ.40 )
THEN
1463 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1468 CALL pdchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1570 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1571 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
1573 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1574 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1575 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1576 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1577 DOUBLE PRECISION ONE
1578 PARAMETER ( ONE = 1.0d+0 )
1584 CHARACTER*1 DIAG, SIDE, TRANSA, TRANSB, UPLO
1585 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
1586 $ jc, jx, jy, kdim, mdim, ndim
1587 DOUBLE PRECISION USCLR, SCLR
1588 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1589 $ descx( dlen_ ), descy( dlen_ )
1590 DOUBLE PRECISION A( 2, 2 ), B( 2, 2 ), C( 2, 2 ), X( 2 ), Y( 2 )
1591 COMMON /PBLASC/DIAG, SIDE, TRANSA, TRANSB, UPLO
1592 COMMON /pblasd/desca, descb, descc, descx, descy
1593 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
1594 $ ja, jb, jc, jx, jy
1595 COMMON /pblasm/a, b, c
1596 COMMON /pblasn/kdim, mdim, ndim
1597 COMMON /pblass/sclr, usclr
1627 CALL pb_descset2( desca, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1637 CALL pb_descset2( descb, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1647 CALL pb_descset2( descc, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1655 CALL pb_descset2( descx, 2, 1, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1664 CALL pb_descset2( descy, 2, 1, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1672 SUBROUTINE pdchkmat( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
1682 INTEGER ARGPOS, ICTXT, NOUT, SCODE
1798 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1799 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
1801 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1802 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1803 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1804 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1806 PARAMETER ( DESCMULT = 100 )
1809 INTEGER I, INFOT, NPROW, NPCOL, MYROW, MYCOL
1819 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
1821 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1822 $ descx( dlen_ ), descy( dlen_ )
1823 COMMON /pblasd/desca, descb, descc, descx, descy
1824 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
1825 $ ja, jb, jc, jx, jy
1829 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1831 IF( lsame( argnam,
'A' ) )
THEN
1839 CALL pchkpbe( ictxt, nout, sname, infot )
1847 CALL pchkpbe( ictxt, nout, sname, infot )
1857 infot = ( ( argpos + 3 ) * descmult ) + i
1859 CALL pchkpbe( ictxt, nout, sname, infot )
1863 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1864 $ ( i.EQ.lld_ ) )
THEN
1871 $ desca( i ) = nprow
1876 $ desca( i ) = npcol
1880 IF( i.EQ.lld_ )
THEN
1881 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
1888 infot = ( ( argpos + 3 ) * descmult ) + i
1890 CALL pchkpbe( ictxt, nout, sname, infot )
1896 ELSE IF( lsame( argnam,
'B' ) )
THEN
1904 CALL pchkpbe( ictxt, nout, sname, infot )
1912 CALL pchkpbe( ictxt, nout, sname, infot )
1922 infot = ( ( argpos + 3 ) * descmult ) + i
1924 CALL pchkpbe( ictxt, nout, sname, infot )
1928 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1929 $ ( i.EQ.lld_ ) )
THEN
1936 $ descb( i ) = nprow
1941 $ descb( i ) = npcol
1945 IF( i.EQ.lld_ )
THEN
1946 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
1953 infot = ( ( argpos + 3 ) * descmult ) + i
1955 CALL pchkpbe( ictxt, nout, sname, infot )
1961 ELSE IF( lsame( argnam,
'C' ) )
THEN
1969 CALL pchkpbe( ictxt, nout, sname, infot )
1977 CALL pchkpbe( ictxt, nout, sname, infot )
1987 infot = ( ( argpos + 3 ) * descmult ) + i
1989 CALL pchkpbe( ictxt, nout, sname, infot )
1993 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1994 $ ( i.EQ.lld_ ) )
THEN
2001 $ descc( i ) = nprow
2006 $ descc( i ) = npcol
2010 IF( i.EQ.lld_ )
THEN
2011 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2018 infot = ( ( argpos + 3 ) * descmult ) + i
2020 CALL pchkpbe( ictxt, nout, sname, infot )
2026 ELSE IF( lsame( argnam,
'X' ) )
THEN
2034 CALL pchkpbe( ictxt, nout, sname, infot )
2042 CALL pchkpbe( ictxt, nout, sname, infot )
2052 infot = ( ( argpos + 3 ) * descmult ) + i
2054 CALL pchkpbe( ictxt, nout, sname, infot )
2058 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
2059 $ ( i.EQ.lld_ ) )
THEN
2066 $ descx( i ) = nprow
2071 $ descx( i ) = npcol
2075 IF( i.EQ.lld_ )
THEN
2076 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2083 infot = ( ( argpos + 3 ) * descmult ) + i
2085 CALL pchkpbe( ictxt, nout, sname, infot )
2097 CALL pchkpbe( ictxt, nout, sname, infot )
2107 CALL pchkpbe( ictxt, nout, sname, infot )
2115 CALL pchkpbe( ictxt, nout, sname, infot )
2125 infot = ( ( argpos + 3 ) * descmult ) + i
2127 CALL pchkpbe( ictxt, nout, sname, infot )
2131 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
2132 $ ( i.EQ.lld_ ) )
THEN
2139 $ descy( i ) = nprow
2144 $ descy( i ) = npcol
2148 IF( i.EQ.lld_ )
THEN
2149 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2156 infot = ( ( argpos + 3 ) * descmult ) + i
2158 CALL pchkpbe( ictxt, nout, sname, infot )
2170 CALL pchkpbe( ictxt, nout, sname, infot )
2308 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2309 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2311 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
2312 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2313 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2314 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2317 CHARACTER*1 DIAG, SIDE, TRANSA, TRANSB, UPLO
2318 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
2319 $ JC, JX, JY, KDIM, MDIM, NDIM
2320 DOUBLE PRECISION USCLR, SCLR
2321 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
2322 $ DESCX( DLEN_ ), DESCY( DLEN_ )
2323 DOUBLE PRECISION A( 2, 2 ), B( 2, 2 ), C( 2, 2 ), X( 2 ), Y( 2 )
2324 COMMON /pblasc/diag, side, transa, transb, uplo
2325 COMMON /pblasd/desca, descb, descc, descx, descy
2326 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
2327 $ ja, jb, jc, jx, jy
2328 COMMON /pblasm/a, b, c
2329 COMMON /pblasn/kdim, mdim, ndim
2330 COMMON /pblass/sclr, usclr
2337 IF( scode.EQ.11 )
THEN
2339 CALL subptr( ndim, x, ix, jx, descx, incx, y, iy, jy, descy,
2342 ELSE IF( scode.EQ.12 )
THEN
2344 CALL subptr( ndim, sclr, x, ix, jx, descx, incx )
2346 ELSE IF( scode.EQ.13 )
THEN
2348 CALL subptr( ndim, sclr, x, ix, jx, descx, incx, y, iy, jy,
2351 ELSE IF( scode.EQ.14 )
THEN
2353 CALL subptr( ndim, sclr, isclr, x, ix, jx, descx, incx )
2355 ELSE IF( scode.EQ.15 )
THEN
2357 CALL subptr( ndim, usclr, x, ix, jx, descx, incx )
2361 ELSE IF( scode.EQ.21 )
THEN
2363 CALL subptr( transa, mdim, ndim, sclr, a, ia, ja, desca, x, ix,
2364 $ jx, descx, incx, sclr, y, iy, jy, descy, incy )
2366 ELSE IF( scode.EQ.22 )
THEN
2368 CALL subptr( uplo, ndim, sclr, a, ia, ja, desca, x, ix, jx,
2369 $ descx, incx, sclr, y, iy, jy, descy, incy )
2371 ELSE IF( scode.EQ.23 )
THEN
2373 CALL subptr( uplo, transa, diag, ndim, a, ia, ja, desca, x, ix,
2376 ELSE IF( scode.EQ.24 )
THEN
2378 CALL subptr( mdim, ndim, sclr, x, ix, jx, descx, incx, y, iy,
2379 $ jy, descy, incy, a, ia, ja, desca )
2381 ELSE IF( scode.EQ.25 )
THEN
2383 CALL subptr( uplo, ndim, sclr, x, ix, jx, descx, incx, a, ia,
2386 ELSE IF( scode.EQ.26 )
THEN
2388 CALL subptr( uplo, ndim, usclr, x, ix, jx, descx, incx, a, ia,
2391 ELSE IF( scode.EQ.27 )
THEN
2393 CALL subptr( uplo, ndim, sclr, x, ix, jx, descx, incx, y, iy,
2394 $ jy, descy, incy, a, ia, ja, desca )
2398 ELSE IF( scode.EQ.31 )
THEN
2400 CALL subptr( transa, transb, mdim, ndim, kdim, sclr, a, ia, ja,
2401 $ desca, b, ib, jb, descb, sclr, c, ic, jc, descc )
2403 ELSE IF( scode.EQ.32 )
THEN
2405 CALL subptr( side, uplo, mdim, ndim, sclr, a, ia, ja, desca, b,
2406 $ ib, jb, descb, sclr, c, ic, jc, descc )
2408 ELSE IF( scode.EQ.33 )
THEN
2410 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2411 $ sclr, c, ic, jc, descc )
2413 ELSE IF( scode.EQ.34 )
THEN
2415 CALL subptr( uplo, transa, ndim, kdim, usclr, a, ia, ja, desca,
2416 $ usclr, c, ic, jc, descc )
2418 ELSE IF( scode.EQ.35 )
THEN
2420 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2421 $ b, ib, jb, descb, sclr, c, ic, jc, descc )
2423 ELSE IF( scode.EQ.36 )
THEN
2425 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2426 $ b, ib, jb, descb, usclr, c, ic, jc, descc )
2428 ELSE IF( scode.EQ.37 )
THEN
2430 CALL subptr( mdim, ndim, sclr, a, ia, ja, desca, sclr, c, ic,
2433 ELSE IF( scode.EQ.38 )
THEN
2435 CALL subptr( side, uplo, transa, diag, mdim, ndim, sclr, a, ia,
2436 $ ja, desca, b, ib, jb, descb )
2438 ELSE IF( scode.EQ.39 )
THEN
2440 CALL subptr( transa, mdim, ndim, sclr, a, ia, ja, desca, sclr,
2441 $ c, ic, jc, descc )
2443 ELSE IF( scode.EQ.40 )
THEN
2445 CALL subptr( uplo, transa, mdim, ndim, sclr, a, ia, ja, desca,
2446 $ sclr, c, ic, jc, descc )
2455 SUBROUTINE pderrset( ERR, ERRMAX, XTRUE, X )
2463 DOUBLE PRECISION ERR, ERRMAX, X, XTRUE
2557 DOUBLE PRECISION PDDIFF
2565 err = abs( pddiff( xtrue, x ) )
2567 errmax =
max( errmax, err )
2574 SUBROUTINE pdchkvin( ERRMAX, N, X, PX, IX, JX, DESCX, INCX,
2583 INTEGER INCX, INFO, IX, JX, N
2584 DOUBLE PRECISION ERRMAX
2588 DOUBLE PRECISION PX( * ), X( * )
2712 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2713 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2715 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
2716 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2717 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2718 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2719 DOUBLE PRECISION ZERO
2720 PARAMETER ( ZERO = 0.0d+0 )
2723 LOGICAL COLREP, ROWREP
2724 INTEGER I, IB, ICTXT, ICURCOL, ICURROW, IIX, IN, IXCOL,
2725 $ IXROW, J, JB, JJX, JN, KK, LDPX, LDX, LL,
2726 $ MYCOL, MYROW, NPCOL, NPROW
2727 DOUBLE PRECISION ERR, EPS
2733 DOUBLE PRECISION PDLAMCH
2737 INTRINSIC abs,
max,
min, mod
2749 ictxt = descx( ctxt_ )
2750 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2752 eps = pdlamch( ictxt,
'eps' )
2754 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix,
2755 $ jjx, ixrow, ixcol )
2758 ldpx = descx( lld_ )
2759 rowrep = ( ixrow.EQ.-1 )
2760 colrep = ( ixcol.EQ.-1 )
2764 IF( ( myrow.EQ.ixrow .OR. rowrep ) .AND.
2765 $ ( mycol.EQ.ixcol .OR. colrep ) )
2766 $
CALL pderrset( err, errmax, x( ix+(jx-1)*ldx ),
2767 $ px( iix+(jjx-1)*ldpx ) )
2769 ELSE IF( incx.EQ.descx( m_ ) )
THEN
2773 jb = descx( inb_ ) - jx + 1
2775 $ jb = ( ( -jb ) / descx( nb_ ) + 1 ) * descx( nb_ ) + jb
2779 IF( myrow.EQ.ixrow .OR. rowrep )
THEN
2782 IF( mycol.EQ.icurcol .OR. colrep )
THEN
2784 CALL pderrset( err, errmax, x( ix+(j-1)*ldx ),
2785 $ px( iix+(jjx-1)*ldpx ) )
2789 icurcol = mod( icurcol+1, npcol )
2791 DO 30 j = jn+1, jx+n-1, descx( nb_ )
2792 jb =
min( jx+n-j, descx( nb_ ) )
2794 IF( mycol.EQ.icurcol .OR. colrep )
THEN
2797 CALL pderrset( err, errmax, x( ix+(j+kk-1)*ldx ),
2798 $ px( iix+(jjx+kk-1)*ldpx ) )
2805 icurcol = mod( icurcol+1, npcol )
2815 ib = descx( imb_ ) - ix + 1
2817 $ ib = ( ( -ib ) / descx( mb_ ) + 1 ) * descx( mb_ ) + ib
2821 IF( mycol.EQ.ixcol .OR. colrep )
THEN
2824 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
2826 CALL pderrset( err, errmax, x( i+(jx-1)*ldx ),
2827 $ px( iix+(jjx-1)*ldpx ) )
2831 icurrow = mod( icurrow+1, nprow )
2833 DO 60 i = in+1, ix+n-1, descx( mb_ )
2834 ib =
min( ix+n-i, descx( mb_ ) )
2836 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
2839 CALL pderrset( err, errmax, x( i+kk+(jx-1)*ldx ),
2840 $ px( iix+kk+(jjx-1)*ldpx ) )
2847 icurrow = mod( icurrow+1, nprow )
2855 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
2858 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
2860 ELSE IF( errmax.GT.eps )
THEN
2869 SUBROUTINE pdchkvout( N, X, PX, IX, JX, DESCX, INCX, INFO )
2877 INTEGER INCX, INFO, IX, JX, N
2881 DOUBLE PRECISION PX( * ), X( * )
3001 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3002 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3004 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3005 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3006 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3007 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3008 DOUBLE PRECISION ZERO
3009 PARAMETER ( ZERO = 0.0d+0 )
3012 LOGICAL COLREP, ROWREP
3013 INTEGER I, IB, ICTXT, ICURCOL, ICURROW, II, IMBX, INBX,
3014 $ J, JB, JJ, KK, LDPX, LDX, LL, MBX, MPALL,
3015 $ MYCOL, MYCOLDIST, MYROW, MYROWDIST, NBX, NPCOL,
3017 DOUBLE PRECISION EPS, ERR, ERRMAX
3020 EXTERNAL BLACS_GRIDINFO, DGAMX2D, PDERRSET
3024 DOUBLE PRECISION PDLAMCH
3025 EXTERNAL PDLAMCH, PB_NUMROC
3028 INTRINSIC abs,
max,
min, mod
3037 IF( ( descx( m_ ).LE.0 ).OR.( descx( n_ ).LE.0 ) )
3042 ictxt = descx( ctxt_ )
3043 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3045 eps = pdlamch( ictxt,
'eps' )
3047 mpall = pb_numroc( descx( m_ ), 1, descx( imb_ ), descx( mb_ ),
3048 $ myrow, descx( rsrc_ ), nprow )
3049 nqall = pb_numroc( descx( n_ ), 1, descx( inb_ ), descx( nb_ ),
3050 $ mycol, descx( csrc_ ), npcol )
3055 ldpx = descx( lld_ )
3056 icurrow = descx( rsrc_ )
3057 icurcol = descx( csrc_ )
3058 rowrep = ( icurrow.EQ.-1 )
3059 colrep = ( icurcol.EQ.-1 )
3060 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3061 imbx = descx( imb_ )
3065 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3066 inbx = descx( inb_ )
3073 myrowdist = mod( myrow - icurrow + nprow, nprow )
3078 mycoldist = mod( mycol - icurcol + npcol, npcol )
3083 IF( incx.EQ.descx( m_ ) )
THEN
3087 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3090 IF( mycoldist.EQ.0 )
THEN
3093 j = descx( inb_ ) + ( mycoldist - 1 ) * nbx + 1
3095 jb =
min(
max( 0, descx( n_ ) - j + 1 ), inbx )
3096 ib =
min( descx( m_ ), descx( imb_ ) )
3100 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR. j+kk.GT.jx+n-1 )
3101 $
CALL pderrset( err, errmax,
3102 $ x( i+ll+(j+kk-1)*ldx ),
3103 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3109 j = j + inbx + ( npcol - 1 ) * nbx
3112 DO 50 jj = inbx+1, nqall, nbx
3113 jb =
min( nqall-jj+1, nbx )
3117 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3119 $
CALL pderrset( err, errmax,
3120 $ x( i+ll+(j+kk-1)*ldx ),
3121 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3137 icurrow = mod( icurrow + 1, nprow )
3139 DO 110 i = descx( imb_ ) + 1, descx( m_ ), mbx
3140 ib =
min( descx( m_ ) - i + 1, mbx )
3142 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3144 IF( mycoldist.EQ.0 )
THEN
3147 j = descx( inb_ ) + ( mycoldist - 1 ) * nbx + 1
3151 jb =
min(
max( 0, descx( n_ ) - j + 1 ), inbx )
3154 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3156 $
CALL pderrset( err, errmax,
3157 $ x( i+ll+(j+kk-1)*ldx ),
3158 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3164 j = j + inbx + ( npcol - 1 ) * nbx
3167 DO 100 jj = inbx+1, nqall, nbx
3168 jb =
min( nqall-jj+1, nbx )
3172 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3174 $
CALL pderrset( err, errmax,
3175 $ x( i+ll+(j+kk-1)*ldx ),
3176 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3192 icurrow = mod( icurrow + 1, nprow )
3200 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3203 IF( myrowdist.EQ.0 )
THEN
3206 i = descx( imb_ ) + ( myrowdist - 1 ) * mbx + 1
3208 ib =
min(
max( 0, descx( m_ ) - i + 1 ), imbx )
3209 jb =
min( descx( n_ ), descx( inb_ ) )
3213 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR. i+ll.GT.ix+n-1 )
3214 $
CALL pderrset( err, errmax,
3215 $ x( i+ll+(j+kk-1)*ldx ),
3216 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3222 i = i + imbx + ( nprow - 1 ) * mbx
3225 DO 160 ii = imbx+1, mpall, mbx
3226 ib =
min( mpall-ii+1, mbx )
3230 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3232 $
CALL pderrset( err, errmax,
3233 $ x( i+ll+(j+kk-1)*ldx ),
3234 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3250 icurcol = mod( icurcol + 1, npcol )
3252 DO 220 j = descx( inb_ ) + 1, descx( n_ ), nbx
3253 jb =
min( descx( n_ ) - j + 1, nbx )
3255 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3257 IF( myrowdist.EQ.0 )
THEN
3260 i = descx( imb_ ) + ( myrowdist - 1 ) * mbx + 1
3264 ib =
min(
max( 0, descx( m_ ) - i + 1 ), imbx )
3267 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3269 $
CALL pderrset( err, errmax,
3270 $ x( i+ll+(j+kk-1)*ldx ),
3271 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3277 i = i + imbx + ( nprow - 1 ) * mbx
3280 DO 210 ii = imbx+1, mpall, mbx
3281 ib =
min( mpall-ii+1, mbx )
3285 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3287 $
CALL pderrset( err, errmax,
3288 $ x( i+ll+(j+kk-1)*ldx ),
3289 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3305 icurcol = mod( icurcol + 1, npcol )
3311 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3314 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3316 ELSE IF( errmax.GT.eps )
THEN
3325 SUBROUTINE pdchkmin( ERRMAX, M, N, A, PA, IA, JA, DESCA, INFO )
3333 INTEGER IA, INFO, JA, M, N
3334 DOUBLE PRECISION ERRMAX
3338 DOUBLE PRECISION PA( * ), A( * )
3461 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3462 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3464 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3465 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3466 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3467 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3468 DOUBLE PRECISION ZERO
3469 PARAMETER ( ZERO = 0.0d+0 )
3472 LOGICAL COLREP, ROWREP
3473 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
3474 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
3475 $ KK, LDA, LDPA, LL, MYCOL, MYROW, NPCOL, NPROW
3476 DOUBLE PRECISION ERR, EPS
3482 DOUBLE PRECISION PDLAMCH
3486 INTRINSIC abs,
max,
min, mod
3495 IF( ( m.EQ.0 ).OR.( n.EQ.0 ) )
3500 ictxt = desca( ctxt_ )
3501 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3503 eps = pdlamch( ictxt,
'eps' )
3505 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia,
3506 $ jja, iarow, iacol )
3511 ldpa = desca( lld_ )
3514 rowrep = ( iarow.EQ.-1 )
3515 colrep = ( iacol.EQ.-1 )
3519 jb = desca( inb_ ) - ja + 1
3521 $ jb = ( ( -jb ) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
3525 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3528 ib = desca( imb_ ) - ia + 1
3530 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
3533 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3535 CALL pderrset( err, errmax, a( ia+k+(ja+h-1)*lda ),
3536 $ pa( ii+k+(jj+h-1)*ldpa ) )
3540 icurrow = mod( icurrow+1, nprow )
3544 DO 30 i = in+1, ia+m-1, desca( mb_ )
3545 ib =
min( desca( mb_ ), ia+m-i )
3546 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3548 CALL pderrset( err, errmax, a( i+k+(ja+h-1)*lda ),
3549 $ pa( ii+k+(jj+h-1)*ldpa ) )
3553 icurrow = mod( icurrow+1, nprow )
3564 icurcol = mod( icurcol+1, npcol )
3568 DO 90 j = jn+1, ja+n-1, desca( nb_ )
3569 jb =
min( desca( nb_ ), ja+n-j )
3570 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3572 ib = desca( imb_ ) - ia + 1
3574 $ ib = ( ( -ib ) / desca( mb_ ) + 1 )*desca( mb_ ) + ib
3577 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3579 CALL pderrset( err, errmax, a( ia+k+(j+h-1)*lda ),
3580 $ pa( ii+k+(jj+h-1)*ldpa ) )
3584 icurrow = mod( icurrow+1, nprow )
3588 DO 70 i = in+1, ia+m-1, desca( mb_ )
3589 ib =
min( desca( mb_ ), ia+m-i )
3590 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3593 $ a( i+k+(j+h-1)*lda ),
3594 $ pa( ii+k+(jj+h-1)*ldpa ) )
3598 icurrow = mod( icurrow+1, nprow )
3608 icurcol = mod( icurcol+1, npcol )
3612 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3615 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3617 ELSE IF( errmax.GT.eps )
THEN
3626 SUBROUTINE pdchkmout( M, N, A, PA, IA, JA, DESCA, INFO )
3634 INTEGER IA, INFO, JA, M, N
3638 DOUBLE PRECISION A( * ), PA( * )
3757 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3758 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3760 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3761 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3762 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3763 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3764 DOUBLE PRECISION ZERO
3765 PARAMETER ( ZERO = 0.0d+0 )
3768 LOGICAL COLREP, ROWREP
3769 INTEGER I, IB, ICTXT, ICURCOL, II, IMBA, J, JB, JJ, KK,
3770 $ LDA, LDPA, LL, MPALL, MYCOL, MYROW, MYROWDIST,
3772 DOUBLE PRECISION EPS, ERR, ERRMAX
3775 EXTERNAL blacs_gridinfo, dgamx2d,
pderrset
3779 DOUBLE PRECISION PDLAMCH
3780 EXTERNAL PDLAMCH, PB_NUMROC
3792 IF( ( desca( m_ ).LE.0 ).OR.( desca( n_ ).LE.0 ) )
3797 ictxt = desca( ctxt_ )
3798 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3800 eps = pdlamch( ictxt,
'eps' )
3802 mpall = pb_numroc( desca( m_ ), 1, desca( imb_ ), desca( mb_ ),
3803 $ myrow, desca( rsrc_ ), nprow )
3806 ldpa = desca( lld_ )
3810 rowrep = ( desca( rsrc_ ).EQ.-1 )
3811 colrep = ( desca( csrc_ ).EQ.-1 )
3812 icurcol = desca( csrc_ )
3813 IF( myrow.EQ.desca( rsrc_ ) .OR. rowrep )
THEN
3814 imba = desca( imb_ )
3821 myrowdist = mod( myrow - desca( rsrc_ ) + nprow, nprow )
3824 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3827 IF( myrowdist.EQ.0 )
THEN
3830 i = desca( imb_ ) + ( myrowdist - 1 ) * desca( mb_ ) + 1
3832 ib =
min(
max( 0, desca( m_ ) - i + 1 ), imba )
3833 jb =
min( desca( n_ ), desca( inb_ ) )
3837 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3838 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3839 $
CALL pderrset( err, errmax, a( i+ll+(j+kk-1)*lda ),
3840 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3846 i = i + imba + ( nprow - 1 ) * desca( mb_ )
3849 DO 50 ii = imba + 1, mpall, desca( mb_ )
3850 ib =
min( mpall-ii+1, desca( mb_ ) )
3854 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3855 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3857 $ a( i+ll+(j+kk-1)*lda ),
3858 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3863 i = i + desca( mb_ )
3865 i = i + nprow * desca( mb_ )
3874 icurcol = mod( icurcol + 1, npcol )
3876 DO 110 j = desca( inb_ ) + 1, desca( n_ ), desca( nb_ )
3877 jb =
min( desca( n_ ) - j + 1, desca( nb_ ) )
3879 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3881 IF( myrowdist.EQ.0 )
THEN
3884 i = desca( imb_ ) + ( myrowdist - 1 ) * desca( mb_ ) + 1
3888 ib =
min(
max( 0, desca( m_ ) - i + 1 ), imba )
3891 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3892 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3894 $ a( i+ll+(j+kk-1)*lda ),
3895 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3901 i = i + imba + ( nprow - 1 ) * desca( mb_ )
3904 DO 100 ii = imba+1, mpall, desca( mb_ )
3905 ib =
min( mpall-ii+1, desca( mb_ ) )
3909 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3910 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3912 $ a( i+ll+(j+kk-1)*lda ),
3913 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3918 i = i + desca( mb_ )
3920 i = i + nprow * desca( mb_ )
3929 icurcol = mod( icurcol + 1, npcol )
3933 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3936 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3938 ELSE IF( errmax.GT.eps )
THEN
3947 SUBROUTINE pdmprnt( ICTXT, NOUT, M, N, A, LDA, IRPRNT, ICPRNT,
3956 INTEGER ICPRNT, ICTXT, IRPRNT, LDA, M, N, NOUT
3959 CHARACTER*(*) CMATNM
3960 DOUBLE PRECISION A( LDA, * )
4016 INTEGER I, J, MYCOL, MYROW, NPCOL, NPROW
4019 EXTERNAL BLACS_GRIDINFO
4025 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
4030 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4032 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
4034 WRITE( nout, fmt = * )
4039 WRITE( nout, fmt = 9999 ) cmatnm, i, j, a( i, j )
4047 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', d30.18 )
4054 SUBROUTINE pdvprnt( ICTXT, NOUT, N, X, INCX, IRPRNT, ICPRNT,
4063 INTEGER ICPRNT, ICTXT, INCX, IRPRNT, N, NOUT
4066 CHARACTER*(*) CVECNM
4067 DOUBLE PRECISION X( * )
4120 INTEGER I, MYCOL, MYROW, NPCOL, NPROW
4123 EXTERNAL BLACS_GRIDINFO
4134 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4136 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
4138 WRITE( nout, fmt = * )
4139 DO 10 i = 1, 1 + ( n-1 )*incx, incx
4141 WRITE( nout, fmt = 9999 ) cvecnm, i, x( i )
4147 9999
FORMAT( 1x, a,
'(', i6,
')=', d30.18 )
4154 SUBROUTINE pdmvch( ICTXT, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
4155 $ X, IX, JX, DESCX, INCX, BETA, Y, PY, IY, JY,
4156 $ DESCY, INCY, G, ERR, INFO )
4165 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4167 DOUBLE PRECISION ALPHA, BETA, ERR
4170 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4171 DOUBLE PRECISION A( * ), G( * ), PY( * ), X( * ), Y( * )
4350 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
4351 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
4353 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
4354 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
4355 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
4356 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
4357 DOUBLE PRECISION ZERO, ONE
4358 parameter( zero = 0.0d+0, one = 1.0d+0 )
4361 LOGICAL COLREP, ROWREP, TRAN
4362 INTEGER I, IB, ICURCOL, ICURROW, IIY, IN, IOFFA, IOFFX,
4363 $ IOFFY, IYCOL, IYROW, J, JB, JJY, JN, KK, LDA,
4364 $ LDPY, LDX, LDY, ML, MYCOL, MYROW, NL, NPCOL,
4366 DOUBLE PRECISION EPS, ERRI, GTMP, TBETA, YTMP
4369 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
4373 DOUBLE PRECISION PDLAMCH
4374 EXTERNAL lsame, pdlamch
4377 INTRINSIC abs,
max,
min, mod, sqrt
4381 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4383 eps = pdlamch( ictxt,
'eps' )
4385 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
4391 tran = lsame( trans,
'T' ).OR.lsame( trans,
'C' )
4400 lda =
max( 1, desca( m_ ) )
4401 ldx =
max( 1, descx( m_ ) )
4402 ldy =
max( 1, descy( m_ ) )
4408 ioffy = iy + ( jy - 1 ) * ldy
4412 ioffx = ix + ( jx - 1 ) * ldx
4414 ioffa = ia + ( ja + i - 2 ) * lda
4416 ytmp = ytmp + a( ioffa ) * x( ioffx )
4417 gtmp = gtmp + abs( a( ioffa ) * x( ioffx ) )
4419 ioffx = ioffx + incx
4422 ioffa = ia + i - 1 + ( ja - 1 ) * lda
4424 ytmp = ytmp + a( ioffa ) * x( ioffx )
4425 gtmp = gtmp + abs( a( ioffa ) * x( ioffx ) )
4427 ioffx = ioffx + incx
4430 g( i ) = abs( alpha ) * gtmp + abs( tbeta * y( ioffy ) )
4431 y( ioffy ) = alpha * ytmp + tbeta * y( ioffy )
4432 ioffy = ioffy + incy
4439 ldpy = descy( lld_ )
4440 ioffy = iy + ( jy - 1 ) * ldy
4441 CALL pb_infog2l( iy, jy, descy, nprow, npcol, myrow, mycol, iiy,
4442 $ jjy, iyrow, iycol )
4445 rowrep = ( iyrow.EQ.-1 )
4446 colrep = ( iycol.EQ.-1 )
4448 IF( incy.EQ.descy( m_ ) )
THEN
4452 jb = descy( inb_ ) - jy + 1
4454 $ jb = ( ( -jb ) / descy( nb_ ) + 1 ) * descy( nb_ ) + jb
4460 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4461 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4462 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) ) / eps
4463 IF( g( j-jy+1 ).NE.zero )
4464 $ erri = erri / g( j-jy+1 )
4465 err =
max( err, erri )
4466 IF( err*sqrt( eps ).GE.one )
4471 ioffy = ioffy + incy
4475 icurcol = mod( icurcol+1, npcol )
4477 DO 70 j = jn+1, jy+ml-1, descy( nb_ )
4478 jb =
min( jy+ml-j, descy( nb_ ) )
4482 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4483 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4484 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) )/eps
4485 IF( g( j+kk-jy+1 ).NE.zero )
4486 $ erri = erri / g( j+kk-jy+1 )
4487 err =
max( err, erri )
4488 IF( err*sqrt( eps ).GE.one )
4493 ioffy = ioffy + incy
4497 icurcol = mod( icurcol+1, npcol )
4505 ib = descy( imb_ ) - iy + 1
4507 $ ib = ( ( -ib ) / descy( mb_ ) + 1 ) * descy( mb_ ) + ib
4513 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4514 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4515 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) ) / eps
4516 IF( g( i-iy+1 ).NE.zero )
4517 $ erri = erri / g( i-iy+1 )
4518 err =
max( err, erri )
4519 IF( err*sqrt( eps ).GE.one )
4524 ioffy = ioffy + incy
4528 icurrow = mod( icurrow+1, nprow )
4530 DO 100 i = in+1, iy+ml-1, descy( mb_ )
4531 ib =
min( iy+ml-i, descy( mb_ ) )
4535 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4536 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4537 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) )/eps
4538 IF( g( i+kk-iy+1 ).NE.zero )
4539 $ erri = erri / g( i+kk-iy+1 )
4540 err =
max( err, erri )
4541 IF( err*sqrt( eps ).GE.one )
4546 ioffy = ioffy + incy
4550 icurrow = mod( icurrow+1, nprow )
4558 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
4559 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4567 SUBROUTINE pdvmch( ICTXT, UPLO, M, N, ALPHA, X, IX, JX, DESCX,
4568 $ INCX, Y, IY, JY, DESCY, INCY, A, PA, IA, JA,
4569 $ DESCA, G, ERR, INFO )
4578 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4580 DOUBLE PRECISION ALPHA, ERR
4583 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4584 DOUBLE PRECISION A( * ), G( * ), PA( * ), X( * ), Y( * )
4759 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
4760 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
4762 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
4763 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
4764 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
4765 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
4766 DOUBLE PRECISION ZERO, ONE
4767 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
4770 LOGICAL COLREP, LOWER, ROWREP, UPPER
4771 INTEGER I, IACOL, IAROW, IB, IBEG, ICURROW, IEND, IIA,
4772 $ in, ioffa, ioffx, ioffy, j, jja, kk, lda, ldpa,
4773 $ ldx, ldy, mycol, myrow, npcol, nprow
4774 DOUBLE PRECISION ATMP, EPS, ERRI, GTMP
4777 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
4781 DOUBLE PRECISION PDLAMCH
4782 EXTERNAL LSAME, PDLAMCH
4785 INTRINSIC abs,
max,
min, mod, sqrt
4789 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4791 eps = pdlamch( ictxt,
'eps' )
4793 upper = lsame( uplo,
'U' )
4794 lower = lsame( uplo,
'L' )
4796 lda =
max( 1, desca( m_ ) )
4797 ldx =
max( 1, descx( m_ ) )
4798 ldy =
max( 1, descy( m_ ) )
4806 ioffy = iy + ( jy - 1 ) * ldy + ( j - 1 ) * incy
4814 ELSE IF( upper )
THEN
4825 DO 30 i = ibeg, iend
4827 ioffx = ix + ( jx - 1 ) * ldx + ( i - 1 ) * incx
4828 ioffa = ia + i - 1 + ( ja + j - 2 ) * lda
4829 atmp = x( ioffx ) * y( ioffy )
4830 gtmp = abs( x( ioffx ) * y( ioffy ) )
4831 g( i ) = abs( alpha ) * gtmp + abs( a( ioffa ) )
4832 a( ioffa ) = alpha * atmp + a( ioffa )
4840 ldpa = desca( lld_ )
4841 ioffa = ia + ( ja + j - 2 ) * lda
4842 CALL pb_infog2l( ia, ja+j-1, desca, nprow, npcol, myrow, mycol,
4843 $ iia, jja, iarow, iacol )
4844 rowrep = ( iarow.EQ.-1 )
4845 colrep = ( iacol.EQ.-1 )
4847 IF( mycol.EQ.iacol .OR. colrep )
THEN
4850 ib = desca( imb_ ) - ia + 1
4852 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
4858 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
4859 erri = abs( pa( iia+(jja-1)*ldpa ) - a( ioffa ) )/eps
4860 IF( g( i-ia+1 ).NE.zero )
4861 $ erri = erri / g( i-ia+1 )
4862 err =
max( err, erri )
4863 IF( err*sqrt( eps ).GE.one )
4872 icurrow = mod( icurrow+1, nprow )
4874 DO 60 i = in+1, ia+m-1, desca( mb_ )
4875 ib =
min( ia+m-i, desca( mb_ ) )
4879 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
4880 erri = abs( pa( iia+(jja-1)*ldpa )-a( ioffa ) )/eps
4881 IF( g( i+kk-ia+1 ).NE.zero )
4882 $ erri = erri / g( i+kk-ia+1 )
4883 err =
max( err, erri )
4884 IF( err*sqrt( eps ).GE.one )
4893 icurrow = mod( icurrow+1, nprow )
4901 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
4902 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4916 SUBROUTINE pdvmch2( ICTXT, UPLO, M, N, ALPHA, X, IX, JX, DESCX,
4917 $ INCX, Y, IY, JY, DESCY, INCY, A, PA, IA,
4918 $ JA, DESCA, G, ERR, INFO )
4927 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4929 DOUBLE PRECISION ALPHA, ERR
4932 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4933 DOUBLE PRECISION A( * ), G( * ), PA( * ), X( * ), Y( * )
5108 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5109 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5111 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5112 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5113 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5114 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5115 DOUBLE PRECISION ZERO, ONE
5116 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
5119 LOGICAL COLREP, LOWER, ROWREP, UPPER
5120 INTEGER I, IACOL, IAROW, IB, IBEG, ICURROW, IEND, IIA,
5121 $ IN, IOFFA, IOFFXI, IOFFXJ, IOFFYI, IOFFYJ, J,
5122 $ JJA, KK, LDA, LDPA, LDX, LDY, MYCOL, MYROW,
5124 DOUBLE PRECISION EPS, ERRI, GTMP, ATMP
5127 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
5131 DOUBLE PRECISION PDLAMCH
5132 EXTERNAL lsame, pdlamch
5135 INTRINSIC abs,
max,
min, mod, sqrt
5139 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5141 eps = pdlamch( ictxt,
'eps' )
5143 upper = lsame( uplo,
'U' )
5144 lower = lsame( uplo,
'L' )
5146 lda =
max( 1, desca( m_ ) )
5147 ldx =
max( 1, descx( m_ ) )
5148 ldy =
max( 1, descy( m_ ) )
5156 ioffxj = ix + ( jx - 1 ) * ldx + ( j - 1 ) * incx
5157 ioffyj = iy + ( jy - 1 ) * ldy + ( j - 1 ) * incy
5165 ELSE IF( upper )
THEN
5176 DO 30 i = ibeg, iend
5177 ioffa = ia + i - 1 + ( ja + j - 2 ) * lda
5178 ioffxi = ix + ( jx - 1 ) * ldx + ( i - 1 ) * incx
5179 ioffyi = iy + ( jy - 1 ) * ldy + ( i - 1 ) * incy
5180 atmp = x( ioffxi ) * y( ioffyj )
5181 atmp = atmp + y( ioffyi ) * x( ioffxj )
5182 gtmp = abs( x( ioffxi ) * y( ioffyj ) )
5183 gtmp = gtmp + abs( y( ioffyi ) * x( ioffxj ) )
5184 g( i ) = abs( alpha ) * gtmp + abs( a( ioffa ) )
5185 a( ioffa ) = alpha*atmp + a( ioffa )
5193 ldpa = desca( lld_ )
5194 ioffa = ia + ( ja + j - 2 ) * lda
5195 CALL pb_infog2l( ia, ja+j-1, desca, nprow, npcol, myrow, mycol,
5196 $ iia, jja, iarow, iacol )
5197 rowrep = ( iarow.EQ.-1 )
5198 colrep = ( iacol.EQ.-1 )
5200 IF( mycol.EQ.iacol .OR. colrep )
THEN
5203 ib = desca( imb_ ) - ia + 1
5205 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
5211 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5212 erri = abs( pa( iia+(jja-1)*ldpa ) - a( ioffa ) )/eps
5213 IF( g( i-ia+1 ).NE.zero )
5214 $ erri = erri / g( i-ia+1 )
5215 err =
max( err, erri )
5216 IF( err*sqrt( eps ).GE.one )
5225 icurrow = mod( icurrow+1, nprow )
5227 DO 60 i = in+1, ia+m-1, desca( mb_ )
5228 ib =
min( ia+m-i, desca( mb_ ) )
5232 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5233 erri = abs( pa( iia+(jja-1)*ldpa )-a( ioffa ) )/eps
5234 IF( g( i+kk-ia+1 ).NE.zero )
5235 $ erri = erri / g( i+kk-ia+1 )
5236 err =
max( err, erri )
5237 IF( err*sqrt( eps ).GE.one )
5246 icurrow = mod( icurrow+1, nprow )
5254 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5255 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5269 SUBROUTINE pdmmch( ICTXT, TRANSA, TRANSB, M, N, K, ALPHA, A, IA,
5270 $ JA, DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
5271 $ JC, DESCC, CT, G, ERR, INFO )
5279 CHARACTER*1 TRANSA, TRANSB
5280 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, M, N
5281 DOUBLE PRECISION ALPHA, BETA, ERR
5284 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
5285 DOUBLE PRECISION A( * ), B( * ), C( * ), CT( * ), G( * ),
5462 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5463 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5465 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5466 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5467 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5468 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5469 DOUBLE PRECISION ZERO, ONE
5470 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
5473 LOGICAL COLREP, ROWREP, TRANA, TRANB
5474 INTEGER I, IBB, ICCOL, ICROW, ICURROW, IIC, IN, IOFFA,
5475 $ IOFFB, IOFFC, J, JJC, KK, LDA, LDB, LDC, LDPC,
5476 $ mycol, myrow, npcol, nprow
5477 DOUBLE PRECISION EPS, ERRI
5480 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
5484 DOUBLE PRECISION PDLAMCH
5485 EXTERNAL LSAME, PDLAMCH
5488 INTRINSIC abs,
max,
min, mod, sqrt
5492 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5494 eps = pdlamch( ictxt,
'eps' )
5496 trana = lsame( transa,
'T' ).OR.lsame( transa,
'C' )
5497 tranb = lsame( transb,
'T' ).OR.lsame( transb,
'C' )
5499 lda =
max( 1, desca( m_ ) )
5500 ldb =
max( 1, descb( m_ ) )
5501 ldc =
max( 1, descc( m_ ) )
5509 ioffc = ic + ( jc + j - 2 ) * ldc
5515 IF( .NOT.trana .AND. .NOT.tranb )
THEN
5517 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5519 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5520 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5521 g( i ) = g( i ) + abs( a( ioffa ) ) *
5525 ELSE IF( trana .AND. .NOT.tranb )
THEN
5527 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5529 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5530 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5531 g( i ) = g( i ) + abs( a( ioffa ) ) *
5535 ELSE IF( .NOT.trana .AND. tranb )
THEN
5537 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5539 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5540 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5541 g( i ) = g( i ) + abs( a( ioffa ) ) *
5545 ELSE IF( trana .AND. tranb )
THEN
5547 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5549 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5550 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5551 g( i ) = g( i ) + abs( a( ioffa ) ) *
5558 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
5559 g( i ) = abs( alpha )*g( i ) + abs( beta )*abs( c( ioffc ) )
5560 c( ioffc ) = ct( i )
5568 ldpc = descc( lld_ )
5569 ioffc = ic + ( jc + j - 2 ) * ldc
5570 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
5571 $ iic, jjc, icrow, iccol )
5573 rowrep = ( icrow.EQ.-1 )
5574 colrep = ( iccol.EQ.-1 )
5576 IF( mycol.EQ.iccol .OR. colrep )
THEN
5578 ibb = descc( imb_ ) - ic + 1
5580 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
5586 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5587 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5588 $ c( ioffc ) ) / eps
5589 IF( g( i-ic+1 ).NE.zero )
5590 $ erri = erri / g( i-ic+1 )
5591 err =
max( err, erri )
5592 IF( err*sqrt( eps ).GE.one )
5601 icurrow = mod( icurrow+1, nprow )
5603 DO 230 i = in+1, ic+m-1, descc( mb_ )
5604 ibb =
min( ic+m-i, descc( mb_ ) )
5606 DO 220 kk = 0, ibb-1
5608 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5609 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5611 IF( g( i+kk-ic+1 ).NE.zero )
5612 $ erri = erri / g( i+kk-ic+1 )
5613 err =
max( err, erri )
5614 IF( err*sqrt( eps ).GE.one )
5623 icurrow = mod( icurrow+1, nprow )
5631 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5632 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5646 SUBROUTINE pdmmch1( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
5647 $ DESCA, BETA, C, PC, IC, JC, DESCC, CT, G,
5656 CHARACTER*1 TRANS, UPLO
5657 INTEGER IA, IC, ICTXT, INFO, JA, JC, K, N
5658 DOUBLE PRECISION ALPHA, BETA, ERR
5661 INTEGER DESCA( * ), DESCC( * )
5662 DOUBLE PRECISION A( * ), C( * ), CT( * ), G( * ), PC( * )
5820 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5821 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5823 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5824 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5825 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5826 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5827 DOUBLE PRECISION ZERO, ONE
5828 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
5831 LOGICAL COLREP, NOTRAN, ROWREP, TRAN, UPPER
5832 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
5833 $ IN, IOFFAK, IOFFAN, IOFFC, J, JJC, KK, LDA,
5834 $ LDC, LDPC, MYCOL, MYROW, NPCOL, NPROW
5835 DOUBLE PRECISION EPS, ERRI
5838 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
5842 DOUBLE PRECISION PDLAMCH
5843 EXTERNAL lsame, pdlamch
5846 INTRINSIC abs,
max,
min, mod, sqrt
5850 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5852 eps = pdlamch( ictxt,
'eps' )
5854 upper = lsame( uplo,
'U' )
5855 notran = lsame( trans,
'N' )
5856 tran = lsame( trans,
'T' )
5858 lda =
max( 1, desca( m_ ) )
5859 ldc =
max( 1, descc( m_ ) )
5882 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
5883 DO 20 i = ibeg, iend
5884 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
5885 ct( i ) = ct( i ) + a( ioffak ) * a( ioffan )
5886 g( i ) = g( i ) + abs( a( ioffak ) ) *
5887 $ abs( a( ioffan ) )
5890 ELSE IF( tran )
THEN
5892 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
5893 DO 40 i = ibeg, iend
5894 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
5895 ct( i ) = ct( i ) + a( ioffak ) * a( ioffan )
5896 g( i ) = g( i ) + abs( a( ioffak ) ) *
5897 $ abs( a( ioffan ) )
5902 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
5904 DO 100 i = ibeg, iend
5905 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
5906 g( i ) = abs( alpha )*g( i ) + abs( beta )*abs( c( ioffc ) )
5907 c( ioffc ) = ct( i )
5915 ldpc = descc( lld_ )
5916 ioffc = ic + ( jc + j - 2 ) * ldc
5917 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
5918 $ iic, jjc, icrow, iccol )
5920 rowrep = ( icrow.EQ.-1 )
5921 colrep = ( iccol.EQ.-1 )
5923 IF( mycol.EQ.iccol .OR. colrep )
THEN
5925 ibb = descc( imb_ ) - ic + 1
5927 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
5933 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5934 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5935 $ c( ioffc ) ) / eps
5936 IF( g( i-ic+1 ).NE.zero )
5937 $ erri = erri / g( i-ic+1 )
5938 err =
max( err, erri )
5939 IF( err*sqrt( eps ).GE.one )
5948 icurrow = mod( icurrow+1, nprow )
5950 DO 130 i = in+1, ic+n-1, descc( mb_ )
5951 ibb =
min( ic+n-i, descc( mb_ ) )
5953 DO 120 kk = 0, ibb-1
5955 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5956 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5958 IF( g( i+kk-ic+1 ).NE.zero )
5959 $ erri = erri / g( i+kk-ic+1 )
5960 err =
max( err, erri )
5961 IF( err*sqrt( eps ).GE.one )
5970 icurrow = mod( icurrow+1, nprow )
5978 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5979 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5993 SUBROUTINE pdmmch2( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
5994 $ DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
5995 $ JC, DESCC, CT, G, ERR, INFO )
6003 CHARACTER*1 TRANS, UPLO
6004 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, N
6005 DOUBLE PRECISION ALPHA, BETA, ERR
6008 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
6009 DOUBLE PRECISION A( * ), B( * ), C( * ), CT( * ), G( * ),
6185 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6186 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6188 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6189 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6190 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6191 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6192 DOUBLE PRECISION ZERO, ONE
6193 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
6196 LOGICAL COLREP, NOTRAN, ROWREP, TRAN, UPPER
6197 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
6198 $ IN, IOFFAK, IOFFAN, IOFFBK, IOFFBN, IOFFC, J,
6199 $ JJC, KK, LDA, LDB, LDC, LDPC, MYCOL, MYROW,
6201 DOUBLE PRECISION EPS, ERRI
6204 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
6208 DOUBLE PRECISION PDLAMCH
6209 EXTERNAL LSAME, PDLAMCH
6212 INTRINSIC abs,
max,
min, mod, sqrt
6216 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6218 eps = pdlamch( ictxt,
'eps' )
6220 upper = lsame( uplo,
'U' )
6221 notran = lsame( trans,
'N' )
6222 tran = lsame( trans,
'T' )
6224 lda =
max( 1, desca( m_ ) )
6225 ldb =
max( 1, descb( m_ ) )
6226 ldc =
max( 1, descc( m_ ) )
6249 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6250 ioffbk = ib + j - 1 + ( jb + kk - 2 ) * ldb
6251 DO 20 i = ibeg, iend
6252 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6253 ioffbn = ib + i - 1 + ( jb + kk - 2 ) * ldb
6254 ct( i ) = ct( i ) + alpha * (
6255 $ a( ioffan ) * b( ioffbk ) +
6256 $ b( ioffbn ) * a( ioffak ) )
6257 g( i ) = g( i ) + abs( alpha ) * (
6258 $ abs( a( ioffan ) ) * abs( b( ioffbk ) ) +
6259 $ abs( b( ioffbn ) ) * abs( a( ioffak ) ) )
6262 ELSE IF( tran )
THEN
6264 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6265 ioffbk = ib + kk - 1 + ( jb + j - 2 ) * ldb
6266 DO 40 i = ibeg, iend
6267 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6268 ioffbn = ib + kk - 1 + ( jb + i - 2 ) * ldb
6269 ct( i ) = ct( i ) + alpha * (
6270 $ a( ioffan ) * b( ioffbk ) +
6271 $ b( ioffbn ) * a( ioffak ) )
6272 g( i ) = g( i ) + abs( alpha ) * (
6273 $ abs( a( ioffan ) ) * abs( b( ioffbk ) ) +
6274 $ abs( b( ioffbn ) ) * abs( a( ioffak ) ) )
6279 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
6281 DO 100 i = ibeg, iend
6282 ct( i ) = ct( i ) + beta * c( ioffc )
6283 g( i ) = g( i ) + abs( beta )*abs( c( ioffc ) )
6284 c( ioffc ) = ct( i )
6292 ldpc = descc( lld_ )
6293 ioffc = ic + ( jc + j - 2 ) * ldc
6294 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
6295 $ iic, jjc, icrow, iccol )
6297 rowrep = ( icrow.EQ.-1 )
6298 colrep = ( iccol.EQ.-1 )
6300 IF( mycol.EQ.iccol .OR. colrep )
THEN
6302 ibb = descc( imb_ ) - ic + 1
6304 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
6310 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6311 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6312 $ c( ioffc ) ) / eps
6313 IF( g( i-ic+1 ).NE.zero )
6314 $ erri = erri / g( i-ic+1 )
6315 err =
max( err, erri )
6316 IF( err*sqrt( eps ).GE.one )
6325 icurrow = mod( icurrow+1, nprow )
6327 DO 130 i = in+1, ic+n-1, descc( mb_ )
6328 ibb =
min( ic+n-i, descc( mb_ ) )
6330 DO 120 kk = 0, ibb-1
6332 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6333 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6335 IF( g( i+kk-ic+1 ).NE.zero )
6336 $ erri = erri / g( i+kk-ic+1 )
6337 err =
max( err, erri )
6338 IF( err*sqrt( eps ).GE.one )
6347 icurrow = mod( icurrow+1, nprow )
6355 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6356 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6370 SUBROUTINE pdmmch3( UPLO, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
6371 $ BETA, C, PC, IC, JC, DESCC, ERR, INFO )
6379 CHARACTER*1 TRANS, UPLO
6380 INTEGER IA, IC, INFO, JA, JC, M, N
6381 DOUBLE PRECISION ALPHA, BETA, ERR
6384 INTEGER DESCA( * ), DESCC( * )
6385 DOUBLE PRECISION A( * ), C( * ), PC( * )
6528 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6529 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6531 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6532 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6533 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6534 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6535 DOUBLE PRECISION ZERO
6536 PARAMETER ( ZERO = 0.0d+0 )
6539 LOGICAL COLREP, LOWER, NOTRAN, ROWREP, UPPER
6540 INTEGER I, ICCOL, ICROW, ICTXT, IIC, IOFFA, IOFFC, J,
6541 $ JJC, LDA, LDC, LDPC, MYCOL, MYROW, NPCOL,
6543 DOUBLE PRECISION ERR0, ERRI, PREC
6546 EXTERNAL BLACS_GRIDINFO, DGAMX2D, IGSUM2D, PB_INFOG2L,
6551 DOUBLE PRECISION PDLAMCH
6552 EXTERNAL LSAME, PDLAMCH
6559 ictxt = descc( ctxt_ )
6560 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6562 prec = pdlamch( ictxt,
'eps' )
6564 upper = lsame( uplo,
'U' )
6565 lower = lsame( uplo,
'L' )
6566 notran = lsame( trans,
'N' )
6574 lda =
max( 1, desca( m_ ) )
6575 ldc =
max( 1, descc( m_ ) )
6576 ldpc =
max( 1, descc( lld_ ) )
6577 rowrep = ( descc( rsrc_ ).EQ.-1 )
6578 colrep = ( descc( csrc_ ).EQ.-1 )
6582 DO 20 j = jc, jc + n - 1
6584 ioffc = ic + ( j - 1 ) * ldc
6585 ioffa = ia + ( ja - 1 + j - jc ) * lda
6587 DO 10 i = ic, ic + m - 1
6590 IF( ( j - jc ).GE.( i - ic ) )
THEN
6591 CALL pderraxpby( erri, alpha, a( ioffa ), beta,
6592 $ c( ioffc ), prec )
6596 ELSE IF( lower )
THEN
6597 IF( ( j - jc ).LE.( i - ic ) )
THEN
6598 CALL pderraxpby( erri, alpha, a( ioffa ), beta,
6599 $ c( ioffc ), prec )
6604 CALL pderraxpby( erri, alpha, a( ioffa ), beta,
6605 $ c( ioffc ), prec )
6608 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6609 $ iic, jjc, icrow, iccol )
6610 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6611 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6612 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6615 err =
max( err, err0 )
6627 DO 40 j = jc, jc + n - 1
6629 ioffc = ic + ( j - 1 ) * ldc
6630 ioffa = ia + ( j - jc ) + ( ja - 1 ) * lda
6632 DO 30 i = ic, ic + m - 1
6635 IF( ( j - jc ).GE.( i - ic ) )
THEN
6636 CALL pderraxpby( erri, alpha, a( ioffa ), beta,
6637 $ c( ioffc ), prec )
6641 ELSE IF( lower )
THEN
6642 IF( ( j - jc ).LE.( i - ic ) )
THEN
6643 CALL pderraxpby( erri, alpha, a( ioffa ), beta,
6644 $ c( ioffc ), prec )
6649 CALL pderraxpby( erri, alpha, a( ioffa ), beta,
6650 $ c( ioffc ), prec )
6653 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6654 $ iic, jjc, icrow, iccol )
6655 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6656 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6657 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6660 err =
max( err, err0 )
6674 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6675 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6683 SUBROUTINE pderraxpby( ERRBND, ALPHA, X, BETA, Y, PREC )
6691 DOUBLE PRECISION ALPHA, BETA, ERRBND, PREC, X, Y
6729 DOUBLE PRECISION ONE, TWO, ZERO
6730 PARAMETER ( ONE = 1.0d+0, two = 2.0d+0,
6734 DOUBLE PRECISION ADDBND, FACT, SUMPOS, SUMNEG, TMP
6742 fact = one + two * prec
6743 addbnd = two * two * two * prec
6746 IF( tmp.GE.zero )
THEN
6747 sumpos = sumpos + tmp * fact
6749 sumneg = sumneg - tmp * fact
6753 IF( tmp.GE.zero )
THEN
6754 sumpos = sumpos + tmp * fact
6756 sumneg = sumneg - tmp * fact
6759 y = ( beta * y ) + ( alpha * x )
6761 errbnd = addbnd *
max( sumpos, sumneg )
6768 DOUBLE PRECISION FUNCTION pdlamch( ICTXT, CMACH )
6828 DOUBLE PRECISION temp
6831 EXTERNAL dgamn2d, dgamx2d, pb_topget
6843 IF(
lsame( cmach,
'E' ).OR.
lsame( cmach,
'S' ).OR.
6844 $
lsame( cmach,
'M' ).OR.
lsame( cmach,
'U' ) )
THEN
6845 CALL pb_topget( ictxt,
'Combine',
'All', top )
6846 CALL dgamx2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
6847 $ idumm, -1, -1, idumm )
6848 ELSE IF(
lsame( cmach,
'L' ).OR.
lsame( cmach,
'O' ) )
THEN
6849 CALL pb_topget( ictxt,
'Combine',
'All', top )
6850 CALL dgamn2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
6851 $ idumm, -1, -1, idumm )
6861 SUBROUTINE pdlaset( UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA )
6870 INTEGER IA, JA, M, N
6871 DOUBLE PRECISION ALPHA, BETA
6875 DOUBLE PRECISION A( * )
7006 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7007 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7009 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7010 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7011 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7012 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7015 LOGICAL GODOWN, GOLEFT, ISCOLREP, ISROWREP, LOWER,
7017 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
7018 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP, JJA,
7019 $ JJMAX, JOFFA, JOFFD, LCMT, LCMT00, LDA, LMBLOC,
7020 $ LNBLOC, LOW, M1, MB, MBLKD, MBLKS, MBLOC, MP,
7021 $ MRCOL, MRROW, MYCOL, MYROW, N1, NB, NBLKD,
7022 $ NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB, QNB, TMP1,
7026 INTEGER DESCA2( DLEN_ )
7041 IF( m.EQ.0 .OR. n.EQ.0 )
7050 ictxt = desca2( ctxt_ )
7051 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7053 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
7054 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
7055 $ iacol, mrrow, mrcol )
7057 IF( mp.LE.0 .OR. nq.LE.0 )
7060 isrowrep = ( desca2( rsrc_ ).LT.0 )
7061 iscolrep = ( desca2( csrc_ ).LT.0 )
7062 lda = desca2( lld_ )
7064 upper = .NOT.( lsame( uplo,
'L' ) )
7065 lower = .NOT.( lsame( uplo,
'U' ) )
7067 IF( ( ( lower.AND.upper ).AND.( alpha.EQ.beta ) ).OR.
7068 $ ( isrowrep .AND. iscolrep ) )
THEN
7069 IF( ( mp.GT.0 ).AND.( nq.GT.0 ) )
7070 $
CALL pb_dlaset( uplo, mp, nq, 0, alpha, beta,
7071 $ a( iia + ( jja - 1 ) * lda ), lda )
7080 CALL pb_binfo( 0, mp, nq, imb1, inb1, mb, nb, mrrow, mrcol,
7081 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
7082 $ lnbloc, ilow, low, iupp, upp )
7106 godown = ( lcmt00.GT.iupp )
7107 goleft = ( lcmt00.LT.ilow )
7109 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7113 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7114 godown = .NOT.goleft
7116 CALL pb_dlaset( uplo, imbloc, inbloc, lcmt00, alpha, beta,
7117 $ a( iia+joffa*lda ), lda )
7119 IF( upper .AND. nq.GT.inbloc )
7120 $
CALL pb_dlaset(
'All', imbloc, nq-inbloc, 0, alpha,
7121 $ alpha, a( iia+(joffa+inbloc)*lda ), lda )
7125 IF( lower .AND. mp.GT.imbloc )
7126 $
CALL pb_dlaset(
'All', mp-imbloc, inbloc, 0, alpha,
7127 $ alpha, a( iia+imbloc+joffa*lda ), lda )
7136 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7138 ioffa = ioffa + imbloc
7141 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7142 lcmt00 = lcmt00 - pmb
7148 tmp1 =
min( ioffa, iimax ) - iia + 1
7149 IF( upper .AND. tmp1.GT.0 )
THEN
7150 CALL pb_dlaset(
'All', tmp1, n1, 0, alpha, alpha,
7151 $ a( iia+joffa*lda ), lda )
7165 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7168 CALL pb_dlaset( uplo, mbloc, inbloc, lcmt, alpha, beta,
7169 $ a( ioffd+1+joffa*lda ), lda )
7175 ioffd = ioffd + mbloc
7179 tmp1 = m1 - ioffd + iia - 1
7180 IF( lower .AND. tmp1.GT.0 )
7181 $
CALL pb_dlaset(
'ALL', tmp1, inbloc, 0, alpha, alpha,
7182 $ a( ioffd+1+joffa*lda ), lda )
7184 tmp1 = ioffa - iia + 1
7187 lcmt00 = lcmt00 + low - ilow + qnb
7189 joffa = joffa + inbloc
7191 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7192 $
CALL pb_dlaset(
'ALL', tmp1, n1, 0, alpha, alpha,
7193 $ a( iia+joffa*lda ), lda )
7198 ELSE IF( goleft )
THEN
7200 lcmt00 = lcmt00 + low - ilow + qnb
7202 joffa = joffa + inbloc
7205 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7206 lcmt00 = lcmt00 + qnb
7212 tmp1 =
min( joffa, jjmax ) - jja + 1
7213 IF( lower .AND. tmp1.GT.0 )
THEN
7214 CALL pb_dlaset(
'All', m1, tmp1, 0, alpha, alpha,
7215 $ a( iia+(jja-1)*lda ), lda )
7229 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7232 CALL pb_dlaset( uplo, imbloc, nbloc, lcmt, alpha, beta,
7233 $ a( iia+joffd*lda ), lda )
7239 joffd = joffd + nbloc
7243 tmp1 = n1 - joffd + jja - 1
7244 IF( upper .AND. tmp1.GT.0 )
7245 $
CALL pb_dlaset(
'All', imbloc, tmp1, 0, alpha, alpha,
7246 $ a( iia+joffd*lda ), lda )
7248 tmp1 = joffa - jja + 1
7251 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7253 ioffa = ioffa + imbloc
7255 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
7256 $
CALL pb_dlaset(
'All', m1, tmp1, 0, alpha, alpha,
7257 $ a( ioffa+1+(jja-1)*lda ), lda )
7266 IF( nblks.GT.0 )
THEN
7270 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7271 lcmt00 = lcmt00 - pmb
7277 tmp1 =
min( ioffa, iimax ) - iia + 1
7278 IF( upper .AND. tmp1.GT.0 )
THEN
7279 CALL pb_dlaset(
'All', tmp1, n1, 0, alpha, alpha,
7280 $ a( iia+joffa*lda ), lda )
7294 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7297 CALL pb_dlaset( uplo, mbloc, nbloc, lcmt, alpha, beta,
7298 $ a( ioffd+1+joffa*lda ), lda )
7304 ioffd = ioffd + mbloc
7308 tmp1 = m1 - ioffd + iia - 1
7309 IF( lower .AND. tmp1.GT.0 )
7310 $
CALL pb_dlaset(
'All', tmp1, nbloc, 0, alpha, alpha,
7311 $ a( ioffd+1+joffa*lda ), lda )
7313 tmp1 =
min( ioffa, iimax ) - iia + 1
7316 lcmt00 = lcmt00 + qnb
7318 joffa = joffa + nbloc
7320 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7321 $
CALL pb_dlaset(
'All', tmp1, n1, 0, alpha, alpha,
7322 $ a( iia+joffa*lda ), lda )
7336 SUBROUTINE pdlascal( TYPE, M, N, ALPHA, A, IA, JA, DESCA )
7345 INTEGER IA, JA, M, N
7346 DOUBLE PRECISION ALPHA
7350 DOUBLE PRECISION A( * )
7471 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7472 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7474 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7475 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7476 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7477 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7481 LOGICAL GODOWN, GOLEFT, LOWER, UPPER
7482 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
7483 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, ITYPE,
7484 $ IUPP, JJA, JJMAX, JOFFA, JOFFD, LCMT, LCMT00,
7485 $ LDA, LMBLOC, LNBLOC, LOW, M1, MB, MBLKD, MBLKS,
7486 $ MBLOC, MP, MRCOL, MRROW, MYCOL, MYROW, N1, NB,
7487 $ NBLKD, NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB,
7491 INTEGER DESCA2( DLEN_ )
7500 EXTERNAL lsame, pb_numroc
7513 ictxt = desca2( ctxt_ )
7514 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7518 IF( m.EQ.0 .OR. n.EQ.0 )
7521 IF( lsame(
TYPE,
'L' ) ) then
7527 ELSE IF( lsame(
TYPE,
'U' ) ) then
7533 ELSE IF( lsame(
TYPE,
'H' ) ) then
7549 IF( itype.EQ.0 )
THEN
7553 CALL pb_infog2l( ia, ja, desca2, nprow, npcol, myrow, mycol,
7554 $ iia, jja, iarow, iacol )
7555 mp = pb_numroc( m, ia, desca2( imb_ ), desca2( mb_ ), myrow,
7556 $ desca2( rsrc_ ), nprow )
7557 nq = pb_numroc( n, ja, desca2( inb_ ), desca2( nb_ ), mycol,
7558 $ desca2( csrc_ ), npcol )
7560 IF( mp.LE.0 .OR. nq.LE.0 )
7563 lda = desca2( lld_ )
7564 ioffa = iia + ( jja - 1 ) * lda
7566 CALL pb_dlascal(
'All', mp, nq, 0, alpha, a( ioffa ), lda )
7572 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
7573 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
7574 $ iacol, mrrow, mrcol )
7576 IF( mp.LE.0 .OR. nq.LE.0 )
7584 lda = desca2( lld_ )
7586 CALL pb_binfo( ioffd, mp, nq, imb1, inb1, mb, nb, mrrow,
7587 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
7588 $ lmbloc, lnbloc, ilow, low, iupp, upp )
7597 IF( desca2( rsrc_ ).LT.0 )
THEN
7602 IF( desca2( csrc_ ).LT.0 )
THEN
7611 godown = ( lcmt00.GT.iupp )
7612 goleft = ( lcmt00.LT.ilow )
7614 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7618 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7619 godown = .NOT.goleft
7621 CALL pb_dlascal( uplo, imbloc, inbloc, lcmt00, alpha,
7622 $ a( iia+joffa*lda ), lda )
7624 IF( upper .AND. nq.GT.inbloc )
7625 $
CALL pb_dlascal(
'All', imbloc, nq-inbloc, 0, alpha,
7626 $ a( iia+(joffa+inbloc)*lda ), lda )
7630 IF( lower .AND. mp.GT.imbloc )
7631 $
CALL pb_dlascal(
'All', mp-imbloc, inbloc, 0, alpha,
7632 $ a( iia+imbloc+joffa*lda ), lda )
7641 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7643 ioffa = ioffa + imbloc
7646 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7647 lcmt00 = lcmt00 - pmb
7653 tmp1 =
min( ioffa, iimax ) - iia + 1
7654 IF( upper .AND. tmp1.GT.0 )
THEN
7656 $ a( iia+joffa*lda ), lda )
7670 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7673 CALL pb_dlascal( uplo, mbloc, inbloc, lcmt, alpha,
7674 $ a( ioffd+1+joffa*lda ), lda )
7680 ioffd = ioffd + mbloc
7684 tmp1 = m1 - ioffd + iia - 1
7685 IF( lower .AND. tmp1.GT.0 )
7686 $
CALL pb_dlascal(
'All', tmp1, inbloc, 0, alpha,
7687 $ a( ioffd+1+joffa*lda ), lda )
7689 tmp1 = ioffa - iia + 1
7692 lcmt00 = lcmt00 + low - ilow + qnb
7694 joffa = joffa + inbloc
7696 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7697 $
CALL pb_dlascal(
'All', tmp1, n1, 0, alpha,
7698 $ a( iia+joffa*lda ), lda )
7703 ELSE IF( goleft )
THEN
7705 lcmt00 = lcmt00 + low - ilow + qnb
7707 joffa = joffa + inbloc
7710 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7711 lcmt00 = lcmt00 + qnb
7717 tmp1 =
min( joffa, jjmax ) - jja + 1
7718 IF( lower .AND. tmp1.GT.0 )
THEN
7720 $ a( iia+(jja-1)*lda ), lda )
7734 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7737 CALL pb_dlascal( uplo, imbloc, nbloc, lcmt, alpha,
7738 $ a( iia+joffd*lda ), lda )
7744 joffd = joffd + nbloc
7748 tmp1 = n1 - joffd + jja - 1
7749 IF( upper .AND. tmp1.GT.0 )
7750 $
CALL pb_dlascal(
'All', imbloc, tmp1, 0, alpha,
7751 $ a( iia+joffd*lda ), lda )
7753 tmp1 = joffa - jja + 1
7756 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7758 ioffa = ioffa + imbloc
7760 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
7761 $
CALL pb_dlascal(
'All', m1, tmp1, 0, alpha,
7762 $ a( ioffa+1+(jja-1)*lda ), lda )
7771 IF( nblks.GT.0 )
THEN
7775 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7776 lcmt00 = lcmt00 - pmb
7782 tmp1 =
min( ioffa, iimax ) - iia + 1
7783 IF( upper .AND. tmp1.GT.0 )
THEN
7785 $ a( iia+joffa*lda ), lda )
7799 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7802 CALL pb_dlascal( uplo, mbloc, nbloc, lcmt, alpha,
7803 $ a( ioffd+1+joffa*lda ), lda )
7809 ioffd = ioffd + mbloc
7813 tmp1 = m1 - ioffd + iia - 1
7814 IF( lower .AND. tmp1.GT.0 )
7815 $
CALL pb_dlascal(
'All', tmp1, nbloc, 0, alpha,
7816 $ a( ioffd+1+joffa*lda ), lda )
7818 tmp1 =
min( ioffa, iimax ) - iia + 1
7821 lcmt00 = lcmt00 + qnb
7823 joffa = joffa + nbloc
7825 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7826 $
CALL pb_dlascal(
'All', tmp1, n1, 0, alpha,
7827 $ a( iia+joffa*lda ), lda )
7843 SUBROUTINE pdlagen( INPLACE, AFORM, DIAG, OFFA, M, N, IA, JA,
7844 $ DESCA, IASEED, A, LDA )
7853 CHARACTER*1 aform, diag
7854 INTEGER ia, iaseed, ja, lda, m, n, offa
7858 DOUBLE PRECISION A( LDA, * )
8036 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8037 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8039 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8040 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8041 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8042 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8043 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
8044 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
8045 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
8046 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
8047 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
8048 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
8049 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
8053 LOGICAL DIAGDO, SYMM, HERM, NOTRAN
8054 INTEGER CSRC, I, IACOL, IAROW, ICTXT, IIA, ILOCBLK,
8055 $ ILOCOFF, ILOW, IMB, IMB1, IMBLOC, IMBVIR, INB,
8056 $ inb1, inbloc, inbvir, info, ioffda, itmp, iupp,
8057 $ ivir, jja, jlocblk, jlocoff, jvir, lcmt00,
8058 $ lmbloc, lnbloc, low, maxmn, mb, mblks, mp,
8059 $ mrcol, mrrow, mycdist, mycol, myrdist, myrow,
8060 $ nb, nblks, npcol, nprow, nq, nvir, rsrc, upp
8061 DOUBLE PRECISION ALPHA
8064 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
8065 $ IRAN( 2 ), JMP( JMP_LEN ), MULADD0( 4 )
8078 INTRINSIC DBLE, MAX, MIN
8081 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
8092 ictxt = desca2( ctxt_ )
8093 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8098 IF( nprow.EQ.-1 )
THEN
8099 info = -( 1000 + ctxt_ )
8101 symm = lsame( aform,
'S' )
8102 herm = lsame( aform,
'H' )
8103 notran = lsame( aform,
'N' )
8104 diagdo = lsame( diag,
'D' )
8105 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
8106 $ .NOT.( lsame( aform,
'T' ) ) .AND.
8107 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
8109 ELSE IF( ( .NOT.diagdo ) .AND.
8110 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
8113 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
8116 IF( info.NE.0 )
THEN
8117 CALL pxerbla( ictxt,
'PDLAGEN', -info )
8123 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
8130 imb = desca2( imb_ )
8131 inb = desca2( inb_ )
8132 rsrc = desca2( rsrc_ )
8133 csrc = desca2( csrc_ )
8137 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
8138 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
8139 $ iacol, mrrow, mrcol )
8151 ioffda = ja + offa - ia
8152 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
8153 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
8154 $ lmbloc, lnbloc, ilow, low, iupp, upp )
8162 itmp = max( 0, -offa )
8165 nvir = desca2( m_ ) + itmp
8167 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
8168 $ ilocoff, myrdist )
8170 itmp = max( 0, offa )
8173 nvir = max( max( nvir, desca2( n_ ) + itmp ),
8174 $ desca2( m_ ) + desca2( n_ ) - 1 )
8176 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
8177 $ jlocoff, mycdist )
8179 IF( symm .OR. herm .OR. notran )
THEN
8181 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
8182 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
8190 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8191 $ myrdist, mycdist, nprow, npcol, jmp,
8194 CALL pb_dlagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
8195 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8196 $ nb, lnbloc, jmp, imuladd )
8200 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
8202 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
8203 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
8211 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8212 $ myrdist, mycdist, nprow, npcol, jmp,
8215 CALL pb_dlagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
8216 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8217 $ nb, lnbloc, jmp, imuladd )
8223 maxmn = max( desca2( m_ ), desca2( n_ ) )
8224 alpha = dble( maxmn )
8226 IF( ioffda.GE.0 )
THEN
8227 CALL pdladom( inplace, min( max( 0, m-ioffda ), n ), alpha,
8228 $ a, min( ia+ioffda, ia+m-1 ), ja, desca )
8230 CALL pdladom( inplace, min( m, max( 0, n+ioffda ) ), alpha,
8231 $ a, ia, min( ja-ioffda, ja+n-1 ), desca )
8241 SUBROUTINE pdladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
8251 DOUBLE PRECISION ALPHA
8255 DOUBLE PRECISION A( * )
8369 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8370 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8372 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8373 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8374 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8375 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8378 LOGICAL GODOWN, GOLEFT
8379 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
8380 $ IMB1, IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP,
8381 $ JJA, JOFFA, JOFFD, LCMT, LCMT00, LDA, LDAP1,
8382 $ LMBLOC, LNBLOC, LOW, MB, MBLKD, MBLKS, MBLOC,
8383 $ MRCOL, MRROW, MYCOL, MYROW, NB, NBLKD, NBLKS,
8384 $ NBLOC, NP, NPCOL, NPROW, NQ, PMB, QNB, UPP
8385 DOUBLE PRECISION ATMP
8388 INTEGER DESCA2( DLEN_ )
8405 ictxt = desca2( ctxt_ )
8406 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8411 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
8412 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
8413 $ iacol, mrrow, mrcol )
8428 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
8429 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
8430 $ lnbloc, ilow, low, iupp, upp )
8434 lda = desca2( lld_ )
8437 IF( desca2( rsrc_ ).LT.0 )
THEN
8442 IF( desca2( csrc_ ).LT.0 )
THEN
8451 godown = ( lcmt00.GT.iupp )
8452 goleft = ( lcmt00.LT.ilow )
8454 IF( .NOT.godown .AND. .NOT.goleft )
THEN
8458 IF( lcmt00.GE.0 )
THEN
8459 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
8460 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
8461 atmp = a( ijoffa + i*ldap1 )
8462 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8465 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
8466 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
8467 atmp = a( ijoffa + i*ldap1 )
8468 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8471 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
8472 godown = .NOT.goleft
8478 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8480 ioffa = ioffa + imbloc
8483 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8484 lcmt00 = lcmt00 - pmb
8496 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
8499 IF( lcmt.GE.0 )
THEN
8500 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
8501 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
8502 atmp = a( ijoffa + i*ldap1 )
8503 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8506 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
8507 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
8508 atmp = a( ijoffa + i*ldap1 )
8509 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8517 ioffd = ioffd + mbloc
8521 lcmt00 = lcmt00 + low - ilow + qnb
8523 joffa = joffa + inbloc
8525 ELSE IF( goleft )
THEN
8527 lcmt00 = lcmt00 + low - ilow + qnb
8529 joffa = joffa + inbloc
8532 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
8533 lcmt00 = lcmt00 + qnb
8545 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
8548 IF( lcmt.GE.0 )
THEN
8549 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
8550 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
8551 atmp = a( ijoffa + i*ldap1 )
8552 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8555 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
8556 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
8557 atmp = a( ijoffa + i*ldap1 )
8558 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8566 joffd = joffd + nbloc
8570 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8572 ioffa = ioffa + imbloc
8578 IF( nblks.GT.0 )
THEN
8582 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8583 lcmt00 = lcmt00 - pmb
8595 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
8598 IF( lcmt.GE.0 )
THEN
8599 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
8600 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
8601 atmp = a( ijoffa + i*ldap1 )
8602 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8605 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
8606 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
8607 atmp = a( ijoffa + i*ldap1 )
8608 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8616 ioffd = ioffd + mbloc
8620 lcmt00 = lcmt00 + qnb
8622 joffa = joffa + nbloc
8632 SUBROUTINE pb_pdlaprnt( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
8633 $ CMATNM, NOUT, WORK )
8641 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT
8644 CHARACTER*(*) CMATNM
8646 DOUBLE PRECISION A( * ), WORK( * )
8772 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8773 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8775 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8776 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8777 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8778 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8781 INTEGER MYCOL, MYROW, NPCOL, NPROW, PCOL, PROW
8784 INTEGER DESCA2( DLEN_ )
8787 EXTERNAL BLACS_GRIDINFO, PB_DESCTRANS, PB_PDLAPRN2
8793 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
8798 CALL pb_desctrans( desca, desca2 )
8800 CALL blacs_gridinfo( desca2( ctxt_ ), nprow, npcol, myrow, mycol )
8802 IF( desca2( rsrc_ ).GE.0 )
THEN
8803 IF( desca2( csrc_ ).GE.0 )
THEN
8804 CALL pb_pdlaprn2( m, n, a, ia, ja, desca2, irprnt, icprnt,
8805 $ cmatnm, nout, desca2( rsrc_ ),
8806 $ desca2( csrc_ ), work )
8808 DO 10 pcol = 0, npcol - 1
8809 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
8810 $
WRITE( nout, * )
'Colum-replicated array -- ' ,
8811 $
'copy in process column: ', pcol
8812 CALL pb_pdlaprn2( m, n, a, ia, ja, desca2, irprnt,
8813 $ icprnt, cmatnm, nout, desca2( rsrc_ ),
8818 IF( desca2( csrc_ ).GE.0 )
THEN
8819 DO 20 prow = 0, nprow - 1
8820 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
8821 $
WRITE( nout, * )
'Row-replicated array -- ' ,
8822 $
'copy in process row: ', prow
8823 CALL pb_pdlaprn2( m, n, a, ia, ja, desca2, irprnt,
8824 $ icprnt, cmatnm, nout, prow,
8825 $ desca2( csrc_ ), work )
8828 DO 40 prow = 0, nprow - 1
8829 DO 30 pcol = 0, npcol - 1
8830 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
8831 $
WRITE( nout, * )
'Replicated array -- ' ,
8832 $
'copy in process (', prow,
',', pcol,
')'
8833 CALL pb_pdlaprn2( m, n, a, ia, ja, desca2, irprnt,
8834 $ icprnt, cmatnm, nout, prow, pcol,
8846 SUBROUTINE pb_pdlaprn2( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
8847 $ CMATNM, NOUT, PROW, PCOL, WORK )
8855 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT, PCOL, PROW
8858 CHARACTER*(*) CMATNM
8860 DOUBLE PRECISION A( * ), WORK( * )
8864 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8865 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8867 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
8868 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8869 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8870 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8873 LOGICAL AISCOLREP, AISROWREP
8874 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
8875 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
8876 $ LDA, LDW, MYCOL, MYROW, NPCOL, NPROW
8879 EXTERNAL blacs_barrier, blacs_gridinfo, dgerv2d,
8889 ictxt = desca( ctxt_ )
8890 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8891 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol,
8892 $ iia, jja, iarow, iacol )
8895 IF( desca( rsrc_ ).LT.0 )
THEN
8903 IF( desca( csrc_ ).LT.0 )
THEN
8912 ldw =
max( desca( imb_ ), desca( mb_ ) )
8916 jb = desca( inb_ ) - ja + 1
8918 $ jb = ( (-jb) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
8922 ib = desca( imb_ ) - ia + 1
8924 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
8927 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
8928 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8930 WRITE( nout, fmt = 9999 )
8931 $ cmatnm, ia+k, ja+h, a( ii+k+(jj+h-1)*lda )
8935 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
8936 CALL dgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ), lda,
8938 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8939 CALL dgerv2d( ictxt, ib, 1, work, ldw, icurrow, icurcol )
8941 WRITE( nout, fmt = 9999 )
8942 $ cmatnm, ia+k-1, ja+h, work( k )
8946 IF( myrow.EQ.icurrow )
8948 IF( .NOT.aisrowrep )
8949 $ icurrow = mod( icurrow+1, nprow )
8950 CALL blacs_barrier( ictxt,
'All' )
8954 DO 50 i = in+1, ia+m-1, desca( mb_ )
8955 ib =
min( desca( mb_ ), ia+m-i )
8956 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
8957 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8959 WRITE( nout, fmt = 9999 )
8960 $ cmatnm, i+k, ja+h, a( ii+k+(jj+h-1)*lda )
8964 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
8965 CALL dgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
8966 $ lda, irprnt, icprnt )
8967 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8968 CALL dgerv2d( ictxt, ib, 1, work, ldw, icurrow,
8971 WRITE( nout, fmt = 9999 )
8972 $ cmatnm, i+k-1, ja+h, work( k )
8976 IF( myrow.EQ.icurrow )
8978 IF( .NOT.aisrowrep )
8979 $ icurrow = mod( icurrow+1, nprow )
8980 CALL blacs_barrier( ictxt,
'All' )
8987 IF( mycol.EQ.icurcol )
8989 IF( .NOT.aiscolrep )
8990 $ icurcol = mod( icurcol+1, npcol )
8991 CALL blacs_barrier( ictxt,
'All' )
8995 DO 130 j = jn+1, ja+n-1, desca( nb_ )
8996 jb =
min( desca( nb_ ), ja+n-j )
8998 ib = desca( imb_ )-ia+1
9000 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
9003 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9004 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9006 WRITE( nout, fmt = 9999 )
9007 $ cmatnm, ia+k, j+h, a( ii+k+(jj+h-1)*lda )
9011 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9012 CALL dgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9013 $ lda, irprnt, icprnt )
9014 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9015 CALL dgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9018 WRITE( nout, fmt = 9999 )
9019 $ cmatnm, ia+k-1, j+h, work( k )
9023 IF( myrow.EQ.icurrow )
9025 icurrow = mod( icurrow+1, nprow )
9026 CALL blacs_barrier( ictxt,
'All' )
9030 DO 110 i = in+1, ia+m-1, desca( mb_ )
9031 ib =
min( desca( mb_ ), ia+m-i )
9032 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9033 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9035 WRITE( nout, fmt = 9999 )
9036 $ cmatnm, i+k, j+h, a( ii+k+(jj+h-1)*lda )
9040 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9041 CALL dgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9042 $ lda, irprnt, icprnt )
9043 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9044 CALL dgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9047 WRITE( nout, fmt = 9999 )
9048 $ cmatnm, i+k-1, j+h, work( k )
9052 IF( myrow.EQ.icurrow )
9054 IF( .NOT.aisrowrep )
9055 $ icurrow = mod( icurrow+1, nprow )
9056 CALL blacs_barrier( ictxt,
'All' )
9063 IF( mycol.EQ.icurcol )
9065 IF( .NOT.aiscolrep )
9066 $ icurcol = mod( icurcol+1, npcol )
9067 CALL blacs_barrier( ictxt,
'All' )
9071 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', d30.18 )
9078 SUBROUTINE pb_dfillpad( ICTXT, M, N, A, LDA, IPRE, IPOST, CHKVAL )
9086 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9087 DOUBLE PRECISION CHKVAL
9090 DOUBLE PRECISION A( * )
9152 IF( IPRE.GT.0 ) THEN
9157 WRITE( *, fmt =
'(A)' )
9158 $
'WARNING no pre-guardzone in PB_DFILLPAD'
9163 IF( ipost.GT.0 )
THEN
9165 DO 20 i = j, j+ipost-1
9169 WRITE( *, fmt =
'(A)' )
9170 $
'WARNING no post-guardzone in PB_DFILLPAD'
9178 DO 30 i = k, k + ( lda - m ) - 1
9190 SUBROUTINE pb_dchekpad( ICTXT, MESS, M, N, A, LDA, IPRE, IPOST,
9199 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9200 DOUBLE PRECISION CHKVAL
9204 DOUBLE PRECISION A( * )
9280 INTEGER I, IAM, IDUMM, INFO, J, K, MYCOL, MYROW, NPCOL,
9284 EXTERNAL BLACS_GRIDINFO, IGAMX2D, PB_TOPGET
9290 CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
9291 IAM = myrow*npcol + mycol
9296 IF( ipre.GT.0 )
THEN
9298 IF( a( i ).NE.chkval )
THEN
9299 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
' pre', i,
9305 WRITE( *, fmt = * )
'WARNING no pre-guardzone in PB_DCHEKPAD'
9310 IF( ipost.GT.0 )
THEN
9312 DO 20 i = j, j+ipost-1
9313 IF( a( i ).NE.chkval )
THEN
9314 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
'post',
9321 $
'WARNING no post-guardzone buffer in PB_DCHEKPAD'
9329 DO 30 i = k, k + (lda-m) - 1
9330 IF( a( i ).NE.chkval )
THEN
9331 WRITE( *, fmt = 9997 ) myrow, mycol, mess,
9332 $ i-ipre-lda*(j-1), j, a( i )
9340 CALL pb_topget( ictxt,
'Combine',
'All', top )
9341 CALL igamx2d( ictxt,
'All', top, 1, 1, info, 1, idumm, idumm, -1,
9343 IF( iam.EQ.0 .AND. info.GE.0 )
THEN
9344 WRITE( *, fmt = 9999 ) info / npcol, mod( info, npcol ), mess
9347 9999
FORMAT(
'{', i5,
',', i5,
'}: Memory overwrite in ', a )
9348 9998
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
9349 $ a4,
'-guardzone: loc(', i3,
') = ', g20.7 )
9350 9997
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
9351 $
'lda-m gap: loc(', i3,
',', i3,
') = ', g20.7 )
9358 SUBROUTINE pb_dlaset( UPLO, M, N, IOFFD, ALPHA, BETA, A, LDA )
9367 INTEGER IOFFD, LDA, M, N
9368 DOUBLE PRECISION ALPHA, BETA
9371 DOUBLE PRECISION A( LDA, * )
9468 INTEGER I, J, JTMP, MN
9481 IF( M.LE.0 .OR. N.LE.0 )
9486 IF( LSAME( UPLO,
'L' ) ) THEN
9491 mn = max( 0, -ioffd )
9492 DO 20 j = 1, min( mn, n )
9497 DO 40 j = mn + 1, min( m - ioffd, n )
9500 DO 30 i = jtmp + 1, m
9505 ELSE IF( lsame( uplo,
'U' ) )
THEN
9510 mn = min( m - ioffd, n )
9511 DO 60 j = max( 0, -ioffd ) + 1, mn
9513 DO 50 i = 1, jtmp - 1
9518 DO 80 j = max( 0, mn ) + 1, n
9524 ELSE IF( lsame( uplo,
'D' ) )
THEN
9528 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9529 a( j + ioffd, j ) = beta
9542 IF( alpha.NE.beta .AND. ioffd.LT.m .AND. ioffd.GT.-n )
THEN
9543 DO 120 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9544 a( j + ioffd, j ) = beta
9555 SUBROUTINE pb_dlascal( UPLO, M, N, IOFFD, ALPHA, A, LDA )
9564 INTEGER IOFFD, LDA, M, N
9565 DOUBLE PRECISION ALPHA
9568 DOUBLE PRECISION A( LDA, * )
9658 INTEGER I, J, JTMP, MN
9671 IF( M.LE.0 .OR. N.LE.0 )
9676 IF( LSAME( UPLO,
'L' ) ) THEN
9680 MN = max( 0, -ioffd )
9681 DO 20 j = 1, min( mn, n )
9683 a( i, j ) = alpha * a( i, j )
9686 DO 40 j = mn + 1, min( m - ioffd, n )
9687 DO 30 i = j + ioffd, m
9688 a( i, j ) = alpha * a( i, j )
9692 ELSE IF( lsame( uplo,
'U' ) )
THEN
9696 mn = min( m - ioffd, n )
9697 DO 60 j = max( 0, -ioffd ) + 1, mn
9698 DO 50 i = 1, j + ioffd
9699 a( i, j ) = alpha * a( i, j )
9702 DO 80 j = max( 0, mn ) + 1, n
9704 a( i, j ) = alpha * a( i, j )
9708 ELSE IF( lsame( uplo,
'D' ) )
THEN
9712 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9714 a( jtmp, j ) = alpha * a( jtmp, j )
9723 a( i, j ) = alpha * a( i, j )
9734 SUBROUTINE pb_dlagen( UPLO, AFORM, A, LDA, LCMT00, IRAN, MBLKS,
9735 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
9736 $ LNBLOC, JMP, IMULADD )
9744 CHARACTER*1 UPLO, AFORM
9745 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
9746 $ mb, mblks, nb, nblks
9749 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
9750 DOUBLE PRECISION A( LDA, * )
9853 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
9854 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
9855 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
9856 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
9857 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
9858 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
9859 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
9863 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
9864 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
9865 DOUBLE PRECISION DUMMY
9868 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
9875 DOUBLE PRECISION PB_DRAND
9876 EXTERNAL LSAME, PB_DRAND
9884 ib1( i ) = iran( i )
9885 ib2( i ) = iran( i )
9886 ib3( i ) = iran( i )
9889 IF( lsame( aform,
'N' ) )
THEN
9895 DO 50 jblk = 1, nblks
9897 IF( jblk.EQ.1 )
THEN
9899 ELSE IF( jblk.EQ.nblks )
THEN
9905 DO 40 jk = jj, jj + jb - 1
9909 DO 30 iblk = 1, mblks
9911 IF( iblk.EQ.1 )
THEN
9913 ELSE IF( iblk.EQ.mblks )
THEN
9921 DO 20 ik = ii, ii + ib - 1
9922 a( ik, jk ) = pb_drand( 0 )
9927 IF( iblk.EQ.1 )
THEN
9931 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
9938 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
9949 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
9960 IF( jblk.EQ.1 )
THEN
9964 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
9970 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
9983 ELSE IF( lsame( aform,
'T' ) .OR. lsame( aform,
'C' ) )
THEN
9990 DO 90 iblk = 1, mblks
9992 IF( iblk.EQ.1 )
THEN
9994 ELSE IF( iblk.EQ.mblks )
THEN
10000 DO 80 ik = ii, ii + ib - 1
10004 DO 70 jblk = 1, nblks
10006 IF( jblk.EQ.1 )
THEN
10008 ELSE IF( jblk.EQ.nblks )
THEN
10016 DO 60 jk = jj, jj + jb - 1
10017 a( ik, jk ) = pb_drand( 0 )
10022 IF( jblk.EQ.1 )
THEN
10026 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
10033 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
10037 ib1( 1 ) = ib0( 1 )
10038 ib1( 2 ) = ib0( 2 )
10044 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
10046 ib1( 1 ) = ib0( 1 )
10047 ib1( 2 ) = ib0( 2 )
10048 ib2( 1 ) = ib0( 1 )
10049 ib2( 2 ) = ib0( 2 )
10055 IF( iblk.EQ.1 )
THEN
10059 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
10065 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
10069 ib1( 1 ) = ib0( 1 )
10070 ib1( 2 ) = ib0( 2 )
10071 ib2( 1 ) = ib0( 1 )
10072 ib2( 2 ) = ib0( 2 )
10073 ib3( 1 ) = ib0( 1 )
10074 ib3( 2 ) = ib0( 2 )
10078 ELSE IF( ( lsame( aform,
'S' ) ).OR.( lsame( aform,
'H' ) ) )
THEN
10082 IF( lsame( uplo,
'L' ) )
THEN
10089 DO 170 jblk = 1, nblks
10091 IF( jblk.EQ.1 )
THEN
10094 ELSE IF( jblk.EQ.nblks )
THEN
10102 DO 160 jk = jj, jj + jb - 1
10107 DO 150 iblk = 1, mblks
10109 IF( iblk.EQ.1 )
THEN
10112 ELSE IF( iblk.EQ.mblks )
THEN
10122 IF( lcmtr.GT.upp )
THEN
10124 DO 100 ik = ii, ii + ib - 1
10125 dummy = pb_drand( 0 )
10128 ELSE IF( lcmtr.GE.low )
THEN
10131 mnb =
max( 0, -lcmtr )
10133 IF( jtmp.LE.
min( mnb, jb ) )
THEN
10135 DO 110 ik = ii, ii + ib - 1
10136 a( ik, jk ) = pb_drand( 0 )
10139 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
10140 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
10142 itmp = ii + jtmp + lcmtr - 1
10144 DO 120 ik = ii, itmp - 1
10145 dummy = pb_drand( 0 )
10148 DO 130 ik = itmp, ii + ib - 1
10149 a( ik, jk ) = pb_drand( 0 )
10156 DO 140 ik = ii, ii + ib - 1
10157 a( ik, jk ) = pb_drand( 0 )
10164 IF( iblk.EQ.1 )
THEN
10168 lcmtr = lcmtr - jmp( jmp_npimbloc )
10169 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
10176 lcmtr = lcmtr - jmp( jmp_npmb )
10177 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
10182 ib1( 1 ) = ib0( 1 )
10183 ib1( 2 ) = ib0( 2 )
10189 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
10191 ib1( 1 ) = ib0( 1 )
10192 ib1( 2 ) = ib0( 2 )
10193 ib2( 1 ) = ib0( 1 )
10194 ib2( 2 ) = ib0( 2 )
10200 IF( jblk.EQ.1 )
THEN
10204 lcmtc = lcmtc + jmp( jmp_nqinbloc )
10205 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
10211 lcmtc = lcmtc + jmp( jmp_nqnb )
10212 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
10216 ib1( 1 ) = ib0( 1 )
10217 ib1( 2 ) = ib0( 2 )
10218 ib2( 1 ) = ib0( 1 )
10219 ib2( 2 ) = ib0( 2 )
10220 ib3( 1 ) = ib0( 1 )
10221 ib3( 2 ) = ib0( 2 )
10232 DO 250 iblk = 1, mblks
10234 IF( iblk.EQ.1 )
THEN
10237 ELSE IF( iblk.EQ.mblks )
THEN
10245 DO 240 ik = ii, ii + ib - 1
10250 DO 230 jblk = 1, nblks
10252 IF( jblk.EQ.1 )
THEN
10255 ELSE IF( jblk.EQ.nblks )
THEN
10265 IF( lcmtc.LT.low )
THEN
10267 DO 180 jk = jj, jj + jb - 1
10268 dummy = pb_drand( 0 )
10271 ELSE IF( lcmtc.LE.upp )
THEN
10274 mnb =
max( 0, lcmtc )
10276 IF( itmp.LE.
min( mnb, ib ) )
THEN
10278 DO 190 jk = jj, jj + jb - 1
10279 a( ik, jk ) = pb_drand( 0 )
10282 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
10283 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
10285 jtmp = jj + itmp - lcmtc - 1
10287 DO 200 jk = jj, jtmp - 1
10288 dummy = pb_drand( 0 )
10291 DO 210 jk = jtmp, jj + jb - 1
10292 a( ik, jk ) = pb_drand( 0 )
10299 DO 220 jk = jj, jj + jb - 1
10300 a( ik, jk ) = pb_drand( 0 )
10307 IF( jblk.EQ.1 )
THEN
10311 lcmtc = lcmtc + jmp( jmp_nqinbloc )
10312 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
10319 lcmtc = lcmtc + jmp( jmp_nqnb )
10320 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
10325 ib1( 1 ) = ib0( 1 )
10326 ib1( 2 ) = ib0( 2 )
10332 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
10334 ib1( 1 ) = ib0( 1 )
10335 ib1( 2 ) = ib0( 2 )
10336 ib2( 1 ) = ib0( 1 )
10337 ib2( 2 ) = ib0( 2 )
10343 IF( iblk.EQ.1 )
THEN
10347 lcmtr = lcmtr - jmp( jmp_npimbloc )
10348 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
10354 lcmtr = lcmtr - jmp( jmp_npmb )
10355 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
10359 ib1( 1 ) = ib0( 1 )
10360 ib1( 2 ) = ib0( 2 )
10361 ib2( 1 ) = ib0( 1 )
10362 ib2( 2 ) = ib0( 2 )
10363 ib3( 1 ) = ib0( 1 )
10364 ib3( 2 ) = ib0( 2 )
10377 DOUBLE PRECISION FUNCTION pb_drand( IDUMM )
10423 DOUBLE PRECISION one, two
10424 PARAMETER ( one = 1.0d+0, two = 2.0d+0 )
10439 DOUBLE PRECISION FUNCTION pb_dran( IDUMM )
10484 DOUBLE PRECISION divfac, pow16
10485 PARAMETER ( divfac = 2.147483648d+9,
10486 $ pow16 = 6.5536d+4 )
10498 INTEGER iacs( 4 ), irand( 2 )
10499 common /rancom/ irand, iacs
10506 pb_dran = ( dble( irand( 1 ) ) + pow16 * dble( irand( 2 ) ) ) /
10509 CALL pb_lmul( irand, iacs, j )
10510 CALL pb_ladd( j, iacs( 3 ), irand )