btree_find_i8_zp2d Subroutine

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

Arguments

Type IntentOptional Attributes Name
type(btree_i8_zp2d), intent(in) :: tree
integer(kind=keyt), intent(in) :: key
type(btree_data_zp2d), intent(out) :: value
logical, intent(out), optional :: exists

Source Code

      SUBROUTINE btree_find_i8_zp2d (tree, key, value, exists)
         TYPE(btree_i8_zp2d), INTENT(IN) :: tree
         INTEGER(KIND=keyt), INTENT(IN) :: key
         TYPE(btree_data_zp2d), INTENT(OUT) :: value
         LOGICAL, INTENT(OUT), OPTIONAL :: exists
         !
         TYPE(btree_node_i8_zp2d), POINTER :: node
         INTEGER :: position
         !
         CALL btree_find_full_i8_zp2d (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_zp2d