all_in_set Function

pure function all_in_set(ivals, iset)

returns true if all the elements of ivals are in the set iset

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in), dimension(:) :: ivals
integer(kind=ip), intent(in), dimension(:) :: iset

Return Value logical


Source Code

    pure logical function all_in_set(ivals, iset)
    !! returns true if all the elements of ivals are in the set iset
    integer(ip),dimension(:),intent(in) :: ivals, iset
    integer :: i
    all_in_set = .true.
    do i = 1, size(ivals)
        if (.not. any(ivals(i)==iset)) then
            all_in_set = .false.
            exit
        end if
    end do
    end function all_in_set