Mail Archives: djgpp/1999/09/03/14:52:10
On Thu, 2 Sep 1999, Tommaso Mazzoni wrote:
> After successfully compiling my old fortran sources, I have found out
> that the resulting executable SOMETIMES works well, sometimes it
> doesn't. It's the first time that such a thing happens to me.
>
> The program reads some files, then performs some calculations and then
> prints out the results. But to have it work properly I have to run it
> four or five times in a row until a sensible output is printed.
> Otherwise I get a series of "random" numbers and also NAN etc.
There are many possible reasons for that.
Some variables might not be initialized, try to add the options
"-O2 -W -Wall -Wuninitialized" when compiling.
On your UNIX workstation the Fortran compiler might automatically
save all local variables (the same behaviour as if you type
"SAVE <variable>" in your source code). G77 allocates local
variables on the stack by default, so variables in a SUBROUTINE won't
be SAVEd.
You can change this default behaviour by adding "-fno-automatic"
to your compiler options.
Jens
| | : Jens Bischoff <j DOT bischoff AT airbus DOT dasa DOT de> |
| --< >-- : DaimlerChrysler Aerospace Airbus GmbH |
| | : Aerodynamic Data Department (EFD) |
| Dasa Airbus : D-28199 Bremen - Germany |
- Raw text -