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

can't view subroutine variables

ldw636
Beginner
536 Views
I need view the variables value in subroutine, but when I input these variables' name in watach window, it alwyas says: undefined variables. I attach a simple program. Anyone can tell me how to watch "i" (in subroutine power) value?

subroutine power(x)
implicit none
integer:: i
real::x
write(*,*) "This is a test:"
x=0
do i=11001
x=2*i+1
enddo
write(*,*)x
end


0 Kudos
4 Replies
Steven_L_Intel1
Employee
536 Views
You have to be executing inside subroutine power before you can add a watch for its local variables.
0 Kudos
ldw636
Beginner
536 Views
You have to be executing inside subroutine power before you can add a watch for its local variables.
The whole program is as below. What I do is to set the breakpoint at the second "print *, 'Hello World' " and then click F5". I do not kow how to execute inside subroutine power seperately. Thanks.

program Console4
implicit none
integer::y
print *, 'Hello World'
call power(y)
print *, 'Hello World' !!!!Breakpoint is set here
end program Console4

subroutine power(x)
implicit none
integer:: i
real::x
write(*,*) "This is a test:"
x=0
do i=1,100,1
x=2*i+1
enddo
write(*,*)x
end
0 Kudos
Steven_L_Intel1
Employee
536 Views
Set a breakpoint at the write inside routine power - that's the easiest way to get in there.
0 Kudos
ldw636
Beginner
536 Views
Set a breakpoint at the write inside routine power - that's the easiest way to get in there.

Many thanks Steve, the problem is solved.
0 Kudos
Reply