Manual Reference Pages  - iall (3fortran)

NAME

IALL(3) - [BIT:LOGICAL] Bitwise and of array elements

SYNOPSIS

result = iall(array [,mask]) | iall(array ,dim [,mask])

         integer(kind=KIND) function iall(array,dim,mask)

integer(kind=KIND),intent(in) :: array(*) integer(kind=**),intent(in),optional :: dim logical(kind=**),intent(in),optional :: mask(*)

CHARACTERISTICS

o a kind designated as ** may be any supported kind for the type
o ARRAY must be an integer array
o MASK is a logical array that conforms to ARRAY of any logical kind.
o DIM may be of any integer kind.
o The result will by of the same type and kind as ARRAY.

DESCRIPTION

IALL(3) reduces with a bitwise and the elements of ARRAY along dimension DIM if the corresponding element in MASK is .true..

OPTIONS

o ARRAY : Shall be an array of type integer
o DIM : (Optional) shall be a scalar of type integer with a value in the range from 1 TO N, where N equals the rank of ARRAY.
o MASK : (Optional) shall be of type logical and either be a scalar or an array of the same shape as ARRAY.

RESULT

The result is of the same type as ARRAY.

If DIM is absent, a scalar with the bitwise all of all elements in ARRAY is returned. Otherwise, an array of rank N-1, where N equals the rank of ARRAY, and a shape similar to that of ARRAY with dimension DIM dropped is returned.

EXAMPLES

Sample program:

    program demo_iall
    use, intrinsic :: iso_fortran_env, only : integer_kinds, &
     & int8, int16, int32, int64
    implicit none
    integer(kind=int8) :: a(2)

a(1) = int(b’00100100’) a(2) = int(b’01101010’)

print ’(b8.8)’, iall(a)

end program demo_iall

Results:

     > 00100000

STANDARD

Fortran 2008

SEE ALSO

IANY(3), IPARITY(3), IAND(3)

fortran-lang intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 iall (3fortran) April 28, 2024
Generated by manServer 1.08 from 9cadb8b1-fc2f-4642-a214-4519fd02e53d using man macros.