- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran ieee_arithmetic facility provides for numerical exception handling. An f2003 version of the examples in Reid's earlier paper is included in the textbook "Fortran 95/2003 explained."
There are several good presentations at the top of my web search results; perhaps you could look at some and refine your extremely broad question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest you write your Fortran code with assertions (for memory allocation errors, argument errors etc...), such that the assert sets an error condition known to your interface. Then have your C++/Java code call a shell C++/ Java function which then calls the Fortran function/subroutine and tests the known error condition and throws an error if necessary
void YourExposedInterface()
{
hiddenExceptionCode = NoExceptionOccured;
YourHiddenInterface();
if(hiddenExceptionCode == NoExceptionOccured)
return;
throw(hiddenExceptionCode);
}
The degree of which errors are caught will depend upon the degree of your exception coding in your Fortran library.
Note, you can also have your Fortran code call C++/Java support routines (via similar shell function technique) that then captures exception conditions that are otherwise difficult to handle in Fortran.
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page