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

global variables in Intel Fortran 9.1

vt287
Beginner
543 Views
Hi,

I am using Intel Fortran 9.1 integrated with Visual Studio 2005 Pro.
I have a question about global variables, which seem to be not accessible during debug time. Consider the following project:

program main
use use_global_var

call setQ(5d0)
print *, Q
end program

module use_global_var
use global_vars

contains
subroutine SetQ(x)
real(8) :: x
Q = x
end subroutine
end module

module global_vars
real(8) :: Q
end module

Variable Q which is visible to subroutine SetQ in module "use_global_var" is not accessible during debug time (in watch window I get "undefined variable Q"). Why is this so? Is there any way to see the value of those variables during debug.

Thanks,
Victor
0 Kudos
2 Replies
Steven_L_Intel1
Employee
543 Views
As noted in the Building Applications manual section on debugging:

Specifying Module Variables

To view a module variable in a Watch window, specify the module name, followed by "::", followed by the variable name.

For example, to watch variable "bar" of module "foo", specify the following expression:

foo::bar




0 Kudos
vt287
Beginner
543 Views
Steve, thanks.
0 Kudos
Reply