btree_delete_i8_zp2d Subroutine

private subroutine btree_delete_i8_zp2d(tree, keys, values)

Arguments

TypeIntentOptionalAttributesName
type(btree_i8_zp2d), intent(inout) :: tree
integer(kind=keyt), intent(out), optional DIMENSION(:):: keys
type(btree_data_zp2d), intent(out), optional DIMENSION(:):: values

Contents

Source Code


Source Code

      SUBROUTINE btree_delete_i8_zp2d (tree, keys, values)
         TYPE(btree_i8_zp2d), INTENT(INOUT) :: tree
         INTEGER(KIND=keyt), DIMENSION(:), INTENT(OUT), OPTIONAL :: keys
         TYPE(btree_data_zp2d), DIMENSION(:), INTENT(OUT), OPTIONAL :: values
         INTEGER :: pos
         !
         IF (ASSOCIATED(tree%b%root)) THEN
            pos = 0
            IF (PRESENT(keys) .AND. PRESENT(values)) THEN
               pos = 1
               CALL btree_delete_node_i8_zp2d (tree%b%root, pos, keys, values)
            ELSE
               CALL btree_delete_node_i8_zp2d (tree%b%root)
            END IF
         END IF
         NULLIFY (tree%b%root)
      END SUBROUTINE btree_delete_i8_zp2d