Loops can be given names and an EXIT or CYCLE statement can be made to refer to a particular loop.
0| outa: DO 1| inna: DO 2| ... 3| IF (a.GT.b) EXIT outa ! jump to line 9 4| IF (a.EQ.b) CYCLE outa ! jump to line 0 5| IF (c.GT.d) EXIT inna ! jump to line 8 6| IF (c.EQ.a) CYCLE ! jump to line 1 7| END DO inna 8| END DO outa 9| ...
The (optional) name following the EXIT or CYCLE highlights which loop the statement refers to.
Loop names can only be used once per program unit.
For more information, click here