(j3.2006) Coarray enquiry intrinsics

Steidel, Jon L jon.l.steidel
Tue May 30 16:37:05 EDT 2017

Hi Malcolm,

Given that in the case of an array, lbound (x) is [10, 30, 50] but lbound (x%c) is {1, 1, 1], what is the implication on image selectors for the coarray counterpart.

If we declare the following:

  REAL c
TYPE(t) x[10:20, 30:40, 50:*]

is x[10, 30, 50]%c  the same as  x%c[1, 1, 1]?

It would seem we'd want the same cobounds for a coarray which is a subobject of a coarray to be the same as the cobounds for the coarray which it is a subobject of.  Whether we allow a subobject of a coarray that is a coarray as the argument to LCOBOUND or not, we need to answer what the cobounds are for said subobject so that we know how to interpret image selectors for subobjects of coarrays.

From: j3-bounces at mailman.j3-fortran.org [mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of Malcolm Cohen
Sent: Monday, May 29, 2017 3:22 AM
To: 'fortran standards email list for J3' <j3 at mailman.j3-fortran.org>
Subject: (j3.2006) Coarray enquiry intrinsics

Hi folks,


Program junk
  Type t
    Real c
  End Type
  Type(t) x[10:20,30:40,50:*]
  Do i=1,3
    Print *,Lcobound(x%c,i)
  End Do
  Print *,Lcobound(x)
  Print *,Lcobound(x%c)
End Program

Since a subobject of a coarray is a coarray (unless vector subscripts are involved), this would appear to be a valid program.  It does seem pretty daft though.  Did we really intend to allow things like Lcobound(x%c) when X is a coarray (and C is not a pointer, but could be either nonpointer nonallocatable or an allocated allocatable)?

So far I am 1=Yes, 1=No by asking other compilers...

This seems especially interesting as in the array case,
   Type(t) y(10:20,30:40,50:99)
   Print *,Lbound(y)
we get the answers "1 1 1".  The "1=Yes" compiler produces the answer (for LCOBOUND) "10 30 50".  But since it's not coindexable anyway, and we have no way of "copying" the cobounds to something that is coindexable, the correct answer for the lower cobounds of X%C is an interesting philosophical question with no ramifications other than the return value of LCOBOUND...

..............Malcolm Cohen, NAG Oxford/Tokyo.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20170530/918ddc65/attachment.html 

More information about the J3 mailing list