public pure subroutine xy_next_nearest_neighbors(lattice, nnn_mask, nn_mask)
Build a mask for the next-nearest neighbors of a given lattice.
It is a NxN matrix, with N the number of sites in the lattice,
storing .true. values only for the pairs of sites linked by a
"NNN-bond". Optionally builds a nearest-neighbors mask, too.
It calls internally xy_shells, for all inter-site
distances, so if you need more than NNNs consider
calling xy_shells directly. Note that we provide
a similar subroutine for nearest-neighbors only,
so if you just need NNs consider calling it.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.