The EXIT statement causes execution of a specified DO loop to be terminated. Execution continues at the first executable statement after the loop terminus.
do-const-name is the name of a DO construct that contains the EXIT statement.
If do-const-name is omitted, the EXIT statement applies to the innermost DO construct in which the EXIT statement appears.
Exampleinteger :: i, j outer: do i=1, 10 inner: do j=1, 10 if (i < j) then exit ! exits inner else if (i > j) then cycle else write(*,*) i,j exit outer end if end do inner end do outer