Fortran · Runtime error

Error 24: End-of-file during read

What does Error 24: End-of-file during read mean in Fortran?

A READ statement reached the end of the file with no END= specifier or IOSTAT variable to handle that condition, so the runtime treats it as a fatal error instead of a normal condition to branch on.

Error 24: End-of-file during readIntel Fortran · gfortran

Condition

A READ statement reached the end of the file with no END= specifier or IOSTAT variable to handle that condition, so the runtime treats it as a fatal error instead of a normal condition to branch on.

Fix

Add an IOSTAT= or END= specifier to the READ statement so end-of-file becomes a condition the program checks for deliberately, rather than an unhandled fatal error.

Pending source verification. Not yet checked against official documentation.

Related runtime error