1 SUBROUTINE pzlacpy( UPLO, M, N, A, IA, JA, DESCA, B, IB, JB,
11 INTEGER IA, IB, JA, JB, M, N
14 INTEGER DESCA( * ), DESCB( * )
15 COMPLEX*16 A( * ), B( * )
142 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
143 $ lld_, mb_, m_, nb_, n_, rsrc_
144 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
145 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
146 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
149 INTEGER I, IAA, IBB, IBLK, IN, ITMP, J, JAA, JBB,
158 EXTERNAL iceil, lsame
165 IF( m.EQ.0 .OR. n.EQ.0 )
168 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+m-1 )
169 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
171 IF( m.LE.( desca( mb_ ) - mod( ia-1, desca( mb_ ) ) ) .OR.
172 $ n.LE.( desca( nb_ ) - mod( ja-1, desca( nb_ ) ) ) )
THEN
173 CALL pzlacp2( uplo, m, n, a, ia, ja, desca,
177 IF( lsame( uplo,
'U' ) )
THEN
178 CALL pzlacp2( uplo, in-ia+1, n, a, ia, ja, desca,
180 DO 10 i = in+1, ia+m-1, desca( mb_ )
182 iblk =
min( desca( mb_ ), m-itmp )
186 CALL pzlacp2( uplo, iblk, n-itmp, a, i, jaa, desca,
187 $ b, ibb, jbb, descb )
189 ELSE IF( lsame( uplo,
'L' ) )
THEN
190 CALL pzlacp2( uplo, m, jn-ja+1, a, ia, ja, desca,
192 DO 20 j = jn+1, ja+n-1, desca( nb_ )
194 jblk =
min( desca( nb_ ), n-jtmp )
198 CALL pzlacp2( uplo, m-jtmp, jblk, a, iaa, j, desca,
199 $ b, ibb, jbb, descb )
203 CALL pzlacp2( uplo, in-ia+1, n, a, ia, ja, desca,
205 DO 30 i = in+1, ia+m-1, desca( mb_ )
207 iblk =
min( desca( mb_ ), m-itmp )
209 CALL pzlacp2( uplo, iblk, n, a, i, ja, desca,
210 $ b, ibb, jb, descb )
213 CALL pzlacp2( uplo, m, jn-ja+1, a, ia, ja, desca,
215 DO 40 j = jn+1, ja+n-1, desca( nb_ )
217 jblk =
min( desca( nb_ ), n-jtmp )
219 CALL pzlacp2( uplo, m, jblk, a, ia, j, desca,
220 $ b, ib, jbb, descb )