real*8 function vli3_int_old(ri) implicit none logical firstcall,search,check,is_in,inter integer i,num,j,ne integer r2s real*8 r(3),ri(3) real*8 x(6200),y(6200),z(6200),g(6200) real*8 xe(60) real*8 v,s1,s2,s3,ee,e2,rr,dummy real*8 rho data firstcall /.true./ data check /.false./ common /interpol/ inter ! for test only. save x,y,z,g,firstcall,xe,ne ! ! Compute the three body part of the Li3 potential ! ! ! the requirement is that r(3) are in bohr atomic units, ! but the Li3 data we have are in Angtroms, so we ! need to convert them ! vli3_int_old = 0d0 !default value if the interpolation is an extrapolation r(1) = ri(1) !*0.529177d0 r(2) = ri(2) !*0.529177d0 r(3) = ri(3) !*0.529177d0 ! This rho is valid only for X3 symmetries ! rho = dsqrt(dsqrt(3d0)/3d0*(r(1)**2+r(2)**2+r(3)**2)) ! ! get the s1,s2,s3 in the region 1 ! !i = r2s(r(1),r(2),r(3),s1,s2,s3) ! ! Optimal r value ! rr=1.08d0 s1=(r(1)+r(2)+r(3))/dsqrt(3.0d0) s2=(r(2)-r(3))/dsqrt(2.0d0) s3=(2.0d0*r(1)-r(2)-r(3))/dsqrt(6.0d0) ! ! Now we see if the point (s1,s2,s3) lies in the interpolation ! region. ! if(check) then is_in = search(s1,s2,s3) if(.not.is_in) return end if ! ! Here we decide between inter or extrapolation. ! ! call interpolate(x,y,z,g,rr,Num,s1,s2,s3,v) call interpolate_old(s1,s2,s3,v) ! write(*,100) r(1),r(2),r(3),s1,s2,s3,v 100 format(7f11.6) vli3_int_old = v return end