(j3.2006) Cosubscripts for an image

Van Snyder Van.Snyder
Tue Dec 29 19:35:14 EST 2015


I was recently asked how to compute the cosubscripts of a coarray for a
specified image.

THIS_IMAGE calculates the cosubscripts for the coarray for the invoking
image.  Did we provide a way to specify the image, perhaps using a
different function?  I don't remember there being one.

If not, THIS_IMAGE needs an optional IMAGE agument to specify the image
index for which cosubscripts are desired.  Unfortunately, now that we've
split the definition for THIS_IMAGE, it cannot be done.  Therefore, a
new function is needed that provides all the cosubscripts for a coarray
and a specified image.

Along the same line, we should provide analogs for ordinary arrays.  It
is not easy to provide a function that computes the array element order
position for a specified element of an array, or that computes the
subscripts for an array that correspond to a specified array element
order position.  One needs to do it for every type, kind, and rank.

It would have been a tiny bit simpler if IMAGE_INDEX had accepted only
one coindexed-object argument instead of a coarray and an array of
cosubscripts.  A function that computes array-element order position
ought to accept ony one array-element argument, not an array and an
array of subscripts.





More information about the J3 mailing list