site Derived Type

type, private :: site


Contents

Source Code


Components

Type Visibility Attributes Name Initial
integer, private :: ind = -1
integer, private :: n_neighbors = -1
integer, private :: k_vec(3) = 0
integer, private :: r_vec(3) = 0
integer, private :: k_sym = -1
integer, private :: k_inv(3) = 0
integer, private :: sym_inv = -1
integer, private, allocatable :: neighbors(:)
logical, private :: t_impurity = .false.
logical, private :: t_bath = .false.

Constructor

private interface site

  • private function site_constructor(ind, n_neighbors, neighbors, k_vec, r_vec, site_type) result(this)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: ind
    integer, intent(in) :: n_neighbors
    integer, intent(in) :: neighbors(n_neighbors)
    integer, intent(in), optional :: k_vec(3)
    integer, intent(in), optional :: r_vec(3)
    character(len=*), intent(in), optional :: site_type

    Return Value type(site)


Type-Bound Procedures

procedure, private, :: allocate_neighbors

  • private subroutine allocate_neighbors(this, n_neighbors)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: n_neighbors

procedure, private, :: deallocate_neighbors

procedure, private, :: get_neighbors => get_neighbors_site

  • private function get_neighbors_site(this) result(neighbors)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this

    Return Value integer, (this%n_neighbors)

procedure, private, :: initialize => init_site

  • private subroutine init_site(this, ind, n_neighbors, neighbors, k_vec, r_vec)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: ind
    integer, intent(in) :: n_neighbors
    integer, intent(in) :: neighbors(n_neighbors)
    integer, intent(in), optional :: k_vec(3)
    integer, intent(in), optional :: r_vec(3)

procedure, private, :: set_index

  • private subroutine set_index(this, ind)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: ind

procedure, private, :: get_index

  • private function get_index(this)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this

    Return Value integer

procedure, private, :: set_num_neighbors

  • private subroutine set_num_neighbors(this, n_neighbors)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: n_neighbors

procedure, private, :: get_num_neighbors => get_num_neighbors_site

  • private pure function get_num_neighbors_site(this)

    Arguments

    Type IntentOptional Attributes Name
    class(site), intent(in) :: this

    Return Value integer

procedure, private, :: set_neighbors

  • private subroutine set_neighbors(this, neighbors)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: neighbors(this%n_neighbors)

procedure, private, :: set_impurity

  • private subroutine set_impurity(this, flag)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    logical, intent(in) :: flag

procedure, private, :: is_impurity

  • private function is_impurity(this)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this

    Return Value logical

procedure, private, :: set_bath

  • private subroutine set_bath(this, flag)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    logical, intent(in) :: flag

procedure, private, :: is_bath

  • private function is_bath(this)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this

    Return Value logical

procedure, private, :: set_k_vec

  • private subroutine set_k_vec(this, k_vec)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: k_vec(3)

procedure, private, :: set_r_vec

  • private subroutine set_r_vec(this, r_vec)

    Arguments

    Type IntentOptional Attributes Name
    class(site) :: this
    integer, intent(in) :: r_vec(3)

Source Code

    type :: site
        ! the basic site type for my lattice
        ! i guess here i need to store my neighbors and provide functionality
        ! how to get them
        ! and i think i want to store this data contigous in memory to
        ! speed up cache, access
        private
        ! to i want to have an index, which gives me the number?
        ! i might not even need that?
        ! in the mean-time use an index..
        integer :: ind = -1
        integer :: n_neighbors = -1

        ! i think i also want to store the k-vectors of the sites here..
        ! since i will need them if I totally want to switch to my new
        ! implementation and also if i want to deal with the new type of
        ! periodic boundary conditions.
        integer :: k_vec(3) = 0
        ! i also need the real-space coordinates for the hopping
        ! transcorrelation!
        integer :: r_vec(3) = 0

        ! also use one integer to differentiate between the k-vectors!
        ! this makes it easier to access arrays..
        integer :: k_sym = -1

        ! do i also need the inverse k-vec in here??
        integer :: k_inv(3) = 0
        integer :: sym_inv = -1

        ! ah.. here it is important: neighbors are also sites.. is this
        ! possible? and i have to be flexible to allow different types of
        ! site neighbors
        ! and i am not even sure if i want pointers here.. maybe a vector
        ! of neighbor indices is enough and even better..
        ! i cant really make it this way without another type since
        ! fortran does not like arrays of pointers or atleast does not
        ! intepret is as that from the beginning..
        ! but i think this would be perfect or?
        ! recursive types are only allowed in the fortran 2008 standard..
        ! so i have to go over an intermediate type
        ! (which has the advantage to have an array of pointers..
        ! ok i realize this whole shabang is too much..
        ! so just make a list of indices of the neighbors
        integer, allocatable :: neighbors(:)
        ! or can i point to the other sites here? hm..
        ! and maybe i want to store on-site repulsion here too.. lets see

        ! i could just hack into that i have a flag for impurities and
        ! bath sites.. which i do not need for "normal" calculations but
        ! for the AIM..
        logical :: t_impurity = .false.
        logical :: t_bath = .false.

    contains
        private

        procedure :: allocate_neighbors
        procedure :: deallocate_neighbors

        procedure :: get_neighbors => get_neighbors_site
        ! maybe i do not need a initializer?
        ! or maybe yes i do.. i would like to have something like a
        ! with the lattice.. but now i want something optional..
        procedure :: initialize => init_site

        procedure :: set_index
        procedure :: get_index
        procedure :: set_num_neighbors
        procedure :: get_num_neighbors => get_num_neighbors_site
        procedure :: set_neighbors

        procedure :: set_impurity
        procedure :: is_impurity
        procedure :: set_bath
        procedure :: is_bath
        procedure :: set_k_vec
        procedure :: set_r_vec
        ! i could also use finalization routines instead of manually
        ! deallocating everything..
        ! i need atleast gcc4.9.. which i am to lazy to update now..
        ! but will in the future!

    end type site