EXIT statement

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


EXIT [ construct-name ]


The EXIT statement completes execution of a DO construct other than a DO CONCURRENT construct. If construct-name is specified, it completes execution of that construct and any nested constructs; otherwise it terminates the innermost DO loop.

In Fortran 2008, the construct-name is permitted to be the name of an ASSOCIATE, BLOCK, IF, SELECT CASE or SELECT TYPE construct. In Fortran 2018, the construct-name is permitted to be the name of a CHANGE TEAM or CRITICAL construct.

On execution, control is transferred to the executable statement following the completed construct. The values of any active DO index variables of the terminated loops are unchanged.


ASSOCIATE construct, BLOCK construct, CHANGE TEAM construct, CONTINUE statement, CRITICAL construct, CYCLE statement, DO construct, DO WHILE statement, END DO statement, IF construct, GO TO statement, SELECT CASE construct, SELECT TYPE construct