Fortran · File status code
What does IOSTAT 0 — Successful Completion mean in Fortran?
The value IOSTAT= is set to when the READ, WRITE, OPEN, or CLOSE statement completed with no error, no end-of-file, and no end-of-record condition. It is the only value guaranteed by the standard to mean 'nothing went wrong' — every other value (positive or negative) signals some condition worth handling.
The value IOSTAT= is set to when the READ, WRITE, OPEN, or CLOSE statement completed with no error, no end-of-file, and no end-of-record condition. It is the only value guaranteed by the standard to mean 'nothing went wrong' — every other value (positive or negative) signals some condition worth handling.
Nothing to fix; use this as the baseline in IF (IOSTAT == 0) checks and treat any nonzero result as needing a branch into error or end-of-file handling.