it
call action(mySubX)
if the action looks like
subroutine action(sub)
external sub
interface
subroutine sub(aA, aB)
integer,intent(...) :: aA, aB
end subroutine
end interface
call sub(argA, argB)
provided that he actionknows what to put there as argA, argBfor presentation aA, aB.
Otherwise, if you want to pass arguments as well
call action(mySubX, argA, argB)
subroutine action(sub, argA, argB)
!either - not recommmended, it is old FORTRAN77 style
external sub
!or - recommended
interface
subroutine sub(aA, aB)
integer,intent(...) :: aA, aB
end subroutine
end interface
integer, intent(...) :: argA, argB
call sub(argA, argB)
, , , (, ). FORTRAN77 .
, , , (, ), , :
module subs_mod
contains
subroutine example_sub(aA, aB)
integer,intent(...) :: aA, aB
end subroutine
end module
module action_mod
contains
subroutine action(sub)
use subs_mod
procedure(example_sub) :: sub
call sub(argA, argB)
end subroutine
end module
, , , :
module action_mod
abstract interface
subroutine sub_interface(aA, aB)
integer,intent(...) :: aA, aB
end subroutine
end interface
contains
subroutine action(sub)
procedure(sub_interface) :: sub
call sub(argA, argB)
end subroutine
end module