1      SUBROUTINE pstreecomb( ICTXT, SCOPE, N, MINE, RDEST0, CDEST0,
 
   11      INTEGER            CDEST0, ICTXT, N, RDEST0
 
   60      LOGICAL            BCAST, RSCOPE, CSCOPE
 
   61      INTEGER            CMSSG, DEST, DIST, HISDIST, I, IAM, MYCOL,
 
   62     $                   myrow, mydist, mydist2, np, npcol, nprow,
 
   63     $                   rmssg, tcdest, trdest
 
   69      EXTERNAL           blacs_gridinfo, sgebr2d, sgebs2d,
 
   84      bcast = ( ( rdest0.EQ.-1 ).OR.( cdest0.EQ.-1 ) )
 
   95      CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
 
   99      rscope = lsame( scope, 
'R' )
 
  100      cscope = lsame( scope, 
'C' )
 
  105         ELSE IF( myrow.NE.trdest ) 
THEN 
  109         mydist = mod( npcol + mycol - tcdest, npcol )
 
  110      ELSE IF( cscope ) 
THEN 
  113         ELSE IF( mycol.NE.tcdest ) 
THEN 
  117         mydist = mod( nprow + myrow - trdest, nprow )
 
  118      ELSE IF( lsame( scope, 
'A' ) ) 
THEN 
  120         iam = myrow*npcol + mycol
 
  121         dest = trdest*npcol + tcdest
 
  122         mydist = mod( np + iam - dest, np )
 
  137         IF( mod( mydist, 2 ).NE.0 ) 
THEN 
  141            dist = i * ( mydist - mod( mydist, 2 ) )
 
  146               cmssg = mod( tcdest + dist, np )
 
  147            ELSE IF( cscope ) 
THEN 
  148               rmssg = mod( trdest + dist, np )
 
  150               cmssg = mod( dest + dist, np )
 
  151               rmssg = cmssg / npcol
 
  152               cmssg = mod( cmssg, npcol )
 
  155            CALL sgesd2d( ictxt, n, 1, mine, n, rmssg, cmssg )
 
  166               cmssg = mod( tcdest + dist, np )
 
  167               hisdist = mod( np + cmssg - tcdest, np )
 
  168            ELSE IF( cscope ) 
THEN 
  169               rmssg = mod( trdest + dist, np )
 
  170               hisdist = mod( np + rmssg - trdest, np )
 
  172               cmssg = mod( dest + dist, np )
 
  173               rmssg = cmssg / npcol
 
  174               cmssg = mod( cmssg, npcol )
 
  175               hisdist = mod( np + rmssg*npcol+cmssg - dest, np )
 
  178            IF( mydist2.LT.hisdist ) 
THEN 
  182               CALL sgerv2d( ictxt, n, 1, his, n, rmssg, cmssg )
 
  183               CALL subptr( mine, his )
 
  197         IF( mydist2.EQ.0 ) 
THEN 
  198            CALL sgebs2d( ictxt, scope, 
' ', n, 1, mine, n )
 
  200            CALL sgebr2d( ictxt, scope, 
' ', n, 1, mine, n,