by **bose** » Thu Jun 29, 2006 2:09 pm

I have played around with the code and have noticed something strange. I use ZGEMV early in the code (for testing purposes) and it returns an answer : (1000154, 0). Some other lines are executed that do not involve any of A, t1, or t2. Upon recomputation, ZGEMV returns (NAN, NAN), and I'm not sure why.

I am posting the relevant lines of code :

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

DO i = 1,n

t1(i) = DCMPLX(i)

t2(i) = DCMPLX(0d0, 0d0)

ENDDO

CALL ZGEMV('N', n, n, DCMPLX(1d0, 0d0), A, n,

& t1, 1, DCMPLX(0d0, 0d0), t2, 1)

WRITE(*, *) t2(1)

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

c Compute the LU factorization of the banded matrix B

c B has 2 sub- and 2 super- diagonals

CALL ZGBTRF(n, n, kl, ku, BAND, (2*kl + ku + 1), ipiv, info)

IF (info .ne. 0) THEN

WRITE(*, *) 'LU factorization failed ...'

END IF

WRITE(*, *) 'Computing eigenvalues...'

c Compute selected eigenvalues / eigenvectors using

c appropriate krylov subspace method (Arnoldi method)

c

c Call ARPACK fortran subroutines, following ARPACK calls

c below models function call in the ARPACK documentation

c initialize call of znaupd, arpack doc p. 18

ido = 0

iparam(1) = 1

iparam(3) = 2000

iparam(7) = 3

info = 0

iter = 0

10 CONTINUE

iter = iter + 1

WRITE(*, *) 'Iteration = ', iter, '...'

CALL ZNAUPD(ido, 'G', n, 'LM', nev, tol, resid,

& ncv, v, ldv, iparam, ipntr, workd, workl, lworkl,

& rwork, info )

IF (ido .eq. -1 .OR. ido .eq. 1) THEN

c First, compute the product z <- Az

DO i = 1, n

c t1(i) = DCMPLX(workd(ipntr(1) + i - 1))

t1(i) = DCMPLX(i)

t2(i) = DCMPLX(0d0, 0d0)

ENDDO

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

CALL ZGEMV('N', n, n, DCMPLX(1d0, 0d0), A, n,

& t1, 1, DCMPLX(0d0, 0d0), t2, 1)

c CALL ZGBMV('N', n, n, kl, ku, DCMPLX(1d0, 0d0), A_BAND,

c & kl + ku + 1, t1, 1, DCMPLX(0d0, 0d0), t2, 1)

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

WRITE(*, *) t2(1)

The calls to ZGEMV are contained within comment lines.