Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29417 Discussions

variable in module source file not visible during debugging

hannahse
Beginner
1,692 Views
I'm not sure if this is a compiler issue or a "Microsoft Development Environment" issue or even a programmingissue. I am making changes to a source file that generates a module. First line is "Module Solver". This is followed by several include lines and several variable declaration lines. Then I have "CONTAINS" followed by several subroutines.

My problem is that when I run this in the visual debugger, I can query the current values of any variable declared in the subroutines but not the variables declared above "CONTAINS". It always says "variable not defined". The subroutines make use of these variables correctly.

Is there anything I can do to make these variables visible during the debugging process. I am using the 8.1 compiler but could switch to the 9.0 compiler.
0 Kudos
6 Replies
abhimodak
New Contributor I
1,692 Views
I don't know about compiler version 8.1 but try modulename :: modulevariable in the watch window. This has been working since compiler version 9, I guess.

Abhi
0 Kudos
hannahse
Beginner
1,692 Views
Thanks! That worked for some of the variables but not the ones introduced via common. I tried using the common name similar to use of the module name but that did not work either?

cmm::ITT gives unrecognized variable and so does
solver::ITT where solver is the module and cmm is a common block in the module.

Any idea how to see the variables in common in a module?
0 Kudos
abhimodak
New Contributor I
1,692 Views
Hi

I can see the module variable in common without using the moduleName :: moduleVar syntax i.e. just be hovering mouse over the variable or by putting it in the watch window.

In the snippet below (using debug build with default settings using compiler version 11.1.065) :-
(1) At BreakPoint # 1 the variables in the Locals are: i = 1, NP = 0, MP = 2, OP = 0
(2) At BreakPoint # 2 the variables in the Locals are: j = 1, OP = 3. Hovering mouse over MP and OP also shows their values. Same is true for putting them "as is" in the Watch window.
For variables LP and NP, I need to type Shree :: LP and Shree:: NP.

I also see that at BP# 1 variable NP is available in Locals and also in the Watch window without type modname:: modvar. The same would be true if it was used.

===============

Module Shree
Integer :: LP = 1, NP
Integer :: MP = 2, OP
Common / Mantra / MP, OP
Contains
Subroutine Guru(j)
Implicit None
Integer, Intent(IN) :: j
OP = 3
print *, j ! BreakPoint # 2
End Subroutine Guru
End Module Shree

Program Test_ModuleVar
Use Shree
Implicit None
Integer :: i = 1
Call Guru(i) ! ...BP # 1
NP = 4
OP = 5
End Program Test_ModuleVar
0 Kudos
hannahse
Beginner
1,692 Views
Maybe it's the compiler version then. I have 8.1. I compiled your code and, at breakpoint 2, could not see the variables in common (MP and OP) while I could see the LP and NP using the module:: notation.

So I guess the question is: Is there something I can do using the 8.1 compiler to see these variables during debugging.
0 Kudos
Steven_L_Intel1
Employee
1,692 Views
We have fixed many issues with viewing module variables in the debugger over the years. Please use a more current compiler. Version 8.1 is from 2004.
0 Kudos
hannahse
Beginner
1,692 Views
I was afraid you were going to say that but hoped there was something else. Thanks anyway,
0 Kudos
Reply