int4_2D_or_int4_2D Function

public function int4_2D_or_int4_2D(a, b) result(r)

Bitwise 'OR' over two 2D integer array of kind 4

Arguments

Type IntentOptional AttributesName
integer(kind=4), intent(in), dimension(:, :):: a
integer(kind=4), intent(in), dimension(:, :):: b

Return Value integer(kind=4), dimension(:, :),allocatable


Called by

proc~~int4_2d_or_int4_2d~~CalledByGraph proc~int4_2d_or_int4_2d int4_2D_or_int4_2D interface~operator(.or.) operator(.or.) interface~operator(.or.)->proc~int4_2d_or_int4_2d

Contents

Source Code


Source Code

        function int4_2D_or_int4_2D(a, b) result(r)
          !< Bitwise 'OR' over two 2D integer array of kind 4
            implicit none
            integer(kind=4), dimension(:, :), intent(in) :: a
            integer(kind=4), dimension(:, :), intent(in) :: b
            integer(kind=4), dimension(1:2) :: na, nb
            integer(kind=4), dimension(:, :), allocatable :: r
            na = shape(a)
            nb = shape(b)
            if ((na(1) /= nb(1)) .or. (na(2) /= nb(2))) then
                print *, "Error: Sizes of arrays being 'or'ed should be the same."
                stop
            end if
            allocate(r(1:na(1), 1:na(2)))
            r = ior(a, b)
        end function int4_2D_or_int4_2D