deallocate_core_hashtable Subroutine

public subroutine deallocate_core_hashtable(ht)

Arguments

Type IntentOptional Attributes Name
type(core_hashtable), intent(inout), allocatable :: ht(:)

Contents


Source Code

    subroutine deallocate_core_hashtable(ht)

        type(core_hashtable), intent(inout), allocatable :: ht(:)

        integer :: i, ierr

        if (allocated(ht)) then
            do i = 1, size(ht)
                if (allocated(ht(i)%ind)) then
                    deallocate(ht(i)%ind, stat=ierr)
                    if (ierr /= 0) write(stdout, '("Error when deallocating core hashtable ind array:",1X,i8)') ierr
                end if
            end do

            deallocate(ht, stat=ierr)
            if (ierr /= 0) write(stdout, '("Error when deallocating core hashtable:",1X,i8)') ierr
        end if

    end subroutine deallocate_core_hashtable