1. Notables in the transition from Fortran 77 to Fortran 90
- Everything that is in Fortran 77 is also in Fortran 90.
- Many new statements have been added, some replacing older
- Many new statements have been added and give new possibilities.
- There are now two forms of the source code. The old source code
form, which is based on the punched card, and now called fixed form
and the new free form.
These two forms may not be mixed independently but must be
separated at the compilation; an old program, (one or several
program units in the form of a main program, subroutines or
functions), which is compiled in free form, has the possibility to give a
different result compared with earlier when it was compiled with
fixed form, compilation errors are possible.
In the same program we can mix program units written in fixed
form and free form, but each unit must be only in one form and
at the compilation both forms may not usually be in the same
source file. Some systems using a special directive may permit
program units in different form in the same file. The directive
then tells the compiler which form is valid.
- Some old statements are to be avoided.
- It is possible to mix old and new statements, but it is advised
to try to be consistent, which means using either the old
or the new form for the statement.
- Note that when you switch from one compiler to another new
errors may occur, because the old compiler was not as strict as
the new one. Normally, a new compiler discovers some old
errors that were not found earlier. In the specification for
Fortran 90 it is required that errors
already be found at compilation if this is at all possible.
(1.1) Compile and run some of your own small programs with
Fortran 90 using fixed form. Get some instructions in
Appendix 6, NAG's Fortran 90 or
Absoft's Fortran 90.
(1.2) Modify the program you have just compiled by replacing
comments starting with C or * with comments
starting with !
and try to use Fortran 90 free form.
(1.3) What happens if the following small program is run using
fixed form or using free form?
L = .FALSE.
IF (L) THEN Z = 1.0
ELSE Y = Z ENDIF
Last modified: 6 April 1999