- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I want to watch values of vDataType(i), in debugging mode when the cursor is inside subroutine SR1. But when the cursor is inside SR1 in Watch Window says "Undefined array/pointer vDataType" for vDataType. What happens? How i can see these values when i'm in debugging mode?
Module M1
Use M2
Contains
Subroutine SR1
Allocate vDataType(100)
Do i = 1, 100
Read(1,*) vDataType(i).fA, vDataType(i).fB, vDataType(i).fC
End Do
End Surboutine SR1
End Module M1
Module M2
Type User
Real(8) :: fA, fB, fC
End Type User
Type(User), Allocatable :: vDataType (:)
End Module M2
Thank you in advance!
PS. I'm using Intel Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.0.3451.2008
I want to watch values of vDataType(i), in debugging mode when the cursor is inside subroutine SR1. But when the cursor is inside SR1 in Watch Window says "Undefined array/pointer vDataType" for vDataType. What happens? How i can see these values when i'm in debugging mode?
Module M1
Use M2
Contains
Subroutine SR1
Allocate vDataType(100)
Do i = 1, 100
Read(1,*) vDataType(i).fA, vDataType(i).fB, vDataType(i).fC
End Do
End Surboutine SR1
End Module M1
Module M2
Type User
Real(8) :: fA, fB, fC
End Type User
Type(User), Allocatable :: vDataType (:)
End Module M2
Thank you in advance!
PS. I'm using Intel Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.0.3451.2008
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the watch window type m2::vDataType then the debugger definitely knows thatthe array is in the module m2
Les
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It sounds as if the Fortran debug expression evaluator is not working for you. In the Locals window, do the types for the locals display as Fortran types (eg. REAL(4)) or as C types ("float", etc.)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using Module M2 in order to define Global Variables. The method that Les proposed worked.... You have to write (in the watch window) the module that variable belongs...
Thanks Les!
I have one more question:
Suppose the following
Module M1
Use M2
Contains
Subroutine SR1
Allocate vDataType(100)
Do i = 1, 100
Read(1,*) vDataType(i).fA, vDataType(i).fB, vDataType(i).fC
End Do
Call SR2
End Surboutine SR1
Subroutine SR2
iCounter = 0
Do = 1, 100
If (vDataType(i).fA == 1.0) Then
vDataType(i).fA = 0.0
Else
iCounter = iCounter + 1
vDataType(i).fA = iCounter
End If
End Do
End Subroutine SR2
End Module M1
Module M2
Type User
Integer :: fA, fB, fC
End Type User
Integer :: iCounter
Type(User), Allocatable :: vDataType (:)
End Module M2
When I build the solution writes an error in Output window saying:
"error #6837: The leftmost part-ref in a data-ref can not be a function reference. [VDATATYPE]"
and
"error #6158: The structure-name is invalid or is missing. [VDATATYPE]"
Why? How i can pass vDataType(:) values in Subroutine SR2?
Thanks Les!
I have one more question:
Suppose the following
Module M1
Use M2
Contains
Subroutine SR1
Allocate vDataType(100)
Do i = 1, 100
Read(1,*) vDataType(i).fA, vDataType(i).fB, vDataType(i).fC
End Do
Call SR2
End Surboutine SR1
Subroutine SR2
iCounter = 0
Do = 1, 100
If (vDataType(i).fA == 1.0) Then
vDataType(i).fA = 0.0
Else
iCounter = iCounter + 1
vDataType(i).fA = iCounter
End If
End Do
End Subroutine SR2
End Module M1
Module M2
Type User
Integer :: fA, fB, fC
End Type User
Integer :: iCounter
Type(User), Allocatable :: vDataType (:)
End Module M2
When I build the solution writes an error in Output window saying:
"error #6837: The leftmost part-ref in a data-ref can not be a function reference. [VDATATYPE]"
and
"error #6158: The structure-name is invalid or is missing. [VDATATYPE]"
Why? How i can pass vDataType(:) values in Subroutine SR2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It should be % not "dot"
vDataType(i)%fa
Les
vDataType(i)%fa
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mariospapa, I agree that % should be used rather than ., but ifort accepts either.
It is clear that you have retyped the source you posted as it contains several syntax errors. I often find that when users do this, the code they post isn't close enough to the actual code to show the problem. Please post actual code and then show it being compiled. When I fix the errors in your posted code, it compiles fine.
It is clear that you have retyped the source you posted as it contains several syntax errors. I often find that when users do this, the code they post isn't close enough to the actual code to show the problem. Please post actual code and then show it being compiled. When I fix the errors in your posted code, it compiles fine.

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