- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all!
While running a scientific code (compiled in debug mode (-C -traceback etc.) for testing), i got this error:
forrtl: error (73): floating divide by zero Image PC Routine Line Source libimf.so 4008F337 Unknown Unknown Unknown es_cPIF_debug 08088D34 mover_mp_mmov_shi 97 mover.f90 es_cPIF_debug 080EC442 MAIN__ 220 Main.f90 es_cPIF_debug 0804A869 Unknown Unknown Unknown libc.so.6 4024C37E Unknown Unknown Unknown es_cPIF_debug 0804A751 Unknown Unknown UnknownOk, i thought i was the same scatterbrained. But i found the line the error refers to like
do while( [...] ) ![...] call MMov_mMCC( [...] ) !*** line 97 ![...] end doCan anyone help me understanding? To me, it's a good mystery... Thanks.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think we'd need to see the actual code and not "...". The indications suggest a math library call in there somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without seeing the actual code I can think of a couple of simple things:
1. Check all the argument types and sizes between the actual
subroutine and the call statement.
2. One thing that caught me few times that the compiler does not
catch but segfaults is if something that is defined in a parameter
statement is passed to the subroutine, which tries to change it
by mistake!! I think this should be caught by the compiler rather
then crash.
Umar
1. Check all the argument types and sizes between the actual
subroutine and the call statement.
2. One thing that caught me few times that the compiler does not
catch but segfaults is if something that is defined in a parameter
statement is passed to the subroutine, which tries to change it
by mistake!! I think this should be caught by the compiler rather
then crash.
Umar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler usually does not know that a called routine will try to change the argument. You can give it that information by always using explicit interfaces with INTENT(OUT) if the argument is always written. However, if it is read as well, then INTENT(INOUT) does not permit the compiler to complain as that is not a guarantee that the argument will be written. In any event, you'll get a segmentation fault for this problem, not a zerodivide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, INTENT(INOUT) does allow the compiler to complain; any argument associated with an INTENT(INOUT) dummy argument is required to be definable. (This requirement can be found in clause 5.1.2.3 of the Fortran 95 standard.) It is unspecified intent (i.e., what you get if you don't specify intent) that doesn't allow the compiler to complain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct. Thanks for pointing that out.

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