This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/37294] Namelist I/O to array character internal units
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2008 09:11:40 -0000
- Subject: [Bug libfortran/37294] Namelist I/O to array character internal units
- References: <bug-37294-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2008-08-31 09:11 -------
"9.3 Internal files"
"(2) A record of an internal file is a scalar character variable."
"(3) If the file is a scalar character variable, it consists of a single record
whose length is the same as the length of the scalar character variable. If the
file is a character array, it is treated as a sequence of character array
elements."
I'm not sure that one necessarily has always to write:
1)&STUFF
2)N= 123,
3)/
I think NAG f95 does it standard conform and sensible:
With: character(30) :: line(3)
1) &STUFF N = 123/
2)
3)
With: character(10) :: line(3) ! or 15
1) &STUFF
2) N = 123/
3)
With: character(9) :: line(3)
1) &STUFF
2) N = 123
3) /
With: character(8) :: line(3)
1) &STUFF
2) N =
3) 123/
gfortran (and g95) print:
Fortran runtime error: End of record
when the data does not fit into a single record/array element.
(I don't know how to decide without to many CPU cycles when to start a new
record.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294