init_site Subroutine

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

Type Bound

site

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)

Contents

Source Code


Source Code

    subroutine init_site(this, ind, n_neighbors, neighbors, k_vec, r_vec)
        ! for now only use the index in the initalization
        class(site) :: this
        integer, intent(in) :: ind, n_neighbors
        integer, intent(in) :: neighbors(n_neighbors)
        integer, intent(in), optional :: k_vec(3)
        integer, intent(in), optional :: r_vec(3)

        ! for the beginning i do not need more than to set the index..
        ! independent of the type
        call this%set_index(ind)
        call this%set_num_neighbors(n_neighbors)
        call this%allocate_neighbors(n_neighbors)
        call this%set_neighbors(neighbors)

        if (present(k_vec)) then
            call this%set_k_vec(k_vec)
        end if

        if (present(r_vec)) then
            call this%set_r_vec(r_vec)
        end if

    end subroutine init_site