Alvaro,
Thanks for the answer. To shed some light on what I am doing: I am
operating on small arrays of three elements (that correspond to 3D
Cartesian vectors). The function I mentioned transforms the elements of
the vector according to some simple scheme and returns the new vector.
Your suggestion to use a global array could be one way around my
problem. The other, that I already implemented, is to redesign the
function into a subroutine, so that it modifies the argument it gets:
SUBROUTINE vector_subroutine(v)
IMPLICIT NONE
REAL*8, DIMENSION(3), INTENT(INOUT) :: v
v(:) = ...
RETURN
END
With such an arrangement the temp arrays are not created. Moreover this
is probably more standard-compliant way of doing things. Isn't it ?
Best regards,
Lukasz
Dnia 2009-10-27, wto o godzinie 09:25 -0700, Alvaro Fernandez pisze:
> One possibility is to have the function return a pointer to a globally
> visible array. That's the short version of what you need to do. :-)
> The long version is you put the array in a module, and the functions
> you are working on point at appropriate array sections. Depending on
> the details of what you're trying to do, you may need to keep
> additional info in the module for bookkeeping purposes, e.g. integer
> counters for where the next free section of your work array is.
>
> There are also other considerations, such as modifying the attributes
> of the dummy arguments in your existing functions so they accept
> pointers as arguments. But this is the general approach I would
> follow.
>
> Alvaro
>
>
> ______________________________________________________________________