(j3.2006) Select Rank

Bill Long longb
Tue Feb 17 17:38:55 EST 2015

On Feb 17, 2015, at 4:10 PM, Robert Corbett <robert.corbett at oracle.com> wrote:

> On 02/17/15 13:49, Bill Long wrote:
>> On Feb 17, 2015, at 3:37 PM, Van Snyder<Van.Snyder at jpl.nasa.gov>  wrote:
>>> Borrowing from SELECT TYPE:
>>> select rank ( A )
>>> case ( 1 )
>>>  a(4) = 1
>>> case ( 2 )
>>>  a(2,3) = 1
>>> end select
>>> See R841 in 15-007: the "<associate-name>  =>" part is optional.  So this
>>> isn't a radical departure from current practice.
>> Allowing A to appear with one subscript in one place and two in another is an extremely radical departure from current practice.  That problem is what the alternatives are intended to solve.
> Although I hate adding a feature to the language at this point in the process, I 
> see that something like SELECT RANK is needed if assumed rank arrays are to be 

The ?if? is important. When assumed-rank was introduced, it was explicitly specified to not be usable in Fortran codes. 

> used in Fortran codes.  I prefer the approach suggested by Van to the approaches 
> suggested by Bill.  I see no problem with a construct name having different 
> ranks in different blocks.

The A is a variable that is an array.  How many places in the standard do we assume that the number of subscripts in an array element designator is the same as the declared rank of the array?  Do we really think that the edits to implement this feature would address all of those places?   Not to mention internal compiler variable descriptions that incorporate this assumption that would face being changed.  [I?m not sure what you mean by ?construct name?.  We have a syntax term <construct-name>, but it has nothing to do with this example. Construct names do not have ranks.]


> Bob Corbett
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Fortran Technical Suport  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101

More information about the J3 mailing list