Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(btree_node_i8_sp2d), | POINTER | :: | node | |||
integer, | intent(inout), | optional | :: | pos | ||
integer(kind=keyt), | intent(inout), | optional, | DIMENSION(:) | :: | keys | |
type(btree_data_sp2d), | intent(inout), | optional, | DIMENSION(:) | :: | values |
RECURSIVE SUBROUTINE btree_delete_node_i8_sp2d (node, pos, keys, values) TYPE(btree_node_i8_sp2d), POINTER :: node INTEGER, INTENT(INOUT), OPTIONAL :: pos INTEGER(KIND=keyt), DIMENSION(:), INTENT(INOUT), OPTIONAL :: keys TYPE(btree_data_sp2d), DIMENSION(:), INTENT(INOUT), OPTIONAL :: values ! INTEGER :: i ! IF (node%filled .GT. 0 .AND. ASSOCIATED(node%subtrees(1)%node)) THEN DO i = 1, node%filled + 1 IF (PRESENT(pos)) THEN CALL btree_delete_node_i8_sp2d (node%subtrees(i)%node, pos, keys, values) ELSE CALL btree_delete_node_i8_sp2d (node%subtrees(i)%node) END IF IF (PRESENT(pos) .AND. i .LE. node%filled) THEN keys(pos) = node%keys(i) values(pos) = node%values(i) pos = pos + 1 END IF END DO ELSEIF (PRESENT(pos) .AND. node%filled .GT. 0) THEN keys(pos:pos + node%filled - 1) = node%keys(1:node%filled) values(pos:pos + node%filled - 1) = node%values(1:node%filled) pos = pos + node%filled END IF CALL btree_free_node_i8_sp2d (node) END SUBROUTINE btree_delete_node_i8_sp2d