Fortran · File status code

IOSTAT 39 — Error During Read

What does IOSTAT 39 — Error During Read mean in Fortran?

A general-purpose code the runtime returns when it detects a problem executing a READ statement that isn't covered by a more specific error (bad data conversion, device I/O failure, etc.) — the read didn't hit end-of-file, it genuinely failed.

IOSTAT 39 — Error During ReadIntel Fortran

Condition

A general-purpose code the runtime returns when it detects a problem executing a READ statement that isn't covered by a more specific error (bad data conversion, device I/O failure, etc.) — the read didn't hit end-of-file, it genuinely failed.

Fix

Add IOSTAT and IOMSG to the READ to capture the specific underlying message, and check the input data's format and the file's health (permissions, disk errors) rather than assuming the source code is at fault.

Pending source verification. Not yet checked against official documentation.

Related file status code