Skip to content

Make_lattice: Add option for larger nnlist#640

Open
jonasschwab wants to merge 1 commit into
masterfrom
Make_lattice-bigger-nnlist-option
Open

Make_lattice: Add option for larger nnlist#640
jonasschwab wants to merge 1 commit into
masterfrom
Make_lattice-bigger-nnlist-option

Conversation

@jonasschwab

Copy link
Copy Markdown
Member

This feature adds an optional argument to subroutine Make_lattice to have larger nnlist and nnlistk.

It also improves the Doxygen of the lattice slightly.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Make_lattice in Lattices_v3 with an optional argument to control the allocation/index range of Latt%nnlist and Latt%nnlistk, and refreshes the Doxygen documentation for that routine (plus a copyright year update).

Changes:

  • Add optional nnlist_range_in argument to Make_lattice and allocate nnlist/nnlistk with bounds -nnlist_range:nnlist_range.
  • Add/expand Doxygen documentation for Make_lattice.
  • Update copyright header year.
Comments suppressed due to low confidence (1)

Libraries/Modules/lattices_v3_mod.F90:316

  • With nnlist_range_in > 1, the displacement d_p can be multiple unit cells away. The current fixed 4× npbc calls were sufficient for the old -1:1 range, but are not guaranteed to wrap larger displacements back into the fundamental domain; this can produce nnr1/nnr2 outside Latt%invlist bounds. Wrap x_p using a number of npbc iterations that scales with nnlist_range.
                    call npbc(x1_p, x_p , Latt%L1_p, Latt%L2_p)
                    call npbc(x_p , x1_p, Latt%L1_p, Latt%L2_p)
                    call npbc(x1_p, x_p , Latt%L1_p, Latt%L2_p)
                    call npbc(x_p , x1_p, Latt%L1_p, Latt%L2_p)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Libraries/Modules/lattices_v3_mod.F90 Outdated
Comment thread Libraries/Modules/lattices_v3_mod.F90
@jonasschwab jonasschwab force-pushed the Make_lattice-bigger-nnlist-option branch from debf787 to 1a1d171 Compare June 9, 2026 16:23
@jonasschwab jonasschwab assigned jonasschwab and unassigned fassaad Jun 24, 2026
@jonasschwab jonasschwab requested a review from fassaad June 24, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants