Sample code for a named loops

regular case:

  jy_loop: &
  do jy=1,numy-1
  end do jy_loop

if the running parameter of the loop has a name that tells nothing, better use the upper bound as a name:

  numsomething_loop: &
  do i=1,numsomething
  end do numsomething_loop

If a similar loop appears more than once in a program unit:

  secondjy_loop: &
  do jy=1,numy-1
  end do secondjy_loop

Reason for not putting the name in the same line as the DO: make the do more easily recognisable
Reason for not indenting the continuation line: let DO and END DO be aligned

Last modified 6 years ago Last modified on Jul 3, 2015, 3:42:49 PM
hosted by ZAMG