[J3] [EXTERNAL] [BULK] Re: RANK clause
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Mon Jun 16 11:23:15 UTC 2025
The price of electrons has dramatically reduced since the introduction of the ability to override the bounds spec with the array-spec, perhaps it is now worthy of consideration for obsolescence?
* Tom
[signature_3405561309]<https://www.nasa.gov/>
Thomas Clune
Lead, Software Infrastructure
Global Modeling and Assimilation Office
NASA Goddard Space Flight Center
MS 610.1
8800 Greenbelt RD, Greenbelt, MD 20771
Thomas.L.Clune at nasa.gov<mailto:Thomas.L.Clune at nasa.gov>
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of John Reid via J3 <j3 at mailman.j3-fortran.org>
Date: Monday, June 16, 2025 at 5:01 AM
To: Robert Corbett via J3 <j3 at mailman.j3-fortran.org>
Cc: John Reid <john.reid9 at talktalk.net>
Subject: [EXTERNAL] [BULK] Re: [J3] RANK clause
CAUTION: This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.
Robert Corbett via J3 wrote:
> I think there is a problem. the first sentence of subclause 8.5.17 states
>
> An entity declared with a RANK clause has the specified rank.
>
> In my example, the RANK clause specifies rank 0, but the entity decl specifies that the entity has rank 1.
But the entity is not declared with the rank clause. This has been
overridden by the array-spec in x4(4).
Cheers,
John.
>
> Bob Corbett
>
>> On Jun 15, 2025, at 3:14 PM, John Reid via J3 <j3 at mailman.j3-fortran.org> wrote:
>>
>> Robert Corbett via J3 wrote:
>>> A related case might be interesting. The standard appears to allow
>>>
>>> REAL, RANK(0) :: X4(4)
>>>
>>> I do not know if that was intended.
>> This is allowed by 8.2:
>> "The type declaration statement also specifies the attributes whose keywords appear in the attr-spec, except that
>> the DIMENSION attribute can be specified or overridden for an entity by the appearance of array-spec in its
>> entity-decl, and ..."
>>
>> I do not see any problem with this.
>>
>> John.
>>> Bob Corbett
>>>
>>>>> On Jun 15, 2025, at 10:18 AM, Robert Corbett via J3 <j3 at mailman.j3-fortran.org> wrote:
>>>> Constraint C815 appears to cover this case. Both the DIMENSION attr-spec and the RANK clause specify the DIMENSION attribute of an entity.
>>>>
>>>> The constraint you suggest might add clarity and consistency, but it seems to be an editorial change.
>>>>
>>>> Bob Corbett
>>>>
>>>>> On Jun 15, 2025, at 7:20 AM, John Reid via J3 <j3 at mailman.j3-fortran.org> wrote:
>>>>>
>>>>> Dear all,
>>>>>
>>>>> For a type declaration statement (R801) we have this constraint
>>>>>
>>>>> C801 (R801) The same attr-spec shall not appear more than once in a given type-declaration-stmt.
>>>>>
>>>>> However we have added the rank-clause, which specifies the DIMENSION attribute.(8.1.17). Does this not mean that we need a constraint such as
>>>>>
>>>>> C8xx A rank-clause shall not appear in a type-declaration-stmt that has a DIMENSION clause.
>>>>>
>>>>> Or have I missed something?
>>>>>
>>>>> Here is an example that should be noticed as an error at compile time, IMHO
>>>>>
>>>>> real, rank(3), dimension(10) :: a
>>>>>
>>>>> Cheers,
>>>>>
>>>>> John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250616/03c193ff/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 25179 bytes
Desc: image001.png
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250616/03c193ff/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 275 bytes
Desc: image002.png
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250616/03c193ff/attachment-0001.png>
More information about the J3
mailing list