READ io-implied-do object list

Tobias Burnus burnus@net-b.de
Sun Jun 2 16:30:00 GMT 2013


Am 02.06.2013 15:22, schrieb Mike Toews:
> I have some Fortran 90 code from a colleague using another compiler
> which uses an implied DO object list in a READ statement. The program
> compiles with Intel and PGI compilers, but not gfortran. I've boiled
> down the logic into the attached two files. Here is the error (I'm
> using GCC 4.4.6):
>
> $ gfortran impdo.f90
> 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.


Fortran 2008 has:

R910 read-stmt is READ ( io-control-spec-list ) [ input-item-list ]
                         or ...

R916 input-item is variable
                         or io-implied-do

R919 io-implied-do-object is input-item
                         or output-item

Per C934, an input-item is required:

R916 input-item is variable
                         or io-implied-do

And "(ia(i),ra(i))" is not a variable according to R602 - nor an 
io-implied-do.

Hence, it is invalid.


You could use a  complex array to read in complex values - instead of 
one for real and one for imaginary values.


Tobias



More information about the Fortran mailing list