PDA

View Full Version : allocatable arrays



jfchessa
06-24-2008, 05:15 PM
I am using gfortran f90. I was wondering can anyone else see allocatable arrays?. They seem to show up as a structure

PeterT-RogueWave
06-25-2008, 08:31 AM
The problem with allocatable arrays in gfortran (and g95, iirc) is long-standing. The basic problem is that hte debug information produced by the compiler is somewhat immature. You're seeing what is basically an intermediate step towards producing the information we expect. The data in the struct you see should be translated into DWARF (the debug interface spec) and then we would be able to translate the data directly, as you see with other F90 compilers. I know one of the the Labs has been working with Red Hat to improve things, and allocatable arrays was on the list, but I don't know if they've addressed this specific issue. If you have a Red Hat subscription, you can check

https://rhn.redhat.com/network/software/channels/packages.pxt?upper=643&lower=624&cid=6007

Which is a beta version of the compiler. That should be released in RH 5.2, but I don't know that the changes have made their way back into the GNU community yet. Or if this specific issue was addressed.

In the meantime, you can dive on the data pointer, and then change the type to agree with the array type and size. For instance, I have a array of 10 int*8 that has just been allocated.

ALLOCATE (ifp(10))

If I dive on ifp after the allocate, and then dive on DATA, I see the corect data for the first element. Change the void type to integer*8 (10) (or $integer_8(10)) and you should see your data.

I hope that helps.

Regards,

jfchessa
06-25-2008, 11:56 AM
Great that works good enough for me :)