next up previous contents
Next: Scope of DO Variables Up: Control Flow Previous: Indexed DO Loops

Examples of Loop Counts

A few examples of different loops,

  1. upper bound not exact,
        loopy: DO i = 1, 30, 2  
         ... ! 15 iterations
        END DO loopy
  2. negative stride,
        DO j = 30, 1, -2 
         ... ! 15 iterations
        END DO
  3. a zero-trip loop,
        DO k = 30, 1, 2  
         ... ! 0 iterations
         ... ! loop skipped
        END DO
  4. missing stride,
        DO l = 30,1
         ... ! zero-trip loop
        END DO

For more information, click here gif


next up previous contents
Next: Scope of DO Variables Up: Control Flow Previous: Indexed DO Loops

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.