deallocate_trial_hashtable Subroutine

public subroutine deallocate_trial_hashtable(ht)

Arguments

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

Contents


Source Code

    subroutine deallocate_trial_hashtable(ht)

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

        integer :: i, ierr

        if (allocated(ht)) then
            do i = 1, size(ht)
                if (allocated(ht(i)%states)) then
                    deallocate(ht(i)%states, stat=ierr)
                    if (ierr /= 0) write(stdout, '("Error when deallocating trial hashtable states 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_trial_hashtable