btree_find_i8_sp2d Subroutine

private subroutine btree_find_i8_sp2d(tree, key, value, exists)

Arguments

TypeIntentOptionalAttributesName
type(btree_i8_sp2d), intent(in) :: tree
integer(kind=keyt), intent(in) :: key
type(btree_data_sp2d), intent(out) :: value
logical, intent(out), optional :: exists

Contents

Source Code


Source Code

      SUBROUTINE btree_find_i8_sp2d (tree, key, value, exists)
         TYPE(btree_i8_sp2d), INTENT(IN) :: tree
         INTEGER(KIND=keyt), INTENT(IN) :: key
         TYPE(btree_data_sp2d), INTENT(OUT) :: value
         LOGICAL, INTENT(OUT), OPTIONAL :: exists
         !
         TYPE(btree_node_i8_sp2d), POINTER :: node
         INTEGER :: position
         !
         CALL btree_find_full_i8_sp2d (tree, key, node, position, short=.TRUE.)
         IF (PRESENT(exists)) THEN
            exists = position .GT. 0
         END IF
         IF (position .GT. 0) THEN
            value = node%values(position)
         END IF
      END SUBROUTINE btree_find_i8_sp2d