Neil Carlson wrote:
>I have a practical "best practice" question that is a consequence
>of actual implementations. In the simple assignment
>
> array = array_valued_function(...)
>
>
...
> It would be much better
>to provide a subroutine variant of the function in which the
>array was passed as an argument and filled directly. Comments?
>
It is a reasonable implementation for the compiler internally to convert
such functions into subroutines with one extra argument for the result.
Whether that extra argument is the lhs or a temp depends on what is in
(...). If one of the arguments is the same array as the lhs, then you
will normally need separate storage for that argument and the result, so
a temp will be created for the result.
Cheers,
Bill
>--
>Neil Carlson <[log in to unmask]>
>
>
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
|