This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: READ io-implied-do object list
- From: Mike Toews <mwtoews at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 3 Jun 2013 12:27:14 +1200
- Subject: Re: READ io-implied-do object list
- References: <CAM2FmMqQAYEWO7V73Tq16kw8HhHVCWERFiLmT+49JVDj1FRM4A at mail dot gmail dot com> <51AB7322 dot 9020700 at net-b dot de>
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