We've kicked this question around before, and not come to a reliable
answer:
Is there a way to associate a rank-k (k > 1) pointer to a (piece of) a
rank-1 object?
One can use a rank-1 object as an actual argument associated with a
rank-k dummy argument of assumed size, providing the interface of the
procedure is not explicit, or it lies and says the dummy argument is
rank-1 and assumed size.
It seems that returning a pointer to the dummy argument doesn't work.
If both the actual argument and the dummy argument have the TARGET
attribute, and the dummy argument has assumed size, when execution of the
procedure completes the pointer association status of a pointer associated
with the dummy argument is processor dependent.
If the dummy argument has the TARGET attribute but the actual argument
does not, any pointers associated with the dummy argument become undefined
when the procedure completes.
In the case that's uninteresting for me (because it doesn't let me lie
about the rank), that is, when both the actual and dummy argument have the
TARGET attribute and the dummy argument has assumed shape, any pointers
associated with the dummy argument remain associated with the dummy
argument when the procedure completes.
All of this is in subclause 12.4.1.1 of the Fortran 95 standard.
I don't want to take a copy because the vector has 10 million elements.
Thanks in advance for any ideas.
--
What fraction of Americans believe | Van Snyder
Wrestling is real and NASA is fake? | [log in to unmask]
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Dan Goldin, Bill Clinton, the Pope, or anybody else.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|