[J3] [EXTERNAL] Question about MOVE_ALLOC

Malcolm Cohen malcolm at nag-j.co.jp
Fri Mar 10 01:20:14 UTC 2023


> On a related note, there may be a problem with some intrinsics that already do allow assumed-rank.   E.g., for SHAPE:

 

No, there is no problem at all, as that is an intrinsic enquiry function and SOURCE is its first argument.

 

> I would hope the Arguments description would be a bit more explicit in such instances

 

Contrariwise, I would hope that the Arguments description do not witter on unnecessarily.

 

> E.g., for SIZE() it is explicitly acknowledged:

> 

>ARRAY shall be assumed-rank or an array.

 

No, it is not explicitly acknowledged. “array” does not include assumed-rank, because assumed-rank includes scalar, and SIZE is otherwise not permitted to be applied to scalars.

 

ASIDE: There are a few wandering “assumed-rank array” occurrences in the standard, but the defining text uses “assumed-rank entity” and/or “assumed-rank dummy data object”. A pity we did not fix these earlier.

 

Anyway, back to SIZE: if SIZE were permitted to be used on scalars, as I believe /GENERICS would find useful (despite the name of the argument), it would not need to have that. Though given the name of the argument, we’d probably make it “may be scalar, assumed-rank, or an array”. 

 

Cheers,

-- 

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

 

From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Clune, Thomas L. (GSFC-6101) via J3
Sent: Friday, March 10, 2023 6:14 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>; j3 <j3 at j3-fortran.org>
Cc: Clune, Thomas L. (GSFC-6101) <thomas.l.clune at nasa.gov>
Subject: Re: [J3] [EXTERNAL] Question about MOVE_ALLOC

 

On a related note, there may be a problem with some intrinsics that already do allow assumed-rank.   E.g., for SHAPE:

 

SOURCE shall be a scalar or array of any type. It shall not be an unallocated allocatable variable or a pointer

21 that is not associated. It shall not be an assumed-size array.

 

Nothing there that indicates assumed-rank is permitted.  And yet:

 

Result Value. The result has a value whose ith element is equal to the extent of dimension i of SOURCE,

27 except that if SOURCE is assumed-rank, and associated with an assumed-size array, the last element is equal to

28 −1.

 

Which implies that assumed-rank is permitted.    I would hope the Arguments description would be a bit more explicit in such instances

 

E.g., for SIZE() it is explicitly acknowledged:

 

ARRAY shall be assumed-rank or an array. It shall not be an unallocated allocatable variable or a pointer

10 that is not associated. If ARRAY is an assumed-size array, DIM shall be present with a value less

11 than the rank of ARRAY.

 

 

From: J3 <j3-bounces at mailman.j3-fortran.org <mailto:j3-bounces at mailman.j3-fortran.org> > on behalf of j3 <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> >
Reply-To: j3 <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> >
Date: Thursday, March 9, 2023 at 3:59 PM
To: j3 <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> >, j3 <j3 at j3-fortran.org <mailto:j3 at j3-fortran.org> >
Cc: "Clune, Thomas L. (GSFC-6101)" <thomas.l.clune at nasa.gov <mailto:thomas.l.clune at nasa.gov> >
Subject: Re: [J3] [EXTERNAL] Question about MOVE_ALLOC

 

Van,

 

There are lots of intrinsics that should/need to be modified to allow assumed-rank arrays.   This is targeted for F202Y.    (On a related note, I’ve started a document that identifies intrinsics that should be extended to allow scalars, and hope to submit that as a paper to DATA in the near future.)

 

For the other intrinsics that do allow assumed-rank arrays, it is explicitly mentioned,  so I think it is clear that MOVE_ALLOC does not currently allow assumed-rank.   

 

If there is something in particular about MOVE_ALLOC, that warrants earlier treatment than others, please elaborate.  

 

I.e., I see this as an extension, not an interp.

 

-          Tom

 

From: J3 <j3-bounces at mailman.j3-fortran.org <mailto:j3-bounces at mailman.j3-fortran.org> > on behalf of j3 <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> >
Reply-To: j3 <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> >
Date: Thursday, March 9, 2023 at 2:46 PM
To: j3 <j3 at j3-fortran.org <mailto:j3 at j3-fortran.org> >
Cc: Van Snyder <van.snyder at sbcglobal.net <mailto:van.snyder at sbcglobal.net> >
Subject: [EXTERNAL] [J3] Question about MOVE_ALLOC

 

Are the FROM and TO arguments to MOVE_ALLOC allowed to be assumed-rank arrays?

 

If not, does this need an interp?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230310/1d9269a7/attachment.htm>


More information about the J3 mailing list