This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
cause of some lapack failures
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 13 Apr 2004 11:16:10 -0700
- Subject: cause of some lapack failures
Gang,
I've determined that the cause of some of the lapack
test program failures is due to problems with list
directed I/O and implied-do loops. Consider the
following code:
program d
implicit none
integer i, j, m, n, nin
real x(3,4)
nin = 1
open(unit = nin, file = 'd.dat')
read(nin, fmt = *) n
write(*,'(A,I2)') 'n = ', n
do i = 1, 3
read(nin, fmt = *) (x(i,j), j=1, n)
write(*, *) (x(i,j), j=1, n)
end do
read(nin, fmt = *) m, n
write(*,'(A,I2,2X,A,I2)') 'm = ', m, 'n = ', n
do i = 1, m
read(nin, fmt = *) (x(i,j), j=1, n)
write(*, *) (x(i,j), j=1, n)
end do
end program d
and data file
4
1 2 3 4
1 2 3 4
1 2 3 4
3 4
1 2 3 4
1 2 3 4
1 2 3 4
G77 gives the following output:
kargl[234] ./d
n = 4
1. 2. 3. 4.
1. 2. 3. 4.
1. 2. 3. 4.
m = 3 n = 4
1. 2. 3. 4.
1. 2. 3. 4.
1. 2. 3. 4.
Gfortran gives
kargl[236] ./d
n = 4
1.000000 0.000000 2.000000 3.9933076E-34
1.000000 0.000000 2.000000 6.1756624E-41
1.000000 0.000000 2.000000 4.0700904E-34
m = 1 n = 3
1.000000 0.000000 2.000000
--
Steve