- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a Fortran project has a "NaN" problem. This project has both SUN SOLARIS version and W2K CVF version. Under SUN, I correct it by compare this variable to it self like this:
IF ( this value .NE. this value ) THEN
this value = 0.0
END IF
Then my project worked well under SUN. However, after I did the same thing under CVF, it still crashed after running for a while. And this time I have an error message of:
run time error M6201: MATH
- sqrt: DOMAIN error
When I tried to using CVF debugger to trace it, I can stop right there wher it crashes. The debugger would quit and went back to CVF, and gave me a bunch message of "no matching symbolic information found" and together with the following error messages:
The thread 0x4F0 has exited with code 3 (0x3).
The program 'C:francf2dDebugf2d.exe' has exited with code 3 (0x3).
I am really confused about this for a while. Can anyone help me a little?
Thanks!
IF ( this value .NE. this value ) THEN
this value = 0.0
END IF
Then my project worked well under SUN. However, after I did the same thing under CVF, it still crashed after running for a while. And this time I have an error message of:
run time error M6201: MATH
- sqrt: DOMAIN error
When I tried to using CVF debugger to trace it, I can stop right there wher it crashes. The debugger would quit and went back to CVF, and gave me a bunch message of "no matching symbolic information found" and together with the following error messages:
The thread 0x4F0 has exited with code 3 (0x3).
The program 'C:francf2dDebugf2d.exe' has exited with code 3 (0x3).
I am really confused about this for a while. Can anyone help me a little?
Thanks!
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The x .ne. x trick is not reliable. Use the ISNAN intrinsic function (Sun has something similar).
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried use ISNAN. It compiled ok, but when I ran it, it crashed immediately, with the error message of:
First-chance exception in f2d.exe: 0xC0000005: Access Violation.
The thread 0x58C has exited with code -1073741667 (0xC000009D).
The program 'C:francf2dDebugf2d.exe' has exited with code -1073741667 (0xC000009D)
Could you please tell me about these messages?
Thanks.
First-chance exception in f2d.exe: 0xC0000005: Access Violation.
The thread 0x58C has exited with code -1073741667 (0xC000009D).
The program 'C:francf2dDebugf2d.exe' has exited with code -1073741667 (0xC000009D)
Could you please tell me about these messages?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(x /= x) will be optimized away by Intel compiler defaults, but it should work with /Op (Windows) or -mp (linux). So, you could build a function of your own like isnan(), if you make certain to compile with those options and prevent any IPO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see that I answered for the newer compilers. With CVF, you could do a similar thing by compiling your (x /= x) code separately with less than standard optimization. /fltconsistency may be sufficient, but you should check it; perhaps /optimize:0 as well.
There is a gulf here between the commercial compilers, most of which optimize away such expressions, and the most often used linux compilers, like gcc/g77, where they can only be optimized away with -ffast-math.
There is a gulf here between the commercial compilers, most of which optimize away such expressions, and the most often used linux compilers, like gcc/g77, where they can only be optimized away with -ffast-math.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you got an access violation, you have a different problem. I suggest reading my article on the topic to get you started on resolving this.
Steve
Steve

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