[lammps-users] bugs in MEAM code for 2NN implementation

(i) I found that when using 2NN MEAM formulation, sometimes the values
calculated for inter-atomic potentials are NaN for large values of 'r'.
This is because the iterations involve calculating potentials for r' =
r*(a^n), n= 1, 2.... At very large values of r', all of rho01, rho11,
rho21, and rho31 become zero within the accuracy of real*8 variables. I
observed this for Silicon and Carbon, i.e. diamond cubic structures
where ratio of 2nd and 1st nearest neighbor distances is very large
(1.633). So when Gam1 or Gam2 are calculated in meam_setup_done.f, we
get something like Gam1 = 0.0/0.0 or NaN. This could be fixed by adding
something like
   if(Gam1.eq.0.0.and.rho01.eq.0.0) then
            Gam1 = 0.0
            Gam1 = Gam1/(rho01*rho01)

(ii) subroutine get_Zij2: for 'diamond' structures, I think Zij2 should
be 12 instead of 0 and numscr should be equal to 1 instead of 4.


I'm forwarding this to Greg for his comments.