From 4244e0b27e5d88cadd8824ef66ca469d34168ec4 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Mon, 8 Jun 2020 14:52:23 +0200 Subject: [PATCH] removed FPE in g0_UEG_mu_inf, src/dft_utils_func/on_top_from_ueg.irp.f --- src/dft_utils_func/on_top_from_ueg.irp.f | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dft_utils_func/on_top_from_ueg.irp.f b/src/dft_utils_func/on_top_from_ueg.irp.f index 446b2846..24e40353 100644 --- a/src/dft_utils_func/on_top_from_ueg.irp.f +++ b/src/dft_utils_func/on_top_from_ueg.irp.f @@ -33,7 +33,7 @@ double precision function g0_UEG_mu_inf(rho_a,rho_b) D = -0.01277d0 E = 0.001859d0 x = -d2*rs - if (dabs(rho) > 1.d-12.and.dabs(x).lt.20.d0) then + if (dabs(rho) > 1.d-20.and.dabs(x).lt.20.d0) then rs = (3d0 / (4d0*pi*rho))**(1d0/3d0) ! JT: serious bug fixed 20/03/19 x = -d2*rs if(dabs(x).lt.50.d0)then @@ -68,7 +68,11 @@ double precision function g0_UEG_mu(mu,rho_a,rho_b) C = 0.08193d0 D = -0.01277d0 E = 0.001859d0 - rs = (3d0 / (4d0*pi*rho))**(1d0/3d0) ! JT: serious bug fixed 20/03/19 + if(rho.gt.1.d-20)then + rs = (3d0 / (4d0*pi*rho))**(1d0/3d0) ! JT: serious bug fixed 20/03/19 + else + rs = (3d0 / (4d0*pi*1.d-20))**(1d0/3d0) + endif kf = (alpha*rs)**(-1d0) zeta = mu / kf x = -d2*rs*h_func(zeta)/ahd