Re: NaN in intel fortran 9.0 for windows integrated with VS.Net



Hello, bei,

It may be simplest if you raise an error when a floating point exception occurs. Look under Project/Properties/Fortran/Floating Point for the "Exception Handling" setting. Setting this to "Underflow gives 0.0; Abort on other IEEE exceptions" should quickly reveal the source of the problem.

On the other hand, if you are calling a Fortran DLL from .Net (instead of from a Fortran Main program) I think that the above will not work. You may need to introduce a call to FOR_SET_FPE within the Fortran code to enable the exceptions. (I seem to recall that there was a way to set this from the .Net host, but I've forgotten the details.)

Cheers,
Randy


bei wrote:

I am solving some numerical functions under intel fortran 9.0 for
windows integrated with VS.Net .However, my results have a lot of NaN
which I don't know how to handle.Most of my variable are very
small,like e-0003.I am wondering if it's because of my small
variables.Or I have something wrong with my algorithm.If I want to
track the variable which changes to NaN first,how can I do?
Any suggestion and advise about this are highly appreciated.

Best,

Bei

.



Relevant Pages

  • Re: Fortran Error Reporting Requirements (Was: GFORTRAN PROBLEM WITH SAVE STATEMENT)
    ... There is nothing in the Fortran standard that requires a Fortran processor ... It was an error-trapping block structure called the ENABLE block. ... It also had statements that allowed the programmer to force the check of exceptions or to signal an exception at particular points in the code, wherever the CHECK or SIGNAL statements appeared. ... the vendors of Fortran compilers follow the money and right now the people who write the checks value raw speed over robustness. ...
    (comp.lang.fortran)
  • Re: Should I use "if" or "try" (as a matter of speed)?
    ... I used to write Fortran on punch cards, ... and exception handling is relatively heavy-weight compared ... your program dies with a stack trace. ... they can lead to faster code. ...
    (comp.lang.python)
  • Re: catch RaiseException with VB.Net
    ... Proc.startonly throws an exception if it could ... on the return code from your fortran application. ... app2 should notify to app1 that has reached one point. ...
    (comp.lang.fortran)
  • Re: newbie question for reading input file
    ... allowing them in internal READs would have been an exception to a rule that was already complicated enough? ... I/O lists as in Fortran 66, which was changed in Fortran 77. ... It would seem about time to fix this one. ...
    (comp.lang.fortran)
  • Re: Use cases for quiet NaN comparison?
    ... that something has gone fundamentally wrong in a calculation, and the NaN ... having no sane result should produce an exception. ... preferable to raising an exception since the Kriging algorithm ...
    (sci.math)