- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to call a function f1(a). by using
CALL F1(A)
In this functionA is a REAL *4
where as in F1 Function argument required is REAL*8
When A goes into F1 it is showing as some null data.
Currently I am calling F1(A) as F1(DBLE(A)). which is solving the problem.
Is there any setting that I need to make it passed with out using DBLE function.
Thanks for your help
Chandra.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No. Fortran requires that arguments match in type, kind and rank. Use of DBLE is certainly one approach, and perhaps the most reasonable. If the called function writes back to the argument, however, you'll want another solution, such as assigning to a variable of the matching type and then passing that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have chosena normal f77 way of doing this. If you mean, is there a way to emulate platforms of 35 years ago where you could pass a single precision value to a double precision argument with a relativeerror of about 1e-6 (taking a big risk in the case where the value is modified), the answer is no.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to call a function f1(a). by using
CALL F1(A)
In this functionA is a REAL *4
where as in F1 Function argument required is REAL*8
When A goes into F1 it is showing as some null data.
Currently I am calling F1(A) as F1(DBLE(A)). which is solving the problem.
Is there any setting that I need to make it passed with out using DBLE function.
Thanks for your help
Chandra.
You can do this using generic interface. You would create a generic interface for F1 and then two specific interfaces such ason as F1_single and F1_double where one accepts the single precision argument and the other accepts the double precision argument. The IVFdocumentation illustrates how do do this.
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page