Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gfortran matmul

5 views
Skip to first unread message

Egil Holvik

unread,
Jun 10, 2006, 5:30:44 AM6/10/06
to
Error in gfortran matmul ?

~$ cat tmatmul.f90
program tmatmul
implicit none
integer, parameter :: nmax = 3
integer :: n = 2
real, dimension(nmax,nmax) :: B=0.0, C=1.0, X=0.0

B(1,1) = 1.0
B(1,2) = 2.0
B(2,1) = 3.0
B(2,2) = 5.0

X(1:n,1) = matmul( B(2,1:n),C(1:n,1:n) )
print *, X(:,1)
print *, " Should be: 8.0 8.0 0.0"

end program tmatmul

~$ ifort-8.1 -o tmatmul-intel81 tmatmul.f90
~$ g95 -o tmatmul-g95 tmatmul.f90
~$ gfortran -o tmatmul-gfortran tmatmul.f90
~$
~$ ./tmatmul-intel81
8.000000 8.000000 0.0000000E+00
Should be: 8.0 8.0 0.0
~$
~$ ./tmatmul-g95
8. 8. 0.
Should be: 8.0 8.0 0.0
~$
~$ ./tmatmul-gfortran
3.000000 3.000000 0.000000
Should be: 8.0 8.0 0.0
~$
~$ gfortran --version
GNU Fortran 95 (GCC) 4.2.0 20060610 (experimental)
....
~$ uname -a
Linux debegil 2.6.15.6 #1 Fri Mar 10 20:51:55 CET 2006 i686 GNU/Linux
also observed in previous versions of gfortran and on x86_64

Regards Egil

Ian Gay

unread,
Jun 10, 2006, 12:05:45 PM6/10/06
to
Egil Holvik <egi...@nspamstud.ntnu.no> wrote in news:448a9144$1
@news.broadpark.no:

I confirm this bug on May 31 windows version of gfortran.

Ian

--
*********** To reply by e-mail, make w single in address
**************

0 new messages