title: Checking all elements of array for a logical condition in fortran
body: <p>I want to check all rows of an array for a logical condition. I used function <code>ALL</code> as described in GNU GCC guide <a href="https://gcc.gnu.org/onlinedocs/gfortran/ALL.html" rel="nofollow">https://gcc.gnu.org/onlinedocs/gfortran/ALL.html</a></p>
  
  <p>Here is a sample code:</p>
  
  <pre><code>program test3
  implicit none
  real, allocatable, dimension (:,:) :: mat1
  integer :: i,j,k,r
  logical :: lg
  r=3
  allocate(mat1(r,r))
  mat1=transpose( reshape( (/-1,-2,-3,-4,-5,-6,-7,-8,-9/), (/3,3/)))
  lg=all (abs(mat1)&lt;10,1)
  write (*,*) lg
  end program
  </code></pre>
  
  <p>In this program, I want to check whether absolute value of all elements along all rows is less than 10. But I am getting error </p>
  
  <pre><code>lg=all (abs(mat1)&lt;10,1)
  Error: Incompatible ranks 0 and 1 in assignment
  </code></pre>
  
  <p>Any idea about this error or how to do this check? </p>