1 SUBROUTINE pclawil( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
10 COMPLEX H33, H43H34, H44
14 COMPLEX A( * ), V( * )
116 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
117 $ LLD_, MB_, M_, NB_, N_, RSRC_
118 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
119 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
120 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
123 INTEGER CONTXT, DOWN, HBL, ICOL, IROW, JSRC, LDA, LEFT,
124 $ MODKM1, MYCOL, MYROW, NPCOL, NPROW, NUM, RIGHT,
127 COMPLEX CDUM, H11, H12, H21, H22, H33S, H44S, V1, V2,
134 EXTERNAL blacs_gridinfo,
infog2l, cgerv2d, cgesd2d
137 INTRINSIC abs, real, aimag, mod
143 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
148 contxt = desca( ctxt_ )
150 CALL blacs_gridinfo( contxt, nprow, npcol, myrow, mycol )
151 left = mod( mycol+npcol-1, npcol )
152 right = mod( mycol+1, npcol )
153 up = mod( myrow+nprow-1, nprow )
154 down = mod( myrow+1, nprow )
159 modkm1 = mod( m+1, hbl )
160 IF( modkm1.EQ.0 )
THEN
161 IF( ( myrow.EQ.ii ) .AND. ( right.EQ.jj ) .AND.
162 $ ( npcol.GT.1 ) )
THEN
163 CALL infog2l( m+2, m+1, desca, nprow, npcol, myrow, mycol,
164 $ irow, icol, rsrc, jsrc )
165 buf( 1 ) = a( ( icol-1 )*lda+irow )
166 CALL cgesd2d( contxt, 1, 1, buf, 1, ii, jj )
168 IF( ( down.EQ.ii ) .AND. ( right.EQ.jj ) .AND. ( num.GT.1 ) )
170 CALL infog2l( m, m, desca, nprow, npcol, myrow, mycol, irow,
172 buf( 1 ) = a( ( icol-1 )*lda+irow )
173 buf( 2 ) = a( ( icol-1 )*lda+irow+1 )
174 buf( 3 ) = a( icol*lda+irow )
175 buf( 4 ) = a( icol*lda+irow+1 )
176 CALL cgesd2d( contxt, 4, 1, buf, 4, ii, jj )
178 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
179 CALL infog2l( m+2, m+2, desca, nprow, npcol, myrow, mycol,
180 $ irow, icol, rsrc, jsrc )
181 IF( npcol.GT.1 )
THEN
182 CALL cgerv2d( contxt, 1, 1, v3, 1, myrow, left )
184 v3 = a( ( icol-2 )*lda+irow )
187 CALL cgerv2d( contxt, 4, 1, buf, 4, up, left )
193 h11 = a( ( icol-3 )*lda+irow-2 )
194 h21 = a( ( icol-3 )*lda+irow-1 )
195 h12 = a( ( icol-2 )*lda+irow-2 )
196 h22 = a( ( icol-2 )*lda+irow-1 )
200 IF( modkm1.EQ.1 )
THEN
201 IF( ( down.EQ.ii ) .AND. ( right.EQ.jj ) .AND. ( num.GT.1 ) )
203 CALL infog2l( m, m, desca, nprow, npcol, myrow, mycol, irow,
205 CALL cgesd2d( contxt, 1, 1, a( ( icol-1 )*lda+irow ), 1, ii,
208 IF( ( down.EQ.ii ) .AND. ( mycol.EQ.jj ) .AND. ( nprow.GT.1 ) )
210 CALL infog2l( m, m+1, desca, nprow, npcol, myrow, mycol,
211 $ irow, icol, rsrc, jsrc )
212 CALL cgesd2d( contxt, 1, 1, a( ( icol-1 )*lda+irow ), 1, ii,
215 IF( ( myrow.EQ.ii ) .AND. ( right.EQ.jj ) .AND.
216 $ ( npcol.GT.1 ) )
THEN
217 CALL infog2l( m+1, m, desca, nprow, npcol, myrow, mycol,
218 $ irow, icol, rsrc, jsrc )
219 CALL cgesd2d( contxt, 1, 1, a( ( icol-1 )*lda+irow ), 1, ii,
222 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
223 CALL infog2l( m+2, m+2, desca, nprow, npcol, myrow, mycol,
224 $ irow, icol, rsrc, jsrc )
226 CALL cgerv2d( contxt, 1, 1, h11, 1, up, left )
228 h11 = a( ( icol-3 )*lda+irow-2 )
230 IF( nprow.GT.1 )
THEN
231 CALL cgerv2d( contxt, 1, 1, h12, 1, up, mycol )
233 h12 = a( ( icol-2 )*lda+irow-2 )
235 IF( npcol.GT.1 )
THEN
236 CALL cgerv2d( contxt, 1, 1, h21, 1, myrow, left )
238 h21 = a( ( icol-3 )*lda+irow-1 )
240 h22 = a( ( icol-2 )*lda+irow-1 )
241 v3 = a( ( icol-2 )*lda+irow )
244 IF( ( myrow.NE.ii ) .OR. ( mycol.NE.jj ) )
247 IF( modkm1.GT.1 )
THEN
248 CALL infog2l( m+2, m+2, desca, nprow, npcol, myrow, mycol,
249 $ irow, icol, rsrc, jsrc )
250 h11 = a( ( icol-3 )*lda+irow-2 )
251 h21 = a( ( icol-3 )*lda+irow-1 )
252 h12 = a( ( icol-2 )*lda+irow-2 )
253 h22 = a( ( icol-2 )*lda+irow-1 )
254 v3 = a( ( icol-2 )*lda+irow )
259 v1 = ( h33s*h44s-h43h34 ) / h21 + h12
260 v2 = h22 - h11 - h33s - h44s
261 s = cabs1( v1 ) + cabs1( v2 ) + cabs1( v3 )