ANY — Any value in MASK along DIM is true#
-
ANY(MASK, DIM)#
ANY(MASK [, DIM])determines if any of the values in the logical arrayMASKalong dimensionDIMare.TRUE..- Parameters:
MASK – The type of the argument shall be
LOGICALand it shall not be scalar.DIM – (Optional)
DIMshall be a scalar integer with a value that lies between one and the rank ofMASK.
- Returns:
ANY(MASK)returns a scalar value of typeLOGICALwhere the kind type parameter is the same as the kind type parameter ofMASK. IfDIMis present, thenANY(MASK, DIM)returns an array with the rank ofMASKminus 1. The shape is determined from the shape ofMASKwhere theDIMdimension is elided.
- Standard:
Fortran 90 and later
- Class:
Transformational function
- Syntax:
RESULT = ANY(MASK [, DIM])
- Example:
program test_any logical l l = any((/.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 *, any(a .eq. b, 1) print *, any(a .eq. b, 2) end subroutine section end program test_any