Error: Invalid form of array reference at (1)

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Tue Feb 8 21:37:00 GMT 2011


On 2011-02-08 22:10, Tobias Burnus wrote:
> Am 08.02.2011 21:43, schrieb Steve Kargl:
>> 1
>> Error: Invalid form of array reference at (1)
>>
>>
>> So, yes, your lines are too long. IMNSHO, anything over
>> 80 characters is too long.
>
> The Fortran standard allows only 132 characters in free-form source code
> and 72 in fixed-form source code. Thus, it is not surprising that you
> get such an error exactly in column 132. As Steve already wrote, you
> should split long lines using an ampersand (&) as last character in the
> line which should be continued.
>
> Alternatively, you can ask gfortran to accept longer line lengths using,
> e.g., -ffree-line-length-none (or -ffree-line-length-<n> where "<n>" is
> a number).

Also, you will get a warning if you compile with "-Wall".  I have no 
idea why it's not the default behavior, at least for free-form source 
code where no punching-card logic applies.

Cheers,
- Tobi



More information about the Fortran mailing list