Fortran Modern alternatives to historical features Non-block DO constructs


Example

The non-block do construct looks like

    integer i
    do 100, i=1, 5
100 print *, i

That is, where the labelled termination statement is not a continue statement. There are various restrictions on the statement that can be used as the termination statement and the whole thing is generally very confusing.

Such a non-block construct can be rewritten in block form as

    integer i
    do 100 i=1,5
      print *, i
100 continue

or better, using an end do termination statement,

integer i
do i=1,5
  print *, i
end do