Data encapsulation using Fortran 77 modules

  • Authors:
  • Lewis L. DeLong;David B. Thompson;Janice M. Fulford

  • Affiliations:
  • -;-;-

  • Venue:
  • ACM SIGPLAN Fortran Forum
  • Year:
  • 1992

Quantified Score

Hi-index 0.00

Visualization

Abstract

Traditionally, the preferred method for developing numerical models in the Fortran language, as standardized in 1977, has been the top-down structured approach. This method emphasizes the relation between procedures necessary to solve a particular programming problem. An alternative perspective is to consider data and manipulation of data fundamental to solution of a programming problem. A programming construct arising from this perspective may be termed a module. A module is comprised of a set of procedures and data they manipulate. Modules may be used to encapsulate data, that is, hide module data from and prevent their direct use by routines outside the module. Information computed from module data is obtained indirectly through invocation of module procedures. Modules, comprised of associated groups of data and respective procedures, provide program structure beyond that available using procedural-oriented practices alone. Construction and use of modules potentially improves program clarity, reduces argument passing, and encapsulates data at the level where they are manipulated. Use of Fortran 77 modules, like the use of top-down structured programming, is a programming technique allowed but not supported or enforced by the Fortran 77 language. Consequently, successful implementation of modules with Fortran 77 and realization of potential benefits depend on voluntary adherence to the programming technique. Use of other computer languages (such as Modula-2, Ada, C++, and Fortran 90) which, to varying degrees, support or enforce programming techniques similar to the use of Fortran 77 modules might significantly increase programming efficiency and realization of potential benefits.