next up previous contents
Next: Scope Up: More on Procedures Previous: Internal Procedures   Contents

Modules Hosting Procedures

MODULE example
! Type Definitions
! Global Data
...
CONTAINS
SUBROUTINE level_1
CONTAINS
SUBROUTINE level_2
END SUBROUTINE level_2
END SUBROUTINE level_1
END MODULE example

Procedures, together with global data, are visible by use-association (i.e. are visible in the program units that USE the module). In modules, one level of nesting is allowed for contained procedures (in contradistinction to program or procedure hosts, where nesting is not allowed). The second-level routines are visible from the first-level routines, and only the first-level routines are visible from the unit that USEs the module. In F95 an indefinite number of nesting levels is allowed.



Adrian Sandu 2001-08-26