END SUBROUTINE statement

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


<Syntax>

END [ SUBROUTINE [ subroutine-name ] ]

Prior to Fortran 2008, the SUBROUTINE keyword is required for an internal or module subroutine. The blank between END and SUBROUTINE is optional.

<Semantics>

The END SUBROUTINE statement marks the end of a subroutine subprogram, which may be an external subroutine, an internal subroutine or a module subroutine.

Executing an END SUBROUTINE statement returns from the subroutine, exactly as if a RETURN statement had been executed.

<Related>

CALL statement, CONTAINS statement, END statement, RETURN statement, SUBROUTINE statement