What is a Module?

In many previous example, there are several internal functions packed at the end of the main program. In fact, many of them such as Factorial(), Combinatorial(), GCD(), and Prime() are general functions that can also be used in other programs. To provide the programmers with a way of packing commonly used functions into a few tool-boxes, Fortran 90 has a new capability called modules. It has a syntactic form very similar to a main program, except for something that are specific to modules.


The following is the syntax of a module:
MODULE  module-name
   [specification part]
END MODULE  module-name

The differences between a program and a module are the following:

Short Examples

Here are some short examples of modules: