Fortran · File status code

IOSTAT 37 — Inconsistent Record Length

What does IOSTAT 37 — Inconsistent Record Length mean in Fortran?

Signaled when a direct-access file is opened without an explicit RECL=, or when RECL= doesn't match the record length the file was actually created with — the runtime can't compute record offsets without a consistent length.

IOSTAT 37 — Inconsistent Record LengthIntel Fortran

Condition

Signaled when a direct-access file is opened without an explicit RECL=, or when RECL= doesn't match the record length the file was actually created with — the runtime can't compute record offsets without a consistent length.

Fix

Always specify RECL= explicitly on direct-access OPEN statements, and make sure it matches the value used when the file was first written (units differ between compilers — words vs. bytes — so double check against the original writer).

Pending source verification. Not yet checked against official documentation.

Related file status code