init_sites_aim_chain Subroutine

private subroutine init_sites_aim_chain(this)

Type Bound

aim_chain

Arguments

Type IntentOptional Attributes Name
class(aim_chain) :: this

Contents

Source Code


Source Code

    subroutine init_sites_aim_chain(this)
        class(aim_chain) :: this
        character(*), parameter :: this_routine = "init_sites_aim_chain"
        ! now this is the important routine..

        integer :: i

        if (this%get_nsites() < 2) then
            call stop_all(this_routine, &
                          "less than 2 sites!")
        end if
        ! for the chain we should assert that we only have one impurity!
        if (this%get_n_imps() > 1) then
            call stop_all(this_routine, "more than one impurity!")
        end if

        ! the first site is the impurity!
        this%sites(1) = site(1, 1, [2], site_type='impurity')

        ! the bath sites are connected within each other, but not periodic!
        do i = 1, this%get_n_bath() - 1
            this%sites(i + 1) = site(i + 1, 2, [i, i + 2], site_type='bath')
        end do

        ! and the last bath site only has one neighbor
        this%sites(this%get_nsites()) = site(this%get_nsites(), 1, &
                                             [this%get_nsites() - 1], site_type='bath')

    end subroutine init_sites_aim_chain