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

Re: pointer to pointer

Jugoslav_Dujic
Valued Contributor II
254 Views
Hmm, Crays? Since Crays are basically C pointers in a somewhat different package, you could do something with them (having a *p1 and **p2), but that will be a real pain in the neck to get written correctly, and the resulting code will be awful... double indirection in C is ugly enough, but with Fortran Crays it would be a real horror.

Have you tried the following approach? It is not semantically identical to your sample, but it does provide automatic association:
TYPE T
   WHATEVER, POINTER:: data
END TYPE T
...
TYPE(T):: p1
TYPE(T), POINTER:: p2
WHATEVER, TARGET:: ta, tb
...
p1%data => ta
p2 => p1
WRITE(*,*) p2%data
p1%data => tb
WRITE(*,*) p2%data


Jugoslav
0 Kudos
0 Replies
Reply