- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I stumbled upon compiler allowing internal procedure passed as argument. I believe the standard prohibits doing so. The snippet below would thus compile without error and actual steps into subroutine Model from program Test.
Abhi
===
Program TestImplicit None
Integer, Parameter :: N = 5
External :: Library
Call Library(N, Model)
Contains
Subroutine Model(n)
Implicit None
Integer, Intent(IN) :: n
Print *, n
End Subroutine Model
End Program Test
Subroutine Library(n, Model)
Implicit None
Integer, Intent(IN) :: n
Interface
Subroutine Model(n)
Integer, Intent(IN) :: n
End Subroutine Model
End Interface
Call Model(n)
End Subroutine Library
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an extension to F2003 that we support. It is standard-conforming in F2008. Note that the standard describes a standard-conforming program. If you compiled this with standards checking, you'd see:
t.f90(8): warning #7601: F2003 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4). [MODEL]
Call Library(N, Model)
----------------^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, quite right. Thanks!
Abhi

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