Tutorial by Examples

A complete Fortran program is made up from a number of distinct program units. Program units are: main program function or subroutine subprogram module or submodule block data program unit The main program and some procedure (function or subroutine) subprograms may be provided by a languag...
Modules are documented elsewhere. Compilers often generate so-called module files: usually the file containing module my_module end module will result in a file named something like my_module.mod by the compiler. In such cases, for a module to be accessible by a program unit, that module file...
An external procedure is one which is defined outside another program unit, or by a means other than Fortran. The function contained in a file like integer function f() implicit none end function f is an external function. For external procedures, their existence may be declared by using a...
Block data program units are program units which provide initial values for objects in common blocks. These are deliberately left undocumented here, and will feature in the documentation of historic Fortran features.
A program unit which is not an internal subprogram may contain other program units, called internal subprograms. program prog implicit none contains function f() end function f subroutine g() end subroutine g end program Such an internal subprogram has a number of features: t...
A source code file is a (generally) plain text file which is to processed by the compiler. A source code file may contain up to one main program and any number of modules and external subprograms. For example, a source code file may contain the following module mod1 end module mod1 module mod...

Page 1 of 1