Fortran 90 is the current standard for the Fortran language. It greatly extends the previous standard, Fortran 77, but it retains the whole of the old language to ease the transition of existing programs to the new standard. Some of the "obsolescent" features of the old language will eventually disappear in future revisions of the language but that will not happen for several years at least.
Existing Fortran 77 users are encouraged to try the new language for the powerful new features it offers and for the stricter program checking done by the Fortran 90 compiler.
ISS provides a Fortran 90 compiler on the central Unix Service. The compiler name is f90. For a full description of all its options type man f90. There are very many options but typical usage is much the same as for the f77 compiler, e.g. suppose that the source file prog.f90 contains a program which calls Nag library routines. To compile it with run-time checking switched on and create an executable file called prog type:f90 -o prog prog.f90 -C -lf90nag
Note that the extension .f90 should be used for files containing Fortran 90 source code. The f90 compiler can compile old Fortran 77 files provided they have a .f extension. It is not possible to mix old style Fortran 77 and Fortran 90 code in the same file.
Material from a Fortran 90 course written by Manchester Computing is kept in the directory /usr/local/packages/f90/mcc_course/src on the Unix service.
Student course notes in PostScript form are in the file f90notes.ps.
Example programs and exercises are in the sub-directories example and exercise.
Some web links to other sources of information on Fortran 90 can be
found at the URL http://www.lancs.ac.uk/iss/ResearchSupport/language.htm
4. Compiling a program which uses a module
It is beyond the scope of this note to describe what a Fortran 90 module is. For that please refer to the on-line course material or any Fortran 90 reference book.
The way in which modules are compiled is not defined by the language and may be different on different computer systems. Suppose that the program in source file prog.f90 uses a module in source file prog_mod.f90.
File prog.f90: File prog_mod.f90:
mycar = vreg( 'l', 240, 'vpx' )
end program vreg_example
subroutine print_vreg( num )
print *, num
end subroutine print_vreg
end module vreg_mod
On the Unix service there are two steps to perform.
Compile the module first:
% f90 -c prog_mod.f90 (creates prog_mod.mod & prog_mod.o)
Then compile the program which uses the module and link it to the compiled module code:
% f90 -o prog prog.f90 prog_mod.o (creates executable file prog)
The program can then be run in the usual way: