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

Problems with pointer / structures

ferrad
New User
1,124 Views

I'm really confused with what's happening here. I have a main program using a module:

dum.for:
program stest
use dum
implicit none
integer i

nFluids = 2
allocate(nTemps(2))
nTemps(1) = 3
nTemps(2) = 4

allocate(Fluids(nFluids))
do i = 1, nFluids
allocate(Fluids(i)%DataPoints(nTemps(i)))
enddo
Fluids(1)%DataPoints(1) = 1
Fluids(1)%DataPoints(2) = 2
Fluids(1)%DataPoints(3) = 3

end

and dum_mod.for:
module dum

integer :: nFluids
integer, pointer :: nTemps(:) => null()

type FluidType
sequence
integer, pointer :: DataPoints(:) => null()
end type FluidType

type(FluidType), pointer :: Fluids(:) => null()

end module

So I have 2 fluids, the first has 3 datapoints, the second should have 4 datapoints. When I run these in the debugger, just after the allocation of the Fluids array (before the do loop), if I open up Fluids in the watch window, and then open Fluids(1) and Fluids(2), it already shows 2 datapoint entries for each fluid. Firstly, it shouldn't show any entries there yet, since I haven't allocated the datapoint arrays yet. Secondly, after allocating them it still shows 2 and 2, but there are supposed to be 3 and 4 respectively. Why?

And then, later on when I try to assign values to the datapoints, the first gets its value of 1, but the second doesn't get its value of 2, and of course the 3rd isn't shown.

What's going on here? I upgraded to v28, but still have the problem.

Adrian

0 Kudos
8 Replies
ferrad
New User
1,124 Views

Those smiley faces should be ( : )

bracket colon bracket

0 Kudos
Steven_L_Intel1
Employee
1,124 Views
Use the Code button (IE) or
 tags to format code here.

I know there have been some issues looking at allocatable arrays in the debugger that are being worked on. I've seen a problem similar to this before.
0 Kudos
ferrad
New User
1,124 Views

Steve,

You're not very specific about my problem... I have a real problem now in that I cannot look at these allocatable arrays in the debugger. You don't say whether this is a bug in the debugger or whether I'm doing something wrong.

I am starting a new project and wouldlike use F90 constructs, however if I can't see them in the debugger, that pretty much makes them useless to me, and so I have to go back to F77. Alternatively I have to scrap Intel and go back to CVF.

These are both very big decisions, and I'd appreciate some guidance / workarounds.

Thanks,

Adrian

0 Kudos
Steven_L_Intel1
Employee
1,124 Views
It's a bug and it's being worked on. You're not doing anything wrong that I can see. I'd recommend that you submit this to Intel Premier Support to make sure it gets the proper attention.
0 Kudos
ferrad
New User
1,124 Views
Thanks, I have submitted to Premier Support. Any idea of how long this will take to fix?
Adrian
0 Kudos
Steven_L_Intel1
Employee
1,124 Views
Sorry, I don't.
0 Kudos
larsm
Beginner
1,124 Views

Something similar, which I have pointed out before...

Isn't there anyone out there but me that misses the capability of the Array Viewer to display arrays with pointer attributes declared in a derived type, like the ones in this example? It works fine in the CVF Array Viewer.

Maybe, it's in the pipeline?

Lars

0 Kudos
Steven_L_Intel1
Employee
1,124 Views
I'd be surprised if it didn't. I suggest you ask over in the Array Visualizer forum, though I know that John Readey is on vacation for a few weeks.
0 Kudos
Reply