Modules
Steve Lantz, Adam Brazier, Zilu Wang
Cornell Center for Advanced Computing
Revisions: 8/2025, 2/2023, 10/2014, 6/2012 (original)
Modules provide the way to package global data and derived types with subprograms, etc. Parts of a module can be kept hidden from other parts of the program by making a particular variable, declaration, or subprogram private. A module is accessed by adding the use
statement to a program unit (main program or subprograms).
Objectives
After you complete this topic, you should be able to:
- Define a module in source code
- Use the module in other program units
- Write a module that contains subroutines and functions
- Implement derived types in a module
Prerequisites
- Familiarity with an editor
- Knowledge of how to execute simple commands on the command line
- Some basic understanding of what a computer language is
©
|
Cornell University
|
Center for Advanced Computing
|
Copyright Statement
|
Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)