Viewing array components in a derived type in Array Visualizer

Viewing array components in a derived type in Array Visualizer

Converting from CVF to IVF I discovered that I cannot view arrays that are components of a derived type in the Array Visualizer, when debugging, which was a great help in CVF.

The IVF Help info states: "You cannot view arrays of derived type using either of these methods.", which I interpret as something different, but I guess it means what I stated above.

Is this true, and in that case, are there any plans to implement it?

Best wishes

Lars M

4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Yes it's true that support for viewing arrays of derived types is not implemented. We currently don't have any plans to implement it; till now I don't think we've had anyone request this feature!

If you would file a feature request with Premier Support, that would help us better track this. (And you will get notified once it's available.)

It is possible to add some code to your program so that arrays of derived types can be displayed with Array Visualizer. See the sample program: Array Visualizer/Samples/Fortran/Simple.

John

Im not sure that we are discussing the same thing.

Just to make it clear:

My concern is to be able to view an array component of a derived type when debugging a normal Fortran program like this:

.

.

.

TYPE mytype

REAL, DIMENSION(1:100) :: a

END TYPE mytype

.

.

.

TYPE(mytype) :: b

.

. Define b somehow here.

.

How can view b%a in the debugger here?

.

.

.

Im sure this must be a common case and will be even more so when the parameterized derived types and object-oriented features from Fortran 2003 will be implemented.

It works very well in CVF (I can just type in b%a). How do you do the corresponding thing here? It seems overkill to have to declare an array of the same type and shape, that is not in a derived type, and assign b%a to it, to be able to view it in the debugger. Have I missed something trivial?

Best wishes

Lars M

Yes, we're talking about the same thing. Currently in IVF you can't use "View Array" on any derived type even if the type consists just of an array. I agree that this is a common usage; we'll work on adding support for this in a future release.

As a stop-gap you can add some calls to the AV library to view the array. It's not as convenient as clicking "View Array", but it's not that many lines of code. Take a look at the attachment "derivedtype.f90".

John

Faça login para deixar um comentário.