Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

how to invoke MKL in real*16 data type, and how to write my own dble function using fortran?

Last post 05-13-2008, 5:43 AM by Steve Lionel. 4 replies.
Sort Posts: Previous Next
 05-12-2008, 12:13 PM 30254650  

how to invoke MKL in real*16 data type, and how to write my own dble function using fortran?

Two questions,

(1) Can I invoke functions in MKL in real*16 data type? How to do that?

(2) If I want to write my own "dble" function using fortran, is it possible to do? The difficulty seems to me is that the sent over actual parameter can be arbitrary byte length, say, int, real, complex, etc, but I have to preset the formal parameter to be a specific type ...

Thanks a lot!

 
 05-12-2008, 1:41 PM 30254659 in reply to 30254650  

Re: how to invoke MKL in real*16 data type, and how to write my own dble function using fortran?

1) MKL doesn't support real*16.  If you search the MKL forum, you will find responses to this question.  You could build such subroutines yourself, from public source, and get as much performance as could be achieved if MKL supported them.

2) You could replace the standard dble() intrinsic with a generic function of your own, but it might be better to use your own name for it.  You would supply a function for each case of data types, with an INTERFACE block to define the generic name.

 
 05-12-2008, 2:43 PM 30254669 in reply to 30254650  

Re: how to invoke MKL in real*16 data type, and how to write my own dble function using fortran?

You can extend a generic such as DBLE, but it is not clear to me what you have in mind.  If you wanted to replace the intrinsic DBLE you can do so by defining a generic with specific procedures covering all of the possible argument types.

By the way, if anyone else has to maintain code where you did that, I hope you apply for the "witness protection program" as they will not be happy with you!

Steve

Doctor Fortran: intel.com/software/drfortran
 
 05-12-2008, 4:45 PM 30254673 in reply to 30254669  

Re: how to invoke MKL in real*16 data type, and how to write my own dble function using fortran?

The question about writing one's own dble function is related with the scope what fortran can do. If you think it a bit carefully, you will see that you cannot write your own dble within Fortran 77, simply because of the reason I mentioned before. I don't know whether it could be written using the current Fortran standard.

 

 
 05-13-2008, 5:43 AM 30254708 in reply to 30254673  

Re: how to invoke MKL in real*16 data type, and how to write my own dble function using fortran?

In Fortran 90 you can "write your own DBLE" as a generic with multiple specific procedures.  Fortran 90 even allows you to "add" a case to DBLE that is not covered in the language, for example, DBLE(character-arg) without disturbing the standard meaning for other arguments.

What I read that you wanted was to change the meaning of DBLE so that it returns a type that is not "double precision".  You CAN do that in Fortran 90, but I would strongly urge you not to do so for the sake of program clarity and maintainability.

Steve

Doctor Fortran: intel.com/software/drfortran
 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...