I am using VS2012, and my code is as below, also the file is attached.
my problem is that I cannot see the 'v' component (that is allocatable) of x array at a break point in subroutine sr2, even though I can print it.
it is interesting that we have no problem in seeing the 'a' component of x array.
what is the reason? how to fix it?
IMPLICIT NONE !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type dt
real*8, Dimension(:), allocatable :: v real*8 :: a
end type dt
end Module dtype !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subroutine sr1(x) use dtype implicit none
allocate(x%v(3)) x%v=[1.0, 2.0, 3.0]
end subroutine sr1 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subroutine sr2(x) use dtype implicit none
type(dt) x(3) call sr1(x(1)) call sr1(x(2)) call sr1(x(3))
write(*,*) 'break point here. We cannot see the value of v component of x array in debugger, but we can print it' write(*,*) x(1)%v
end subroutine sr2 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ program main
use dtype implicit none type(dt) x(3) call sr2(x(1:3))
write(*,*) x(1)%v pause
end program main
For more complete information about compiler optimizations, see our Optimization Notice.