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

Debug Fortran Module

Thomas3
Beginner
632 Views
Hi,

I declare variables in a module. However I could not "VIEW" the variables' value when I "Step Into" the function defined in module (in debug window of Visual Studio 2003 shows "Undefined variable XXXXXXX"). Do I miss some options?

The following is the Fortran program source code I used to test/debug the module. How could I debug the variable int_a declare in module, when I "Step Into" the function "print_a", for example?

Thanks for answer.

!------Begin Dbg_Module.f90-------
program Dbg_Module
use Mod_Test
implicit none

call print_a()
end program Dbg_Module

!------End Dbg_Module.f90-------

!------Begin Mod_Test.f90-------
module Mod_Test
implicit none

integer :: int_a = 0
contains
subroutine print_a()
implicit none

int_a = 5
print *, "int_a = ", int_a
end subroutine print_a
end module Mod_Test
!------End Mod_Test.f90-------
0 Kudos
2 Replies
Steven_L_Intel1
Employee
632 Views
This is discussed in the Building Applications manual section on using the debugger:

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
Thomas3
Beginner
632 Views

Steve,

I got it. Thank you for your help.

Yuehfang

0 Kudos
Reply