Modules consist of variables, data type definitions, subroutines, and functions. The form of a module is
module testVariables, data type definitions
containsSubroutines,functions
end module testA module is included in a file with the statement
use
modulename
All the variables defined in the module are
available, as well as the subroutines and functions (Not quite true, see
the public and private keywords).
Putting variables in a module replaces common statements as a mechanism for global variables.
A object oriented use for modules is to declare a particular derived data type and the functions and subroutines that operate on that type.
private
means that only variables and subprograms
with the public
attribute are available to the including program.