Consider the following example,
PROGRAM Thingy IMPLICIT NONE ..... CALL OutputFigures(NumberSet) ..... CONTAINS SUBROUTINE OutputFigures(Numbers) REAL, DIMENSION(:), INTENT(IN) :: Numbers PRINT*, "Here are the figures", Numbers END SUBROUTINE OutputFigures END PROGRAM Thingy
Internal subroutines lie between CONTAINS and END PROGRAM statements and have the following syntax
SUBROUTINE < procname >[ (< dummy args >) ]< declaration of dummy args >
< declaration of local objects >
...
< executable stmts >
END [ SUBROUTINE [< procname > ] ]
Note that, in the example, the IMPLICIT NONE statement applies to the whole program including the SUBROUTINE.
For more information, click here