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

Visual studio debugger reports incorrect variable values

Terry_Gerald1
Beginner
663 Views
I have a user defined type with type bound procedures.

When stepping inside any of the type-bound procedures with the VS Debugger, a query of type variables yields total nonsense for any and all variables.


The debugger doesn't seem to understand the "this" pointer.


Note: If I print ("write(*,*) var_name" )out the variable values, the correct values are written to the screen.

Edited code below is similar to what I am running


module FSM_module

implicit none

integer, parameter :: fpx = 4

type :: sed_reactor_type

integer :: number_layers

real(kind=fpx) :: area

real(kind=fpx), dimension(:), allocatable :: flow_
real(kind=fpx), dimension(:), allocatable :: width_
real(kind=fpx), dimension(:), allocatable :: d_

real(kind=fpx), dimension(:), allocatable :: conc_
real(kind=fpx), dimension(:), allocatable :: dss_
real(kind=fpx), dimension(:), allocatable :: fd_

real(kind=fpx) :: concTop = 0
real(kind=fpx) :: concBottom = 0
real(kind=fpx) :: fluxTop = 0
real(kind=fpx) :: fluxBottom = 0


contains

procedure :: set_flow => FSM_set_flow

procedure :: set_conc => FSM_set_conc

....................................

end type

private :: FSM_set_flow, FSM_set_conc

contains



subroutine FSM_set_width(this, values, srp)

class(sed_reactor_type) :: this
real(kind=fpx), dimension(*) :: values
type(sed_reactor_type), pointer :: srp
integer :: n

real(kind=fpx) :: depth = 0;

this%width_(0) = values(1)
do n=1, this%number_layers
this%width_(n) = values(n)
this%d_(n) = depth
depth = depth + values(n)
end do
this%width_(this%number_layers+1) = values(this%number_layers)

end subroutine FSM_set_width


subroutine FSM_set_conc(this, values, srp)

class (sed_reactor_type) :: this
real(kind=fpx), dimension(*) :: values
type(sed_reactor_type), pointer :: srp
integer :: n

this%conc_(0) = values(1)
do n=1, this%number_layers
this%conc_(n) = values(n)
end do
this%conc_(this%number_layers+1) = values(this%number_layers)

end subroutine FSM_set_conc

................................

end module FSM_module

0 Kudos
3 Replies
Terry_Gerald1
Beginner
663 Views
Well, I guess you cant cut and past from visual studio!
0 Kudos
mecej4
Honored Contributor III
663 Views
For pasting code, copy as text at the source, click on the "Insert Code using Syntax Highligher" icon at this forum, and paste in the code, choosing the style (Fortran, C, etc.).

You can edit your previous posts to alter text or to improve readability.
0 Kudos
abhimodak
New Contributor I
663 Views
Hi Terry

Check this post: http://software.intel.com/en-us/forums/showthread.php?t=75442&o=a&s=lr

I think this is a known issue.

Abhi
0 Kudos
Reply