When reading a "dos" file, gfortran returns two records for each line in the file: the real record and a null one. In other words it is treating the carriage return as a newline instead of the pair carriage return/newline as the newline. Here is an example:
integer ios character buf*(50) c open(10,file='dos',iostat=ios) print *,' open ios ',ios 1000 read(10,'(a)',iostat=ios) buf if(ios .ne.0) go to 9000 print '(a,a,a)',' read <',buf,'>' go to 1000 c 9000 end -- Summary: GFORTRAN input and carriage returns Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ray at ultramarine dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24919