Still, we all discover
Useful compiler options
Most Fortran compilers will have a set of options you can turn on
if you like. The following compiler options are specific to the
Sun Fortran 77 compiler, but most compilers will have similar
options (although the letters may be different).
implicit none (a-z)
in the beginning of each (sub-)program.
Some common errors
Here are some common errors to watch out for:
If you have a bug, you have to try to locate it. Syntax errors are
easy to find. The problem is when you have run-time errors.
The old-fashioned way to find errors is to add write statements
in your code and try to track the values of your variables.
This is a bit tedious since you have to recompile your source code
every time you change the program slightly. Today one can use special
debuggers which is a convient tool. You can step through
a program line by line or define your own break points, you can
display the values of the variables you want to monitor, and much more.
Most UNIX machines will have the debuggers dbx and gdb.
Unfortunately, these are difficult to learn since they have an old-fashioned
line-oriented user interface. Check if there is a graphical user interface
available, like e.g. xdbx or dbxtool.
[AMS Home Page] [Fortran Tutorial Home]