Advantages of Modules

One way to reduce potential confusion when you use the same source code in several projects is to organize the routines into modules. There are two main uses for modules in Visual Fortran:

During the building of a project, the compiler scans the project files for dependencies. If you specify the /[no]include[path] (or /Ipath) command line option or the INCLUDE environment variable, the compiler is able to find the external modules.

Store precompiled module files, with the extension .MOD, in a directory included in the path. When the compiler sees the USE statement in a program, it finds the module based on the name given in the USE statement, so there is no need to maintain several copies of the same source or object code.

Modules are excellent ways to organize programs. You can set up separate modules for: