1 SUBROUTINE psgbsv( N, BWL, BWU, NRHS, A, JA, DESCA, IPIV, B, IB,

2 $ DESCB, WORK, LWORK, INFO )

12 INTEGER BWL, BWU, IB, INFO, JA, LWORK, N, NRHS

15 INTEGER DESCA( * ), DESCB( * ), IPIV( * )

16 REAL A( * ), B( * ), WORK( * )

371 parameter( one = 1.0e+0 )

372 parameter( zero = 0.0e+0 )

374 parameter( int_one = 1 )

375 INTEGER DESCMULT, BIGNUM

376 parameter(descmult = 100, bignum = descmult * descmult)

377 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,

378 $ lld_, mb_, m_, nb_, n_, rsrc_

379 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,

380 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,

381 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )

384 INTEGER ICTXT, MYCOL, MYROW, NB, NPCOL, NPROW,

402 IF( desca( dtype_ ) .EQ. block_cyclic_2d )

THEN
404 ictxt = desca( ctxt_ )

405 ELSEIF( desca( dtype_ ) .EQ. 501 )

THEN
409 info = -( 6*100 + dtype_ )

416 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )

421 ws_factor = (nb+bwu)*(bwl+bwu)+6*(bwl+bwu)*(bwl+2*bwu)

425 CALL psgbtrf( n, bwl, bwu, a, ja, desca, ipiv, work,

426 $

min( lwork, ws_factor ), work( 1+ws_factor ),

427 $ lwork-ws_factor, info )

432 IF( info .LT. 0 )

THEN
433 CALL pxerbla( ictxt,

'PSGBSV', -info )

440 CALL psgbtrs(

'N', n, bwl, bwu, nrhs, a, ja, desca, ipiv, b, ib,

441 $ descb, work,

min( lwork, ws_factor ),

442 $ work( 1+ws_factor), lwork-ws_factor, info )

447 CALL pxerbla( ictxt,

'PSGBSV', -info )