Subject: RESEND: Re: HPF array constructors questions

From: David Loveman <[email-masked]>
Date: Tue, 30 Jun 92 09:49:08 PDT

My best guess answers to your questions:

- - ----------
E.g.,   Will the HPF array constructor syntax follow
        F90's "(/  /)" notation and implicit DO style ?

	  iota = (/ (i,i=1,n) /)

	Or the more compact CMFortran:

	  iota = [ 1:n ]
- - ----------
There is no "HPF array constructor," just the Fortran 90 array constructor.

The "[ . . . ]" notation is from Fortran 8x and is not a part of
Fortran 90, thus should be considered a non-standard extension.  It is
also supported by MasPar Fortran, DECmpp Parallel Fortran, and is
planned to be in DEC Fortran 90.

Array constructors that are initialization expressions can be initial values, as in
     integer, dimension(n) :: iota = (/ (i,i=1,n) /)

- - ----------
E.g., Is this ok ? (n,k are runtime values):

	a_complex_vector * cmplx( (/ i,i=2,n,k /) )

	a_complex_vector * cmplx( [ 2:n:k ] )
- - ----------
Array constructors can have runtime values.

- - ----------
E.g., Is this ok ? (m,n are runtime values):

	FORALL( i=1:n ) fred(i,:) = (i-1)*m + (/ i,i=1,m /) 

	FORALL( i=1:n ) fred(i,:) = (i-1)*m + [ 1:m ]
- - ----------
The array constructor is syntactically incorrect, and should be (/
(i,i=1,m) /).  When fixed up, it causes my compiler to die painfully
(thanks for the test case)

- - ----------
E.g., Is this ok ? (m,n are runtime values):    

	fred = RESHAPE( (/ i=1,m*n /) , (/ n,m /) )

	fred = RESHAPE( [1:m*n] , [n,m] )
- - -----------
Syntax error, array constructor should be (/ (i,i=1,m*n) /).  Otherwise seems ok.