integer,dimension(6) :: ar ar = (/1,3,4,5,6,7/) if(any(ar > 4) then # returns true if any element of ar is greater than 4 call a_miracle_happens_here endif