Home > Archive > Fortran > May 2005 > SGI: OPEN ( ...,IOSTAT=ierr)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
SGI: OPEN ( ...,IOSTAT=ierr)
|
|
| clusardi2k@aol.com 2005-05-25, 8:57 pm |
| Hello,
On an SGI computer, I'd like some information about IOSTAT error
codes? Where can I get this information. There is no
/usr/include/fioerr.f file on my system.
What is the return code for file not found?
Thank you,
Christopher Lusardi
| |
| Richard E Maine 2005-05-25, 8:57 pm |
| In article <1117047316.345644.114970@o13g2000cwo.googlegroups.com>,
clusardi2k@aol.com wrote:
> On an SGI computer, I'd like some information about IOSTAT error
> codes? Where can I get this information. There is no
> /usr/include/fioerr.f file on my system.
>
> What is the return code for file not found?
I don't know the answer for SGI. (Oh, and as an aside, this kind of
thing depends on the compiler rather than just the computer brand. There
are multiple compilers that run on SGI systems; they might have
different answers.)
But.... I know how to "cheat". Write a 4-line program like
program cheat
open(10,file='no-such-file',status='old',iostat=iostat)
write (*,*) iostat
end
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| Paul Van Delst 2005-05-25, 8:57 pm |
| clusardi2k@aol.com wrote:
> Hello,
>
> On an SGI computer, I'd like some information about IOSTAT error
> codes? Where can I get this information. There is no
> /usr/include/fioerr.f file on my system.
>
> What is the return code for file not found?
>
> Thank you,
> Christopher Lusardi
>
From the online SGI techpubs:
-------------------begin
1.2.1.8. IOSTAT= Control Specifier
[...blah blah blah....intro stuff]
You can obtain an online explanation of an error identified by the IOSTAT variable value.
To do this, join the returned value with its group name, shown in the following list, and
use the resulting string as an argument to the explain(1) command. For example:
explain lib-5000
Table 1-2. Message number identifiers
Message number Group name Source of message
----------------------------------------------------------------
4000 through 4999 lib Fortran library
5000 through 5999 lib Flexible File I/O (FFIO) library
See intro(2) for explanations of messages numbered less than 4000 and greater than 89999.
----------------------end
So, if you get an IOSTAT error output of 4005 in your Fortran code, type
explain lib-4005
at your SGI window prompt to get an explanation. E.g.:
origin:/home/paulv : explain lib-4005
A READ operation on an internal file tried to read past the end-of-file.
A Fortran READ operation tried to read beyond the end of the internal file,
and neither an END nor an IOSTAT specifier was included on the internal READ
statement.
Either 1) add an END=s specifier (s is a statement label) and/or an IOSTAT=i
specifier (i is an integer variable) to the READ statement, or 2) modify the
program so that it does not read beyond the end of the internal file.
Because this is an end-of-file condition, the negative of this error number
is returned in the IOSTAT variable, if specified.
For more information, see the description of internal records and files in
your Fortran reference manual.
The error class is UNRECOVERABLE (issued by the run-time library).
Oh, and you may need to set the LANG environment variable in your .profile like so:
export LANG=C
(or whichever flavour for your particular shell type). Without this, the "explain" command
usually doesn't work right.
cheers,
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
| |
| Richard E Maine 2005-05-25, 8:57 pm |
| In article <d72nei$j8p$1@news.nems.noaa.gov>,
Paul Van Delst <paul.vandelst@noaa.gov> wrote:
> clusardi2k@aol.com wrote:
[color=darkred]
> From the online SGI techpubs:
[elided]
Note that while this is indeed "some information" about the error codes,
it provides the inverse mapping from the one that the OP asked about.
This tells how to get the description of a particular iostat number. It
doesn't tell how to find out what number would correspond to a
particular kind of error.
(Unless, of course, one inverts the map by exhaustive listing, which can
be done, but would probably be a bit tedious for this application.)
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| Paul Van Delst 2005-05-25, 8:57 pm |
| Richard E Maine wrote:
> In article <d72nei$j8p$1@news.nems.noaa.gov>,
> Paul Van Delst <paul.vandelst@noaa.gov> wrote:
>
>
>
>
>
>
>
>
> [elided]
>
> Note that while this is indeed "some information" about the error codes,
> it provides the inverse mapping from the one that the OP asked about.
> This tells how to get the description of a particular iostat number. It
> doesn't tell how to find out what number would correspond to a
> particular kind of error.
Yep, I realise that, but it's a start. More exhaustive searches of the SGI techpubs
website may yield the required info (but I doubt it).
Besides, the forward mapping is the more common usage.
> (Unless, of course, one inverts the map by exhaustive listing, which can
> be done, but would probably be a bit tedious for this application.)
Only a bit:
i1=4000
i2=5000
rm blah
while [ $i1 -le $i2 ]; do
cmd="explain lib-${i1}"
echo $cmd >> blah
$cmd >> blah
i1=`expr $i1 + 1`
done
Examining "blah" afterwards:
explain lib-4050
The file must exist prior to OPEN if STATUS is 'OLD'.
An OPEN statement with a STATUS of 'OLD' is expecting that the specified file
already exists.
Either ensure that the file exists before the OPEN (check the FILE specifier)
or change STATUS to 'NEW' or 'UNKNOWN'.
See the description of the OPEN statement in your Fortran reference manual.
This error message is no longer issued in CrayLibs 3.0 and later releases.
The error class is UNRECOVERABLE (issued by the run-time library).
I think I might save that "blah" file. :o)
cheers,
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
| |
| Richard E Maine 2005-05-25, 8:57 pm |
| In article <d72r42$m1a$1@news.nems.noaa.gov>,
Paul Van Delst <paul.vandelst@noaa.gov> wrote:
> This error message is no longer issued in CrayLibs 3.0 and later releases.
Hmm... One would assume then that later versions issue some other
message, since the same kinds of error conditions are still going to
exist.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| Greg Lindahl 2005-05-26, 3:57 am |
| In article <d72r42$m1a$1@news.nems.noaa.gov>,
Paul Van Delst <paul.vandelst@noaa.gov> wrote:
>I think I might save that "blah" file. :o)
Yep, as long as you delete the 23 dead messages you'll find in it...
-- greg
|
|
|
|
|