new_csr_list Subroutine

public subroutine new_csr_list(self, mol, error, wsc, cutoff, trans, complete)

Create a neighbor list for a geometry and cutoff

Arguments

Type IntentOptional Attributes Name
type(csr_list), intent(out) :: self

Instance of the neighborlist

type(structure_type), intent(in) :: mol

Structure type

type(error_type), intent(out), optional, allocatable :: error

Error status, zero on success

type(wignerseitz_cell), intent(inout), optional :: wsc

Wigner-Seitz cell type, enables the Wigner-Seitz image search

real(kind=wp), intent(in), optional :: cutoff

Realspace cutoff for neighborlist generation

real(kind=wp), intent(in), optional :: trans(:,:)

Lattice translation vectors for periodic systems

logical, intent(in), optional :: complete

Flag for complete neighborlist generation


Source Code

subroutine new_csr_list(self, mol, error, wsc, cutoff, trans, complete)

   !> Instance of the neighborlist
   type(csr_list), intent(out) :: self

   !> Structure type
   type(structure_type), intent(in) :: mol

   !> Error status, zero on success
   type(error_type), allocatable, intent(out), optional :: error

   !> Wigner-Seitz cell type, enables the Wigner-Seitz image search
   type(wignerseitz_cell), intent(inout), optional :: wsc

   !> Realspace cutoff for neighborlist generation
   real(wp), intent(in), optional :: cutoff

   !> Lattice translation vectors for periodic systems
   real(wp), intent(in), optional :: trans(:, :)

   !> Flag for complete neighborlist generation
   logical, intent(in), optional :: complete

   allocate(self%cutoff)
   self%cutoff = cutoff_def
   if (present(cutoff)) self%cutoff = cutoff

   self%complete = complete_def
   if (present(complete)) self%complete = complete

   if (present(trans)) self%trans = trans

   if (any(mol%periodic) .and. present(wsc)) then
      ! Generate the neighborlist and wsc type objects simultaneously
      call build_list(self, mol, error, wsc)
   else
      ! Generate the CSR neighbor list for molecular or periodic systems
      call build_list(self, mol, error)
   end if

end subroutine new_csr_list