1      SUBROUTINE pclaqsy( UPLO, N, A, IA, JA, DESCA, SR, SC, SCOND,
 
  157      INTEGER            BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
 
  158     $                   lld_, mb_, m_, nb_, n_, rsrc_
 
  159      parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
 
  160     $                     ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
 
  161     $                     rsrc_ = 7, csrc_ = 8, lld_ = 9 )
 
  163      parameter( one = 1.0e+0, thresh = 0.1e+0 )
 
  166      INTEGER            IACOL, IAROW, ICTXT, II, IIA, IOFFA, IROFF, J,
 
  167     $                   jb, jj, jja, jn, kk, lda, ll, mycol, myrow, np,
 
  169      REAL               CJ, LARGE, SMALL
 
  172      EXTERNAL           blacs_gridinfo, 
infog2l 
  176      INTEGER            ICEIL, NUMROC
 
  178      EXTERNAL           iceil, lsame, numroc, pslamch
 
  194      ictxt = desca( ctxt_ )
 
  195      CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
 
  196      CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
 
  202      small = pslamch( ictxt, 
'Safe minimum' ) /
 
  203     $        pslamch( ictxt, 
'Precision' )
 
  206      IF( scond.GE.thresh .AND. amax.GE.small .AND. amax.LE.large ) 
THEN 
  216         jn = 
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
 
  221         IF( lsame( uplo, 
'U' ) ) 
THEN 
  227            IF( mycol.EQ.iacol ) 
THEN 
  228               IF( myrow.EQ.iarow ) 
THEN 
  229                  DO 20 ll = jj, jj + jb -1
 
  231                     DO 10 kk = iia, ii+ll-jj+1
 
  232                        a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  237                  ioffa = ioffa + jb*lda
 
  244            iarow = mod( iarow+1, nprow )
 
  245            iacol = mod( iacol+1, npcol )
 
  249            DO 70 j = jn+1, ja+n-1, desca( nb_ )
 
  250               jb = 
min( ja+n-j, desca( nb_ ) )
 
  252               IF( mycol.EQ.iacol ) 
THEN 
  253                  IF( myrow.EQ.iarow ) 
THEN 
  254                     DO 40 ll = jj, jj + jb -1
 
  256                        DO 30 kk = iia, ii+ll-jj+1
 
  257                           a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  262                     DO 60 ll = jj, jj + jb -1
 
  265                           a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  275               iarow = mod( iarow+1, nprow )
 
  276               iacol = mod( iacol+1, npcol )
 
  285            iroff = mod( ia-1, desca( mb_ ) )
 
  286            np = numroc( n+iroff, desca( mb_ ), myrow, iarow, nprow )
 
  291            IF( mycol.EQ.iacol ) 
THEN 
  292               IF( myrow.EQ.iarow ) 
THEN 
  293                  DO 90 ll = jj, jj + jb -1
 
  295                     DO 80 kk = ii+ll-jj, iia+np-1
 
  296                        a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  301                  DO 110 ll = jj, jj + jb -1
 
  303                     DO 100 kk = ii, iia+np-1
 
  304                        a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  314            iarow = mod( iarow+1, nprow )
 
  315            iacol = mod( iacol+1, npcol )
 
  319            DO 160 j = jn+1, ja+n-1, desca( nb_ )
 
  320               jb = 
min( ja+n-j, desca( nb_ ) )
 
  322               IF( mycol.EQ.iacol ) 
THEN 
  323                  IF( myrow.EQ.iarow ) 
THEN 
  324                     DO 130 ll = jj, jj + jb -1
 
  326                        DO 120 kk = ii+ll-jj, iia+np-1
 
  327                           a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  332                     DO 150 ll = jj, jj + jb -1
 
  334                        DO 140 kk = ii, iia+np-1
 
  335                           a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
 
  345               iarow = mod( iarow+1, nprow )
 
  346               iacol = mod( iacol+1, npcol )