My library has modules that specify abstract interfaces for certain subroutines, something like this:
module abstract_module
implicit none
! interface of subroutines
abstract interface
subroutine sub_interface(...)
...
end subroutine
end interface
end module
Now in my program I have written a subroutine, and in order to use it properly, I have to declare it and it works just fine:
program testsub
use abstract_module
...
implicit none
! custom interface
procedure(sub_interface) :: custom
! call the subroutine via another one
call test_call(custom)
end program
Now I'd like to gather all custom subroutines into a module, but I don't know how I could specify that a subroutine is, in fact, adhering to an interface:
module custom_subs
use abstract_module
implicit none
! this does not compile, obviously
abstract interface
procedure(sub_interface) :: custom
end interface
contains
subroutine custom(...)
...
end subroutine
end module
Is there a way of specifying in the module the subroutines as I have done in the program, or do I have to leave them in the program itself?