Fortran 90: Look and Feel
Source Format
There are now two types of formats: fixed form and free form.
Fixed form is the Fortran 77 standard plus
- comments can start anywhere, and begin with an exclamation point "!"
- multiple commands can be on one line, separated by a semicolon
Free form allows
- comments can start anywhere, and must begin with an exclamation point "!"
- multiple commands can be on one line, separated by a semicolon
- line lengths up to 132 characters
- continuation lines are signalled by an ampersand "&" at the
end of the line being continued.
The current f77 convention of putting a "c" or "*" in column 1 for comments
will generate a syntax error in free format form.
The IBM compiler assumes
free format unless the flag -q fixed
is used.
Existing f77 routines should be compiled with this flag.
Variable declarations
Variables can be declared according to the old syntax,
integer i,j
real*8 a(3,2)
integer imax
parameter (imax=30)
or a new syntax where the type can be followed by attributes. These are
separated from the variable by a double colon. For example
integer :: i
real*8 :: a(3,2)
real*8, dimension(3,2) :: a
integer, parameter :: imax = 30
integer, allocatable :: b(:)
Return to Fortran 90 index