ALL — All values in MASK along DIM are true#
-
ALL(MASK, DIM)#
ALL(MASK [, DIM])
determines if all the values are true inMASK
in the array along dimensionDIM
.- Parameters
MASK – The type of the argument shall be
LOGICAL
and it shall not be scalar.DIM – (Optional)
DIM
shall be a scalar integer with a value that lies between one and the rank ofMASK
.
- Returns
ALL(MASK)
returns a scalar value of typeLOGICAL
where the kind type parameter is the same as the kind type parameter ofMASK
. IfDIM
is present, thenALL(MASK, DIM)
returns an array with the rank ofMASK
minus 1. The shape is determined from the shape ofMASK
where theDIM
dimension is elided.
- Standard:
Fortran 90 and later
- Class:
Transformational function
- Syntax:
RESULT = ALL(MASK [, DIM])
- Example:
program test_all logical l l = all((/.true., .true., .true./)) print *, l call section contains subroutine section integer a(2,3), b(2,3) a = 1 b = 1 b(2,2) = 2 print *, all(a .eq. b, 1) print *, all(a .eq. b, 2) end subroutine section end program test_all