1 SUBROUTINE pdlawil( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
10 DOUBLE PRECISION H33, H43H34, H44
14 DOUBLE PRECISION A( * ), V( * )
113 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
114 $ LLD_, MB_, M_, NB_, N_, RSRC_
115 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
116 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
117 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
120 INTEGER CONTXT, DOWN, HBL, ICOL, IROW, JSRC, LDA, LEFT,
121 $ MODKM1, MYCOL, MYROW, NPCOL, NPROW, NUM, RIGHT,
123 DOUBLE PRECISION H11, H12, H21, H22, H33S, H44S, S, V1, V2, V3
126 DOUBLE PRECISION BUF( 4 )
129 EXTERNAL blacs_gridinfo, dgerv2d, dgesd2d,
infog2l
137 contxt = desca( ctxt_ )
139 CALL blacs_gridinfo( contxt, nprow, npcol, myrow, mycol )
140 left = mod( mycol+npcol-1, npcol )
141 right = mod( mycol+1, npcol )
142 up = mod( myrow+nprow-1, nprow )
143 down = mod( myrow+1, nprow )
148 modkm1 = mod( m+1, hbl )
149 IF( modkm1.EQ.0 )
THEN
150 IF( ( myrow.EQ.ii ) .AND. ( right.EQ.jj ) .AND.
151 $ ( npcol.GT.1 ) )
THEN
152 CALL infog2l( m+2, m+1, desca, nprow, npcol, myrow, mycol,
153 $ irow, icol, rsrc, jsrc )
154 buf( 1 ) = a( ( icol-1 )*lda+irow )
155 CALL dgesd2d( contxt, 1, 1, buf, 1, ii, jj )
157 IF( ( down.EQ.ii ) .AND. ( right.EQ.jj ) .AND. ( num.GT.1 ) )
159 CALL infog2l( m, m, desca, nprow, npcol, myrow, mycol, irow,
161 buf( 1 ) = a( ( icol-1 )*lda+irow )
162 buf( 2 ) = a( ( icol-1 )*lda+irow+1 )
163 buf( 3 ) = a( icol*lda+irow )
164 buf( 4 ) = a( icol*lda+irow+1 )
165 CALL dgesd2d( contxt, 4, 1, buf, 4, ii, jj )
167 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
168 CALL infog2l( m+2, m+2, desca, nprow, npcol, myrow, mycol,
169 $ irow, icol, rsrc, jsrc )
170 IF( npcol.GT.1 )
THEN
171 CALL dgerv2d( contxt, 1, 1, v3, 1, myrow, left )
173 v3 = a( ( icol-2 )*lda+irow )
176 CALL dgerv2d( contxt, 4, 1, buf, 4, up, left )
182 h11 = a( ( icol-3 )*lda+irow-2 )
183 h21 = a( ( icol-3 )*lda+irow-1 )
184 h12 = a( ( icol-2 )*lda+irow-2 )
185 h22 = a( ( icol-2 )*lda+irow-1 )
189 IF( modkm1.EQ.1 )
THEN
190 IF( ( down.EQ.ii ) .AND. ( right.EQ.jj ) .AND. ( num.GT.1 ) )
192 CALL infog2l( m, m, desca, nprow, npcol, myrow, mycol, irow,
194 CALL dgesd2d( contxt, 1, 1, a( ( icol-1 )*lda+irow ), 1, ii,
197 IF( ( down.EQ.ii ) .AND. ( mycol.EQ.jj ) .AND. ( nprow.GT.1 ) )
199 CALL infog2l( m, m+1, desca, nprow, npcol, myrow, mycol,
200 $ irow, icol, rsrc, jsrc )
201 CALL dgesd2d( contxt, 1, 1, a( ( icol-1 )*lda+irow ), 1, ii,
204 IF( ( myrow.EQ.ii ) .AND. ( right.EQ.jj ) .AND.
205 $ ( npcol.GT.1 ) )
THEN
206 CALL infog2l( m+1, m, desca, nprow, npcol, myrow, mycol,
207 $ irow, icol, rsrc, jsrc )
208 CALL dgesd2d( contxt, 1, 1, a( ( icol-1 )*lda+irow ), 1, ii,
211 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
212 CALL infog2l( m+2, m+2, desca, nprow, npcol, myrow, mycol,
213 $ irow, icol, rsrc, jsrc )
215 CALL dgerv2d( contxt, 1, 1, h11, 1, up, left )
217 h11 = a( ( icol-3 )*lda+irow-2 )
219 IF( nprow.GT.1 )
THEN
220 CALL dgerv2d( contxt, 1, 1, h12, 1, up, mycol )
222 h12 = a( ( icol-2 )*lda+irow-2 )
224 IF( npcol.GT.1 )
THEN
225 CALL dgerv2d( contxt, 1, 1, h21, 1, myrow, left )
227 h21 = a( ( icol-3 )*lda+irow-1 )
229 h22 = a( ( icol-2 )*lda+irow-1 )
230 v3 = a( ( icol-2 )*lda+irow )
233 IF( ( myrow.NE.ii ) .OR. ( mycol.NE.jj ) )
236 IF( modkm1.GT.1 )
THEN
237 CALL infog2l( m+2, m+2, desca, nprow, npcol, myrow, mycol,
238 $ irow, icol, rsrc, jsrc )
239 h11 = a( ( icol-3 )*lda+irow-2 )
240 h21 = a( ( icol-3 )*lda+irow-1 )
241 h12 = a( ( icol-2 )*lda+irow-2 )
242 h22 = a( ( icol-2 )*lda+irow-1 )
243 v3 = a( ( icol-2 )*lda+irow )
248 v1 = ( h33s*h44s-h43h34 ) / h21 + h12
249 v2 = h22 - h11 - h33s - h44s
250 s = abs( v1 ) + abs( v2 ) + abs( v3 )