- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
I am experiencing the following run-time error which seems to be untrappable:
run-time error M6201: MATH
- sqrt: DOMAIN error
- sqrt: DOMAIN error
The offending line of code seems to be a call to the IMSL routine DUVMID. This is a simple routine for minimizing a function which, along with its derivative, are assumed to be smooth [1]. The program has been working correctly (IMSL and all) for many other sets of input, but crashes for a particular set of input data.
Note further, no SQRT calls are made within the subroutine containing the IMSL, nor within the function or its derivative routines. An error trap constructed from the appropriate IMSL routines (ERSET,IERCD,...) is completely bypassed during the crash. All routines are written under a "implicit none" statement and all variables are properly initialized. The program is written using CVF 6.6b.
I do have a support email into IMSL, but was curious about whether anyone else experienced similar quirks using IMSL in conjunction with CVF?
Suggestions perhaps?
Suggestions perhaps?
Thanks much!
Richard
[1] IMSL Math Library, Vol 1, Chap 8, (http://www.vni.com/products/imsl/docs/MATH.pdf)
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, IMSL is written in Fortran, so it seems reasonable to me that if an argument is invalid, you could get run-time errors of this nature.
This particular error can occur if the argument to a SQRT is either a negative number or a NaN. I would suggest that you print out the values of the arguments to the IMSL routine and verify that they're all correct.
Please note that technical support for IMSL is not included with CVF. I don't know if VNI will respond to you or not. IMSL supportis included with Intel Visual Fortran Professional Edition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the response Steve.
I did manage to find the spark that was causing the mystery error.
The purpose of DUVMID is to find the location of a function minimum. Left/right boundaries and a guess value are specified in the call and the routine works, in part, by iterating through a sequence of best-subinterval choices. When the interval converges to one of the initial boundary constraints, the subroutine is simply supposed to provide to the user a (level 3) warning that the true minimum may not have been acquired.
My error trap was designed to catch only (level 4) fatal or (level 5) terminal errors, but not(level 3) warnings. As the function was producing a value at a boundary constraint (for one particular set of program inputs) and with a said boundary point asthe new guess-value tothe next call of DUVMID within an enclosing loop,DUVMIDwas just crashingwithout even calling the function. Note also that I had used ERSET(3,0,0) (meaning "don't print or stop for warnings") in the line previous to the DUVMID call. Nevertheless, the program was crashing as if a (level 5) terminal error occured, though it was only throwing a warning. When I lowered the level of my trap to include warnings, the program does not crash, but correctly jumps through the error-reporting hoops that I have written.
So what about the mystery message "- sqrt: DOMAIN"? There must be a SQRT call somewhere within the IMSL black-box, since there are no relevant SQRT's in any of my routines.
Am I correct in saying that the terminal error that is actually thrown as a warning probably needs to be fixed, either in the documentation or in the actual code?
Thanks again.
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not sure, offhand. If you encounter the same problem with Intel Visual Fortran Professional, let us know and we'll investigate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may be able to trap this run-time error by supplying a MATHERRQQ subroutine as described in the CVF docs.
Good Luck,
Gerry T.
Good Luck,
Gerry T.

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