cc_hash_look_up Subroutine

private subroutine cc_hash_look_up(ind, tgt, hash_table, hash_val, t_found)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ind(:)
integer(kind=n_int), intent(in) :: tgt(0:nifd)
type(cc_hash), pointer :: hash_table(:)
integer, intent(out) :: hash_val
logical, intent(out) :: t_found

Contents

Source Code


Source Code

    subroutine cc_hash_look_up(ind, tgt, hash_table, hash_val, t_found)
        integer, intent(in) :: ind(:)
        integer(n_int), intent(in) :: tgt(0:nifd)
        type(cc_hash), pointer :: hash_table(:)
        integer, intent(out) :: hash_val
        logical, intent(out) :: t_found

        type(cc_hash), pointer :: temp_node

        t_found = .false.

        hash_val = FindWalkerHash(ind, size(hash_table))

        temp_node => hash_table(hash_val)

        if (temp_node%found) then
            do while (associated(temp_node))
                if (all(tgt == temp_node%ind)) then
                    t_found = .true.
                    exit
                end if
                temp_node => temp_node%next
            end do
        end if

        nullify (temp_node)

    end subroutine cc_hash_look_up