Failure of implicit real*8

Michael D. Berger m_d_berger_1900@yahoo.com
Sun Feb 20 02:13:00 GMT 2011


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?

Mike.



More information about the Fortran mailing list