Software Archive
Read-only legacy content
17061 Discussions

Allocatable arrays in types

lucaletizia
Beginner
827 Views
Hi,

I would like to know whether the FORTRAN 6.6A patch allows to have an allocatable array in a user defined type .
So far the only way of allocate the dimension of an array in a type at run time was to use Pointer, Dimension, but it gives some problems when communicating with C++

Thanks Luca
0 Kudos
3 Replies
Steven_L_Intel1
Employee
827 Views
Yes, it does, but you'll have the same problem in that the descriptor used is the same as for POINTER.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
827 Views
We use Cray (Integer) Pointers for just that purpose, which are basically the same as C pointers [and declare structure members as INTEGER(PTR_KIND) -- there's now intrinsic IIRC SELECTED_PTR_KIND()]. The code for accessing is not so elegant but it better fits to C++ than tweaking array descriptors on C++ side.

Jugoslav
0 Kudos
Steven_L_Intel1
Employee
827 Views
INT_PTR_KIND is the intrinsic.

Steve
0 Kudos
Reply