fix base value for even k recursion in grid_ik

fix the problem in issue 1233 https://github.com/nwchemgit/nwchem/issues/1233#issue-3854751518
This commit is contained in:
Chang Liu 2026-01-26 15:37:14 +08:00 committed by GitHub
parent c574f066f4
commit 6f0fbb1f4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -246,8 +246,10 @@ c
if (ilo .eq. 0) then
dexpo=sqrt(alpha)*r
if(dexpo.gt.40d0) then
valexp=0d0
value=0d0
else
valexp=exp(-alpha*r*r)
#if defined(WIN32) ||defined(LINUX)
value = 0.5d0*sqrt(4.0d0*atan(1.0d0)/alpha)*
$ derfc(dexpo)
@ -256,13 +258,14 @@ c
$ erfc(dexpo)
#endif
endif
endif
if(alpha*r*r.gt.500d0) then
valexp=0d0
value =0d0
else
valexp=exp(-alpha*r*r)
value =valexp/(2.0d0*alpha)
if(alpha*r*r.gt.500d0) then
valexp=0d0
value =0d0
else
valexp=exp(-alpha*r*r)
value =valexp/(2.0d0*alpha)
endif
endif
c
do i = ilo+2,k,2