NextGen TotalView for HPC User Guide : PART II Debugging Tools and Tasks : Chapter 6 Examining and Editing Data : The Call Stack View and Local Variables : Viewing Data in Fortran : Viewing Modules and Their Data
Viewing Modules and Their Data
Fortran 90 lets you place functions, subroutines, and variables inside modules. You can then include these modules elsewhere with a USE command. This command makes the names in the module available in the using compilation unit, unless you either exclude them with a USE ONLY statement or rename them. This means that you don’t need to explicitly qualify the name of a module function or variable from the Fortran source code.
When debugging this kind of information, you need to know the location of the function being called, so NextGen TotalView for HPC uses the following syntax when it displays a function contained in a module:
modulenamefunctionname
Variable names are handled similarly:
modulenamevariablename
NOTE >> This assumes that NextGen TotalView for HPC is able to determine the module in which the function or variable resides. Sometimes the information the compiler makes available is insufficient and sometimes, although a function uses a module, NextGen TotalView for HPC is unable to determine that a module is the source of the function, and so is unable to properly qualify the names. In this case names are displayed unqualified as a local function with local variables.
The above qualified syntax can be used with the Lookup File or Function view, and with the dprint command in the CLI:
dprint modulenamevariablename
Figure 58 illustrates some of the points made above.
Figure 58 – Display of Fortran Module Data
The qualified subroutine name appears in the Call Stack view, and the qualified variable names appear in the VAR drawer. Note also that the init() routine can be called from main without qualification because of the USE statement.