- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to be executing inside subroutine power before you can add a watch for its local variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
You have to be executing inside subroutine power before you can add a watch for its local variables.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set a breakpoint at the write inside routine power - that's the easiest way to get in there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page