allocate_sites Subroutine

private subroutine allocate_sites(this, n_sites)

Type Bound

lattice

Arguments

Type IntentOptional Attributes Name
class(lattice) :: this
integer, intent(in) :: n_sites

Contents

Source Code


Source Code

    subroutine allocate_sites(this, n_sites)
        ! do we want to
        class(lattice) :: this
        integer, intent(in) :: n_sites
        character(*), parameter :: this_routine = "allocate_sites"

        if (allocated(this%sites)) then
            call stop_all(this_routine, "sites are already allocated!")
        end if

        if (n_sites < 1) then
            call stop_all(this_routine, "0 or negative number of sites!")

        else
            ! for now it is fine to allocate the sites just as "normal"
            ! sites and not as bath/impurity sites..
            ! BUT: keep this in mind!

            allocate(this%sites(n_sites))

        end if

    end subroutine allocate_sites