next up previous
Next: Program layout Up: swanpgr Previous: Control statements


Use of modules

The idea of modules is data hiding and locality. Place groups of related subroutines and data together in one module. Common parts of the software architectures of the system are candidate to be placed in modules.


Due to the availability of modules, common blocks are prohibited.


Explicit interfaces should be use. The interfaces are automatically known in the calling routines by means of the USE statement. Two ways are possible:

Both choices are allowed.


Make the interfaces of the subroutines explicit. Place several modules where the interfaces and subroutines are programmed in the same file. Redefinition of functions is only allowed when a naming conflict occures, otherwise redefinition of functions is prohibited.


All entities in a module must be declared private by default, and thereafter the entities are declared public which have to be known outside the module. Modules may not contain data that is shared by different subroutines of a program. Modules may contain private data.



next up previous
Next: Program layout Up: swanpgr Previous: Control statements
The SWAN team 2016-06-28