- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings:
I know how to create a mod file from C function prototypes, but how do I go the other way..... say I have:
I know how to create a mod file from C function prototypes, but how do I go the other way..... say I have:
MODULE MySqrt_API
INTERFACE MySqrt
MODULE PROCEDURE MySqrt_s
MODULE PROCEDURE MySqrt_d
END INTERFACE
CONTAINS
SUBROUTINE MySqrt_s(X, X_ROOT)
IMPLICIT NONE
REAL (KIND=4), INTENT(IN) :: X
REAL (KIND=4), INTENT(OUT) :: X_ROOT
print *, 'Calling real*4 sqrt'
X_ROOT= SQRT(X)
RETURN
END SUBROUTINE MySqrt_s
SUBROUTINE MySqrt_d(X, X_ROOT)
IMPLICIT NONE
REAL (KIND=8), INTENT(IN) :: X
REAL (KIND=8), INTENT(OUT) :: X_ROOT
print *, 'Calling real*8 sqrt'
X_ROOT= DSQRT(X)
!X_ROOT= SQRT(X)
RETURN
END SUBROUTINE MySqrt_d
END MODULE MySqrt_API
What does the function prototype for C look like to get to MySqrt_d and MySqrt_s? And is this a portable solution under IF 9.1 and or IF 11.
By the way the C/C++ will be Microsofts .... still want that debugger :)
Thanks
Carl
Link Copied
0 Replies
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