program main implicit none call dispatch(p1, 111) contains subroutine dispatch(p, n) ! 再帰的な手続きに RECURSIVE が付いていない。 interface subroutine p end subroutine end interface integer, intent(in) :: n integer x(1000, 1000) x = n print *, 'Hello', x(1, 1) call p print *, 'Goodbye', x(1, 1) end subroutine subroutine p1 call dispatch(p2, 999) end subroutine subroutine p2 print *, 'Hello World' end subroutine end program