When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record. The following test program produces a file whose length is 1 when it should be 10.
PROGRAM test OPEN (76, FILE="test.txt", ACCESS="DIRECT", STATUS="NEW", RECL=10) WRITE(76, REC=1) "1" END PROGRAM test -- Summary: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: michael dot a dot richmond at nasa dot gov http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31366