Skip to content

Commit

Permalink
reorder arithmetic operations to avoid float overflow (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelStishenko committed Nov 19, 2020
1 parent ceaf132 commit 708016d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/dftd4.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ subroutine dispgrad_3d(mol,dispm,ndim,q,cn,dcndr,dcndL,r_thr,mbd_thr,par,wf, &
! NEW: q=0 for ATM
gw(k) = zeta(dispm%g_a,gam(ia)*dispm%g_c,dispm%q(ii,ia)+iz,iz) * gwk

dgwk = dexpw*norm-expw*dnorm*norm**2
dgwk = norm*(dexpw-expw*dnorm*norm)
if (dgwk.ne.dgwk) then
dgwk = 0.0_wp
endif
Expand Down

0 comments on commit 708016d

Please sign in to comment.