allocate_neighbors Subroutine

private subroutine allocate_neighbors(this, n_neighbors)

Type Bound

site

Arguments

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

Contents

Source Code


Source Code

    subroutine allocate_neighbors(this, n_neighbors)
        class(site) :: this
        integer, intent(in) :: n_neighbors

        ! the procedure bound routine already checks if neighbors is
        ! allocated.
        call this%deallocate_neighbors()

        allocate(this%neighbors(n_neighbors))

    end subroutine allocate_neighbors