Data encapsulation using FORTRAN-77 modules; a first step toward object-oriented programming in water resources

David B. Thompson, L.L. DeLong, Janice Marie Fulford · 1992

Programming is a costly aspect of numerical modeling.Recognizing the need to increase reusability and maintainability of source codes, programs developed using FORTRAN-77 often conform to a method of program design called top-down structured programming, or procedural programming.This method emphasizes the relation between procedures necessary to solve a particular programming problem.An alternative approach is to consider the relation between data and manipulation of data fundamental to solution of a programming problem.The programming construct arising from this perspective is termed a module.In this report, the module programming construct is denned.Through figures and code examples, it is shown how FORTRAN-77 modules are used to encapsulate fundamental data from other parts of the program.FORTRAN-77 modules provide a level of program structure in addition to that available using procedural practices alone.Construction and use of FORTRAN-77 modules improves program clarity, reduces argument passing, and encapsulates fundamental data at the level where they are manipulated.

Read the paper · More papers on PaperTik