Re: pointer to pointer

Re: pointer to pointer

Jugoslav Dujic's picture

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

Jugoslav www.xeffort.com
1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.