Re: Argument of subroutine is an array of unfixed length.




"Rich Townsend" <rhdt@xxxxxxxxxxxxxxxxxxx> wrote in message
news:d9tvkb$h9v$1@xxxxxxxxxxxxxxxxxxxxxxx
> David Frank wrote:
>> integer :: a(6) = [1:6]
>
> Is [1:6] standard sytax for some form of implied do-loop initialization?
>

Yes its now standard notation for enumerating array initializations.
Note that CVF will allow a REAL array to be declared and integer
initialized,
whether this is standard I know not.
REAL :: a(6) = [1:6] ! a= 1.0 2.0 etc.

>> if (n > 6) then
>
> What is magic about the value 6? How come we can't reverse arrays with a
> size greater than six?
>

Obviously (but perhaps not) I was just demo'ing how to create a error return
and didnt come up with a
suitable error test for you.

>> a = [a(n:1:-1)]
>
> What's the point of the square brackets here?
>

Whoops, you are right they are superfluous in this case.

a = a(n:1:-1) gets the job done here and in previous posting of mine
using encompassing [.....]



.