dict_i4tuple_callstat_destroy Subroutine

private subroutine dict_i4tuple_callstat_destroy(dict)

Deallocated the internal data-structures if the given dictionary. Caution: If the stored keys or values are pointers, their targets will not get deallocated by this routine.

Arguments

Type IntentOptional Attributes Name
type(dict_i4tuple_callstat_type), intent(inout) :: dict

Source Code

      SUBROUTINE dict_i4tuple_callstat_destroy(dict)
      !! Deallocated the internal data-structures if the given dictionary.
      !! Caution: If the stored keys or values are pointers, their targets will
      !! not get deallocated by this routine.

         TYPE(dict_i4tuple_callstat_type), intent(inout)  :: dict
         TYPE(private_item_type_i4tuple_callstat), POINTER  :: item, prev_item
         INTEGER :: i

         IF (.not. ASSOCIATED(dict%buckets)) &
            DBCSR_ABORT("dict_i4tuple_callstat_destroy: dictionary is not initialized.")

         do i = 1, size(dict%buckets)
            item => dict%buckets(i)%p
            do while (ASSOCIATED(item))
               prev_item => item
               item => item%next
               deallocate (prev_item)
            end do
         end do

         deallocate (dict%buckets)
         dict%size = -1

      END SUBROUTINE dict_i4tuple_callstat_destroy