mikrom,
Thanks for the response. To me, "external" contains no information of the subroutine. My understanding is: "external" can be anything and the language leave this room for the linker. I don't know for sure why there is a seg fault. But I'd expect this is due to the FORTRAN standard...
mikrom,
Yes, I agree. But it doesn't compile if I make interface generic. For example
subroutine poly(another_subroutine, A)
class(*), intent(inout) :: A
interface another_subroutine
subroutine another_subroutine(AA)
class(*), intent(inout) ::AA
endsubroutine
subroutine another_subroutine(AA)...
Thanks for your time and response mikrom. But I think there is some misunderstand here. In your example code, you shown that "a subroutine can take unlimited polymorphic types as imput parameters". My question is "Is it possible to make subroutine take unlimited polymorphic subroutines as well...
I am programming with FORTRAN oop features. Now I have a subroutine which takes another subroutine as its argument. But I want the subroutine takes unlimited polymorphic subroutine as the argument as well as normal subroutine. For example I have:
subroutine PassFunc(MyFunc, MyInput)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.