Re: Passing Selected Contiguous Elements of Arrays ??



In article <hdqpiq$li6$1@xxxxxxxxxxxxxxxx>,
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:

Well, one way is to use assumed shape which can process non-contiguous
arrays fairly easily. (Though possibly slower due to cache effects.)

The Fortran 77 way is to pass both the actual dimension for all
except the rightmost, in addition to the subarray dimensions.
(Which still works in later versions as assumed size or explicit
size.)

The above "cache effect" comment applies equally to both situations.
That is, it is due to the effect of noncontiguous addressing on the
hardware rather than to the differences in the two features of the
language.

Also, on some compilers the assumed shape approach is more flexible.
For example, a TRANSPOSE() expression in an actual argument might be
done simply with dope vector manipulation rather than creating a copy,
while the f77 approach would always require an explicit copy. You can
verify this with the (nonstandard) loc() function; it surprised me the
first time I saw a compiler do this.

$.02 -Ron Shepard
.


Quantcast