Failure of implicit real*8

Michael D. Berger m_d_berger_1900@yahoo.com
Sun Feb 20 03:10:00 GMT 2011


On Sat, 19 Feb 2011 18:42:30 -0800, Jerry DeLisle wrote:

> On 02/19/2011 06:13 PM, Michael D. Berger wrote:
[...]
> First, not likely a compiler bug, though one can not tell without seeing
> more of the code, perhaps you can send a small working example that
> shows the problem.
> 
> Second, it is ill advised to ever use -fdefault-real-8.  Results are not
> always predictable.  Your code may not be as clean as you think and
> there could be side effects.  For example if there is a kind explicitly
> set somewhere.  Also, mx will be implicitly an integer if you do not
> explicitly define it to be real. So I think you were lucky that it
> worked at all before.
> 
> Third, if you need to change kind do this:
> 
> 	real(kind=mp) mx(nrows,ncols),tmp(nrows,ncols)
> 
> and have mp be a parameter you set in one place ahead of where you use
> it.  This way you have explicit control over what is happening.  I would
> also recommend to always use IMPLICIT NONE so you don't have unknowns
> floating around in your code.
> 
> Fourth, consider getting a more recent version of the compiler. 4.5 is
> out now and 4.6 is approaching release (maybe a month).  There have been
> lots of bugs fixed, although 4.4 is OK.

Thanks for this advice.
Mike.



More information about the Fortran mailing list