Programming-Idioms

History of Idiom 43 > diff from v42 to v43

Edit summary for version 43 :
New Fortran implementation by user [tkoenig]

Version 42

2019-09-26, 16:18:12

Version 43

2019-09-26, 16:45:00

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Illustration

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Illustration
Code
  outer: do j=1, size(m,2)
     do i=1, size(m,1)
        v = m(i,j)
        if (v < 0) then
           print *,v
           exit outer
        end if
     end do
  end do outer