F90 Model : Modules

LeftRight
Fortran 90 added the new feature of modules, which provides a way to consolidate, isolate and encapsulate code into an ``easily'' maintainable package. As with object-oriented languages, it provides a way to isolate many of the operations and data into a single source.

Modules is a popular concept in software now (e.g. Fortran 90 modules, perl modules, kernel modules, environment modules, apache web-server modules, pluggable authentication modules, etc.). The concept is to provide a documented API, with rules and limitations.

One attribute of modules is the ability to limit ``name space'' pollution. That is, avoid accidental name collision between two variables. Many software development problems stem from undeclared variables, or from accidentally reusing variables unintentionally. Fortran 90 modules can solve this common problem.

Modules can contain and encapsulate the data providing ``methods'' for handling the data. Unlike object-oriented languages there is no way to shield the user from the object details. However, object details can be minimized and the wise user will take advantage of them.

LeftRight
Slide 8