- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a program where many of the subroutines have procedures in the argument list.
Many of the subroutines have the same procedures passed.
Each subroutine has an INTERFACE for explicit declaration of the procedures.
I thought I could put these interfaces in a module and then USE the module in the subroutines.
This failed.
I had to also include the line: PROCEDURE(procname) :: MY_FUNC.
Is this according to the standard?
I have included a sample program that shows the same behaviour.
My compiler is: Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.0.166 Build 20191121
Windows 10.
Regards,
Svein-Atle Engeseth
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On line 20, replace INTERFACE by ABSTRACT INTERFACE, and on line 88 write the correct syntax for IMPORT, and then your program will be OK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you do not specify "ABSTRACT", you are declaring an interface to one specific subprogram such as FUNC. With ABSTRACT, you are declaring an interface to a class of procedures FUNC1, FUNC2,..., all of which have the same interface.
An analogy: we can define a data type. Such a definition does not create any variables of that type, so declarations of variables must also be given. An abstract interface defines the characteristics of a type of procedure, i.e, a procedure code type, rather than data. The procedure(proc) declaration declares one procedure of that type.
I think that the ONLY clause in the IMPORT statement was added for F2018.
![](/skins/images/D3C0B914909A6564BBB97F4AD1ED1973/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page