btree_new_root_i8_sp2d Subroutine

private subroutine btree_new_root_i8_sp2d(tree, key, value)

Arguments

Type IntentOptional Attributes Name
type(btree_i8_sp2d), intent(inout) :: tree
integer(kind=keyt), intent(in) :: key
type(btree_data_sp2d), intent(in) :: value

Source Code

      SUBROUTINE btree_new_root_i8_sp2d (tree, key, value)
# 405 "/__w/dbcsr/dbcsr/src/utils/dbcsr_btree.F"
         TYPE(btree_i8_sp2d), INTENT(INOUT) :: tree
# 406 "/__w/dbcsr/dbcsr/src/utils/dbcsr_btree.F"
         INTEGER(KIND=keyt), INTENT(IN) :: key
# 407 "/__w/dbcsr/dbcsr/src/utils/dbcsr_btree.F"
         TYPE(btree_data_sp2d), INTENT(IN) :: value
# 408 "/__w/dbcsr/dbcsr/src/utils/dbcsr_btree.F"
         TYPE(btree_node_i8_sp2d), POINTER :: old_root, new_root
# 409 "/__w/dbcsr/dbcsr/src/utils/dbcsr_btree.F"
         !
         CALL btree_new_node_i8_sp2d (tree, new_root)
# 411 "/__w/dbcsr/dbcsr/src/utils/dbcsr_btree.F"
         new_root%filled = 1
         new_root%keys(1) = key
         new_root%values(1) = value
         IF (ASSOCIATED(tree%b%root)) THEN
            old_root => tree%b%root
            old_root%parent => new_root
            new_root%subtrees(1)%node => old_root
            old_root%parent => new_root
         END IF
         tree%b%root => new_root
      END SUBROUTINE btree_new_root_i8_sp2d