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

Inspect variable declared in the specification part of a module

Luis_Solis
Beginner
440 Views
In the example below

module foo
integer, dimension(:),allocatable:: im
integer, parameter:: n=3
contains
subroutine s1(i)
integer:: i
allocate(im(2))
im=i
write(*,*) im
end subroutine
end module
program main
use foo
i=1
call s1(i)
end program

If I put a breakpoint in write(*,*)

The array a or the parameter n are undefined in locals and watch windows

Is there a way to inspect the contents of the a or n

Best regards
0 Kudos
1 Reply
Steven_L_Intel1
Employee
440 Views
I don't see an array a in this code. There is an array im. If the variable is not used in the current scope, you can use the syntax modname::varname in a Watch window to view it.

n is a PARAMETER constant and is not visible by default. There is a compiler option /debug-parameters that controls visibility.
0 Kudos
Reply