Intel® Fortran Compiler 17.0 Developer Guide and Reference
Statement: Marks the end of a program unit. It takes one of the following forms:
END [PROGRAM [program-name]]
END [FUNCTION [function-name]]
END [SUBROUTINE [subroutine-name]]
END [MODULE [module-name]]
END [SUBMODULE [module-name]]
END [BLOCK DATA [block-data-name]]
In main programs, function subprograms, and subroutine subprograms, END statements are executable and can be branch target statements. If control reaches the END statement in these program units, the following occurs:
In a main program, execution of the program terminates.
In a function or subroutine subprogram, a RETURN statement is implicitly executed.
The END statement cannot be continued in a program unit, and no other statement in the program unit can have an initial line that appears to be the program unit END statement.
The END statements in a module or block data program unit are nonexecutable.
C An END statement must be the last statement in a program
C unit:
PROGRAM MyProg
WRITE (*, '("Hello, world!")')
END
C
C An example of a named subroutine
C
SUBROUTINE EXT1 (X,Y,Z)
Real, Dimension (100,100) :: X, Y, Z
END SUBROUTINE EXT1