Failure of implicit real*8

Jerry DeLisle jvdelisle@frontier.com
Sun Feb 20 02:42:00 GMT 2011


On 02/19/2011 06:22 PM, Steve Kargl wrote:
> 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.
>
Well Steve beat me to the punch.

Jerry



More information about the Fortran mailing list