Failure of implicit real*8
Steve Kargl
sgk@troutmask.apl.washington.edu
Sun Feb 20 02:23:00 GMT 2011
On Sun, Feb 20, 2011 at 02:13:35AM +0000, Michael D. Berger wrote:
> Using:
> gfortran44 -fdefault-real-8
>
> where:
> [~]$ gfortran44 --version
> GNU Fortran (GCC) 4.4.0 20090514 (Red Hat 4.4.0-6)
>
> I have two nearly identical subroutines very similar to:
>
> subroutine orderRows(mx, idxSort, nrows, ncols)
> dimension idxSort(nrows),mx(nrows,ncols),tmp(nrows,ncols)
> ...
>
> where mx is expected to be real, in particular, real*8 because
> of the compile option.
>
> But one of the two interprets mx as an integer, giving
> radically wrong results.
>
> Using, instead:
>
> subroutine orderRows(mx, idxSort, nrows, ncols)
> dimension idxSort(nrows)
> real mx(nrows,ncols),tmp(nrows,ncols)
> ...
>
> produces correct results.
>
> I compiler bug?
>
Are you serious? There is too little information here
to even guess at an answer. Show us the actual code.
Well, I do have guess, but you won't care for it.
Don't use -fdefault-real-8, because this option
may not do what you think it does.
--
Steve
More information about the Fortran
mailing list