verify_structure Subroutine

private subroutine verify_structure(error, mol)

Cold fusion check

Arguments

Type IntentOptional Attributes Name
type(error_type), intent(out), allocatable :: error
type(structure_type), intent(in) :: mol

Source Code

subroutine verify_structure(error, mol)
   type(error_type), allocatable, intent(out) :: error
   type(structure_type), intent(in) :: mol
   integer :: iat, jat, stat
   stat = 0
   do iat = 1, mol%nat
      do jat = 1, iat - 1
         if (norm2(mol%xyz(:, jat) - mol%xyz(:, iat)) < 1.0e-9_wp) stat = stat + 1
      end do
   end do
   if (stat > 0) then
      call fatal_error(error, "Too close interatomic distances found")
   end if
end subroutine verify_structure