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,
219 REAL V1( 2 ), V2( 2 )
246 IF( abs( v1( 1 ) ).LT.abs( v2( 1 ) ) )
THEN
265 REAL V1( 2 ), V2( 2 )
287 parameter( zero = 0.0e+0 )
291 IF( v1( 1 ).GE.v2( 1 ) )
THEN
292 IF( v1( 1 ).NE.zero )
293 $ v1( 2 ) = v1( 2 ) + ( v2( 1 ) / v1( 1 ) )**2 * v2( 2 )
295 v1( 2 ) = v2( 2 ) + ( v1( 1 ) / v2( 1 ) )**2 * v1( 2 )
334 parameter( one = 1.0e+0, zero = 0.0e+0 )
350 x = w*sqrt( one+( z / w )**2 )