deallocate_sites Subroutine

private subroutine deallocate_sites(this)

Type Bound

lattice

Arguments

Type IntentOptional Attributes Name
class(lattice) :: this

Contents

Source Code


Source Code

    subroutine deallocate_sites(this)
        class(lattice) :: this
        integer :: i
        ! do i need an extra deallocater for the sites?
        if (allocated(this%sites)) then
            ! i have to run over all the sites and deallocate/nullify the
            ! neighbor pointers!
            do i = 1, this%get_nsites()
                call this%sites(i)%deallocate_neighbors()
            end do

            deallocate(this%sites)
        end if

    end subroutine deallocate_sites