get_spinorb_neighbors_lat Function

private function get_spinorb_neighbors_lat(this, spinorb) result(neighbors)

Type Bound

lattice

Arguments

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

Return Value integer, allocatable, (:)


Contents


Source Code

    function get_spinorb_neighbors_lat(this, spinorb) result(neighbors)
        class(lattice) :: this
        integer, intent(in) :: spinorb
        integer, allocatable :: neighbors(:)
#ifdef DEBUG_
        character(*), parameter :: this_routine = "get_spinorb_neighbors_lat"
#endif

        ASSERT(spinorb <= 2 * this%get_nsites())
        ASSERT(spinorb > 0)
        ASSERT(allocated(this%sites))
        ASSERT(allocated(this%sites(get_spatial(spinorb))%neighbors))

        neighbors = this%get_neighbors(get_spatial(spinorb))

        if (is_beta(spinorb)) then
            neighbors = 2 * neighbors - 1
        else
            neighbors = 2 * neighbors
        end if

    end function get_spinorb_neighbors_lat