diff --git a/src/elements.f90 b/src/elements.f90 index 935b6f8..e9fc928 100644 --- a/src/elements.f90 +++ b/src/elements.f90 @@ -468,8 +468,8 @@ module elements do i = 1, atom_num do j = 1, 3 - if (r_atom(j,i) > max_bd(j)) max_bd(j) = r_atom(j,i) + lim_zero - if (r_atom(j,i) < min_bd(j)) min_bd(j) = r_atom(j,i) - lim_zero + if (r_atom(j,i) > max_bd(j)) max_bd(j) = r_atom(j,i) + tol + if (r_atom(j,i) < min_bd(j)) min_bd(j) = r_atom(j,i) - tol end do end do @@ -477,8 +477,8 @@ module elements do inod = 1, ng_node(lat_ele(i)) do ibasis = 1, basisnum(lat_ele(i)) do j = 1, 3 - if (r_node(j,ibasis,inod,i) > max_bd(j)) max_bd(j) = r_node(j,ibasis,inod,i) + lim_zero - if (r_node(j,ibasis,inod,i) < min_bd(j)) min_bd(j) = r_node(j,ibasis,inod,i) -lim_zero + if (r_node(j,ibasis,inod,i) > max_bd(j)) max_bd(j) = r_node(j,ibasis,inod,i) + tol + if (r_node(j,ibasis,inod,i) < min_bd(j)) min_bd(j) = r_node(j,ibasis,inod,i) - tol end do end do end do diff --git a/src/parameters.f90 b/src/parameters.f90 index 2fa3e37..f261552 100644 --- a/src/parameters.f90 +++ b/src/parameters.f90 @@ -6,7 +6,8 @@ module parameters integer, parameter :: dp= selected_real_kind(15,307) !Parameters for floating point tolerance real(kind=dp), parameter :: lim_zero = epsilon(1.0_dp), & - lim_large = huge(1.0_dp) + lim_large = huge(1.0_dp), & + tol = 10.0_dp**(-6.0_dp) logical, save :: lmpcac !Numeric constants