- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I am using IVF 11.072 compiler in vista 32 bit.
When I invokedIMSL libcalls in double precision, i did not get correct values.
I changed my calls to single precision and I got some meaningful values.
Is this a known issue? or am i missing something?
Code snippet & debugged values:
d1 = EI(1.15) ------>2.304 (correct)
d2 = E1(1.3) ------->0.135(correct)
d11 = DEI(1.15) ----> -2.508 ??? (out of sync with intel documentation)
d12 = DE1(1.3) ---> 723.073 ??? (out of sync with intel doc)
Regards
Praba
I am using IVF 11.072 compiler in vista 32 bit.
When I invokedIMSL libcalls in double precision, i did not get correct values.
I changed my calls to single precision and I got some meaningful values.
Is this a known issue? or am i missing something?
Code snippet & debugged values:
d1 = EI(1.15) ------>2.304 (correct)
d2 = E1(1.3) ------->0.135(correct)
d11 = DEI(1.15) ----> -2.508 ??? (out of sync with intel documentation)
d12 = DE1(1.3) ---> 723.073 ??? (out of sync with intel doc)
Regards
Praba
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A test case would be helpful - or even the promised code snippet. Which USE statement did you use to make the declarations available? Since I have to guess, I'd guess that you called a double precision routine without anything to declare it as double precision. But there are other possibilities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
A test case would be helpful - or even the promised code snippet. Which USE statement did you use to make the declarations available? Since I have to guess, I'd guess that you called a double precision routine without anything to declare it as double precision. But there are other possibilities.
PROGRAM FULLWAVE
USE NUMERICAL_LIBRARIES
IMPLICIT REAL*8 (A-H, O-Z)
external fun
x= 1.15
y = 1.3
d1 = EI(1.15)
d2 = E1(1.3)
d11 = DEI(x)
d12 = DE1(y)
temp = fun(x,y)
stop
end
real*8 FUNCTION fun(x,y)
IMPLICIT REAL*8 (A-H, O-Z)
d1 = EI(1.15)
d2 = E1(1.3)
d11 = DEI(1.15)
d12 = DE1(1.3)
fun = 1.0
return
end
Addendum:
compile option:
/nologo /debug:full /Od /I"C:Program FilesIntelCompiler11.072fortranmklinclude" /I"C:Program FilesVNIimslfnl600IA32includeDLL" /I"C:Program FilesVNIimslfnl600IA32includeSTATIC" /module:"Debug" /object:"Debug" /traceback /check:bounds /libs:static /threads /dbglibs /c
Link option:
/OUT:"DebugDelme.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:Program FilesIntelCompiler11.072fortranmklia32lib" /LIBPATH:"C:Program FilesVNIimslfnl600IA32lib" /MANIFEST /MANIFESTFILE:"D:PrabaTaskDelmedebugdelme.exe.intermediate.manifest" /DEBUG /PDB:"D:PrabaTaskDelmedebugdelme.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"D:PrabaTaskDelmedebugdelme.lib" nag_nag_MT.lib user32.lib imsl.lib imslsuperlu.lib imslhpc_l.lib imsls_err.lib imslmpistub.lib mkl_c.lib libguide.lib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need the USE NUMERICAL_LIBRARIES in the subroutine as well. Without it, EI and E1 are treated as REAL*8 rather than the REAL*4 they really are.
I will strongly suggest that you remove all IMPLICIT lines and replace them with the combination of IMPLICIT NONE and explicit declarations for all your variables. You will find yourself wasting less time on errors such as this if you do so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
You need the USE NUMERICAL_LIBRARIES in the subroutine as well. Without it, EI and E1 are treated as REAL*8 rather than the REAL*4 they really are.
I will strongly suggest that you remove all IMPLICIT lines and replace them with the combination of IMPLICIT NONE and explicit declarations for all your variables. You will find yourself wasting less time on errors such as this if you do so.
Thank you Steve! Your suggestion works fine!
Still I am not convinced about one aspect:
I use many functions which call IMSL routines.
I am forced to type "USE..." in all these functions instead of main function alone.
I am thinking loud here.... sqrt() is another lib function like IMSL.
Function sqrt() accepts both single/ double float values as arg.
Function dsqrt() accepts only double float value as its arg.
But in IMSL, DEI() accepts only double float as its arg &
EI() accepts only single float as its arg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - pchidamb
Thank you Steve! Your suggestion works fine!
Still I am not convinced about one aspect:
I use many functions which call IMSL routines.
I am forced to type "USE..." in all these functions instead of main function alone.
That issue can be solved by putting all your functions/subroutines within a module, and placing the "USE..." statement at the top of that module.
Quoting - pchidamb
I am thinking loud here.... sqrt() is another lib function like IMSL.
Function sqrt() accepts both single/ double float values as arg.
Function dsqrt() accepts only double float value as its arg.
But in IMSL, DEI() accepts only double float as its arg &
EI() accepts only single float as its arg.
Function sqrt() accepts both single/ double float values as arg.
Function dsqrt() accepts only double float value as its arg.
But in IMSL, DEI() accepts only double float as its arg &
EI() accepts only single float as its arg.
AFAIK, the NUMERICAL_LIBRARIES module was included in the IMSL libs. only for compatibility with Fortran 77, so I wouldn't expect support for generics. For Fortran 90+ (and generics), you can use the IMSL_LIBRARIES module or the, IMHO, not so useful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SQRT is an intrinsic function in Fortran, and is generic. The compiler automatically knows about that. The IMSL routines are not intrinsic - to make them known to the compiler you have to add a USE statement. NUMERICAL_LIBRARIES declares the "F77 interface" versions of these routines, which is ok as long as you understand that. It does not declare generics, but if you USE the module, then you will at least get the proper type. The USE does need to be added to each procedure that calls IMSL, though you can collect your routines into a module and add just one USE - that will change your coding style.
IMSL also provides "Fortran 90" interfaces through individual modules of the form xxx_INT. These declare generics and allow for optional arguments and deferred-shape arrays. This is the preferred coding style, but if you are going to use these modules, you will typically have to change the name of the routine you call and the argument list. Read the IMSL documentation for details.
I'll repeat - relying on implicit typing is not a good idea and will get you into trouble. Get into the habit of adding IMPLICIT NONE all the time.
IMSL also provides "Fortran 90" interfaces through individual modules of the form xxx_INT. These declare generics and allow for optional arguments and deferred-shape arrays. This is the preferred coding style, but if you are going to use these modules, you will typically have to change the name of the routine you call and the argument list. Read the IMSL documentation for details.
I'll repeat - relying on implicit typing is not a good idea and will get you into trouble. Get into the habit of adding IMPLICIT NONE all the time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
SQRT is an intrinsic function in Fortran, and is generic. The compiler automatically knows about that. The IMSL routines are not intrinsic - to make them known to the compiler you have to add a USE statement. NUMERICAL_LIBRARIES declares the "F77 interface" versions of these routines, which is ok as long as you understand that. It does not declare generics, but if you USE the module, then you will at least get the proper type. The USE does need to be added to each procedure that calls IMSL, though you can collect your routines into a module and add just one USE - that will change your coding style.
IMSL also provides "Fortran 90" interfaces through individual modules of the form xxx_INT. These declare generics and allow for optional arguments and deferred-shape arrays. This is the preferred coding style, but if you are going to use these modules, you will typically have to change the name of the routine you call and the argument list. Read the IMSL documentation for details.
I'll repeat - relying on implicit typing is not a good idea and will get you into trouble. Get into the habit of adding IMPLICIT NONE all the time.
IMSL also provides "Fortran 90" interfaces through individual modules of the form xxx_INT. These declare generics and allow for optional arguments and deferred-shape arrays. This is the preferred coding style, but if you are going to use these modules, you will typically have to change the name of the routine you call and the argument list. Read the IMSL documentation for details.
I'll repeat - relying on implicit typing is not a good idea and will get you into trouble. Get into the habit of adding IMPLICIT NONE all the time.
We cannot expect all facilities of generic function from external lib.
Fully agreed!
When I use NAG, i link with include/lib directories only.
When I use IMSL, in addition to include/lib linking, I need to have "USE..." statement.
Will you please throw some light on this difference?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you wish to use IMSL the same way you do NAG, you must follow the same conventions. This means explicit declarations of function names that don't match their implicit type. You must also use the "F77" style routines.
I recommend the USE because this eliminates a major source of errors - it not only properly declares the function type but also specifies the types of the arguments, allowing the compiler to verify them. You don't get that with just function type declarations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
If you wish to use IMSL the same way you do NAG, you must follow the same conventions. This means explicit declarations of function names that don't match their implicit type. You must also use the "F77" style routines.
I recommend the USE because this eliminates a major source of errors - it not only properly declares the function type but also specifies the types of the arguments, allowing the compiler to verify them. You don't get that with just function type declarations.
Thank you very much! This explanation is really convincing!

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