READ io-implied-do object list

Mike Toews mwtoews@gmail.com
Sun Jun 2 13:23:00 GMT 2013


Hi all,

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 statement at (1)

(The error is pointing to the first parenthesis, before ia). The
intended operation of the program should read the first line of
in.dat, where na=5 and rtemp=3.14, then the implied DO loop reads na=5
values from 5 lines of in.dat to arrays ia and ra.

I'm not sure if this statement is following any standards (I have
borrowed some terminology in this email from ISO/IEC 1539-1:2010).
Should this be expected to work with gfortran?

-Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: impdo.f90
Type: application/octet-stream
Size: 513 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130602/cff6b170/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: in.dat
Type: application/octet-stream
Size: 144 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130602/cff6b170/attachment-0001.obj>


More information about the Fortran mailing list