- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am calling a fortran function from C++ code in a try/catch block. For certain inputs, I get the following RTL error:
forrtl: severe (64): input conversion error, unit -5, file Internal Formatted Read
I would like to catch this error, and any others, in the C code and print a message like "the Fortran function had an error" to a file.
My code is :
try
{
retval = CHARMM(); // The fortran function
switch (retval) {
case 0: fprintf(stderr, "SUCCESS - Charmm exited with code %i. ", retval);
break;
.....
}
catch ( ... ) // Catch any errors
{
fprintf(stderr,"Charmm caused an exception! ");
}
Right now I am just looking for any exception, but if possible would like more information. This code has been able to catch other error caused by the function, stack overflow for example, but doesn't seem to catch any RTL errors. Is this possible?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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