fortran optimization errors
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sat Jun 23 00:15:00 GMT 2007
Steve Kargl wrote:
>>>>> (3) 1.032407088285647E-002
>>>>> (4) 1.032407088285647E-002
>> Where is this numerical output written?
>>
>
> Nevermind. Your code is full of precision problems. A glance at
> semn17.f90 shows
>
> double precision, parameter :: pi=4.0*atan(1.0), ot=1.0/3.0
> double precision, parameter :: p2=pi/(3.0*sqrt(3.0)), p3=pi/(3.0*sqrt(2.0))
> double precision, parameter :: KbT=428.208690545*(0.0)
>
> You have single precision constants (24-bits) on the RHS of these
> equations, and you're setting double precision (53-bits) quantities
> on the LHS.
While this is a real problem, it shouldn't be affected by optimization,
because unless I'm mistaken the constants are converted to the right
types inside the frontend.
- Tobi
More information about the Fortran
mailing list