A program unit which is not an internal subprogram may contain other program units, called internal subprograms.
program prog
implicit none
contains
function f()
end function f
subroutine g()
end subroutine g
end program
Such an internal subprogram has a number of features:
implicit none
is in effect in f
above)Module subprograms and external subprograms may have internal subprograms, such as
module mod
implicit none
contains
function f()
contains
subroutine s()
end subroutine s
end function f
end module mod