Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

Fortran Runtime Library (forrtl) error numbers and iostat values

$
0
0

Hi,
I am working on improving error handling in my codes, and have ran into some questions:

1) When reading a file, I want to check “iostat” values to see whether EOF is reached (IVF seems to set "iostat=-1" for EOF condition).

Is there some named/parameterised value that can be used instead of hardcoding "-1"?

I’d like something similar to "FOR$IOS_ENDDURREA" (forrtl=24), but for iostat values instead.

And some follow on questions - would appreciate some general guidance:

2) I noticed that in some cases the "iostat" error numbers match "forrtl" numbers, but sometimes not.  Are there any rules on how/why/when they do or don’t match? Can you suggest a good practice for using these facilities in a robust and portable way?

3) Any comments on exception handling in general in Fortran?  Does anyone have some simple examples?  And what do people use? Forrtl error numbers?  Or IEEE modules?

Thanks in advance!
Tom


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>