(j3.2006) Select Rank

Whitlock, Stan stan.whitlock
Sat Feb 14 11:59:03 EST 2015


I'm not advocating a new feature at this late date but I don't see Bill's suggestion as getting me very far.  In:

  select case (rank(A))

  case (1)
  ...
  case (2)
  ...

  end select

in case (1) I can't say:

	A (4) = 1		! assuming A has a 4th element

But we could probably define SELECT RANK so you could say:

  select rand (A)

  case (1)
 	A (4) = 1
  case (2)
	A (2,3) = 1
  end select rank

/Stan

-----Original Message-----
From: j3-bounces at mailman.j3-fortran.org [mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of Bill Long
Sent: Friday, February 13, 2015 8:19 AM
To: Van Snyder; fortran standards email list for J3
Subject: Re: (j3.2006) Select Rank


On Feb 12, 2015, at 6:46 PM, Van Snyder <Van.Snyder at jpl.nasa.gov> wrote:

> A Select Rank construct has been proposed, to go along with 
> Dimension(..).

By whom?  Select Rank was proposed a long time ago and rejected. Instead we have the RANK() intrinsic.   With that you can

  select case (rank(A))

  case (1)
  ...
  case (2)
  ...

  end select

Cheers,
Bill


> 
> It might also be useful independently from Dimension(..), in include 
> files.



More information about the J3 mailing list