Fortran · File status code

IOSTAT 25 — Record Number Outside Range

What does IOSTAT 25 — Record Number Outside Range mean in Fortran?

Occurs on a direct-access READ or WRITE when the REC= value specified falls outside the range of record numbers that exist (or are legal) for that file, such as a negative record number or one beyond the highest record written so far.

IOSTAT 25 — Record Number Outside RangeIntel Fortran

Condition

Occurs on a direct-access READ or WRITE when the REC= value specified falls outside the range of record numbers that exist (or are legal) for that file, such as a negative record number or one beyond the highest record written so far.

Fix

Validate the record number against the file's known extent (e.g. via INQUIRE) before issuing the READ/WRITE, and guard against off-by-one errors in loop bounds that compute REC=.

Pending source verification. Not yet checked against official documentation.

Related file status code