READ io-implied-do object list
Mike Toews
mwtoews@gmail.com
Mon Jun 3 00:28:00 GMT 2013
On 3 June 2013 04:30, Tobias Burnus <burnus@net-b.de> wrote:
> Am 02.06.2013 15:22, schrieb Mike Toews:
>> impdo.f90:13.34:
>>
>> read(55,*,end=384) na,rtemp,((ia(i),ra(i)),i=1,na)
>> 1
>> Error: Expected variable in READ statem
>
> That line looks invalid to me.
> ...
> And "(ia(i),ra(i))" is not a variable according to R602 - nor an
> io-implied-do.
>
> Hence, it is invalid.
I found the issue. The original statement uses parentheses to group
the output variables of the DO list. Removing these appears to fix the
code:
read(55,*,end=384) na,rtemp,(ia(i),ra(i),i=1,na)
is valid for all of the compilers available to me. With the compilers
where parentheses were supported, the outputs are identical to when
they are removed.
So a better question: is it valid to group variables of a DO list in
parentheses? Other compilers support this feature, so I'm not sure if
it is part of a more general definition of a "list" or an "object
list".
> You could use a complex array to read in complex values - instead of one
> for real and one for imaginary values.
The data are not complex. There are two arrays (integer and real) with
the same length.
-Mike
More information about the Fortran
mailing list