- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you pass a subroutine SUB as a dummyargumentto other subroutines, you can define it as EXTERNAL, or, even better, define a INTERFACE block in these calling subroutines.
Is it possible to havethis INTERFACE block defined in a module, so that the INTERFACE block doesn't have to be explicitly written for each of the calling subroutines? When I try to do this I get the following error message:
"Error: The same named entity from different modules and/or program units cannot be referenced. "
I don't want to have to type the INTERFACE block for SUB for each of my subroutines (SUB is an error handling subroutine and therefore is called by a very large number of subroutines in my libraries). On the other hand I want to make sure that the syntax of SUB (which is written by the user and linked with my libraries) is correct (so that the linker detects possible problems).
What's the best way to do this?
Thanks,
Olivier
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[plain]module mymod abstract interface subroutine extsub_int (a,b) integer a real b end subroutine extsub_int end interface end module mymod subroutine callit (extsub, a, b) use mymod procedure(extsub_int) :: extsub integer a real b call extsub (a,b) end[/plain]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess right now I am stuck with explicitly including the interface blocks (maybe usingan INCLUDE statement - although I am not too found of this solution).
Thanks Steve!
Olivier

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