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: Tobias Burnus <burnus at net-b dot de>
- To: Mike Toews <mwtoews at gmail dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Sun, 02 Jun 2013 18:30:26 +0200
- Subject: Re: READ io-implied-do object list
- References: <CAM2FmMqQAYEWO7V73Tq16kw8HhHVCWERFiLmT+49JVDj1FRM4A at mail dot gmail dot com>
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