| Richard E Maine 2006-01-10, 9:58 pm |
| Paul Van Delst <Paul.vanDelst@noaa.gov> wrote:
> Correctly or not, I always assumed (no pun) that an assumed /size/ dummy
> arg generated a copy when an array subset/triplet was passed as an actual
> arg
Not necessarily. There is no reason to do so when the actual argument is
contiguous. Just because the actual argument is a section, that doesn't
mean it is discontiguous. Some compilers (I thought almost all current
ones by now) check for this distinction rather than doing the same thing
for all sections.
As an aside, I find the terminology "subset" confusing to the extent
that I'm not 100% sure what you mean by it. I assume that you mostly
mean "section", which is what the standard uses (or "slice", which is a
commonly used synonym), but I'm not sure if you are making some finer
distinction. It isn't quite a subset of an array because an array is
more than just a set of elements. (Maybe "subscript", which is parallel
to "triplet" in being part of the notation?) A subscript triplet is just
part of the syntax used to denote a section - it isn't the resulting
object, or even the whole of the syntax.
> But, my question to the IBM people was when an array subset/triplet actual
> arg was passed to a subprogram with an assumed /shape/ dummy arg.
I guess that my question in turn was whether the assumed-shape part of
the question was made explicit to them. For example, it was omitted in
your decription to us, where you said
> Well, I finally pulled my finger out and asked an IBM person. The reply I
> got was that xlf generates array copies for both array subsets and array
> triplets. Even when the array subsets are contiguous.
I know from context that you were talking about assumed shape, but
context can so easily get lost here. Since this doesn't explicitly refer
to assumed shape, and appears to be making some distinction that I don't
understand between a "subset" and a "triplet", it still leaves me
wondering *EXACTLY* what question the IBM person was answering, and
whether he was answering the same question that you intended to ask.
Please note that I'm not actually meaning to critise your wording here
(though I'm aware it might look like it - I hopy you don't mistake my
intent). I'm just trying to determine whether there might have been a
confusion about exactly what the question was. Heck, even if your
wording was perfect, it could have been misheard, as the terms "assumed
shape" and "assumed size" are awfully easy to confuse, and it turns out
that the question makes sense (but often has different answers) for both
cases. In fact, I'd say that the question is more often "at issue" for
assumed size, so it would bee very easy for a person attuned to that
issue to hear the question he expected rather than the one actually
asked, even if you did word it precisely.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
|