my_xor Function

private function my_xor(a, b)

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: a
logical, intent(in) :: b

Return Value logical


Source Code

function my_xor(a, b)
    logical                                       :: my_xor
    logical,                intent(in)         :: a
    logical,                intent(in)         :: b

    if (a .and. b) then
      my_xor = .false.
      return
    endif

    if (.not.(a .or. b)) then
      my_xor = .false.
      return
    endif

    my_xor = .true.

end function my_xor