Commit 517ce4d8 authored by Daniel Wortmann's avatar Daniel Wortmann

Bugfixes in hybrid part to avoild floating point exceptions

parent 9e8de6ce
......@@ -426,10 +426,10 @@ CONTAINS
CALL primitivef(primf1,hybrid%basm1(:,n2,l,itype)&
*atoms%rmsh(:,itype)**(l+1),atoms%rmsh,atoms%dx,atoms%jri,atoms%jmtd,itype,atoms%ntype)
! -itype is to enforce inward integration
CALL primitivef(primf2,hybrid%basm1(:,n2,l,itype)&
/atoms%rmsh(:,itype)**l,atoms%rmsh,atoms%dx,atoms%jri,atoms%jmtd,-itype,atoms%ntype)
CALL primitivef(primf2,hybrid%basm1(:atoms%jri(itype),n2,l,itype)&
/atoms%rmsh(:atoms%jri(itype),itype)**l,atoms%rmsh,atoms%dx,atoms%jri,atoms%jmtd,-itype,atoms%ntype)
primf1 = primf1 / atoms%rmsh(:,itype)**l
primf1(:atoms%jri(itype)) = primf1(:atoms%jri(itype)) / atoms%rmsh(:atoms%jri(itype),itype)**l
primf2 = primf2 * atoms%rmsh(:,itype)**(l+1)
DO n1=1,n2
......
......@@ -335,8 +335,8 @@ CONTAINS
parr(:M) = parr2
DEALLOCATE ( fprod2,larr2,parr2 )
END IF
fprod(:,n) = ( hybdat%core1(:,p1,l1,itype) *hybdat%bas1 (:,p2,l2,itype) &
+hybdat%core2(:,p1,l1,itype) *hybdat%bas2 (:,p2,l2,itype) )/ atoms%rmsh(:,itype)
fprod(:atoms%jri(itype),n) = ( hybdat%core1(:atoms%jri(itype),p1,l1,itype) *hybdat%bas1 (:atoms%jri(itype),p2,l2,itype) &
+hybdat%core2(:atoms%jri(itype),p1,l1,itype) *hybdat%bas2 (:atoms%jri(itype),p2,l2,itype) )/ atoms%rmsh(:atoms%jri(itype),itype)
larr(n) = l2
parr(n) = p2
END DO
......@@ -508,8 +508,8 @@ CONTAINS
DO n = 1,hybdat%nindxc(l,itype)
DO n2 = 1,hybdat%nindxc(l2,itype)
rprod(:) = ( hybdat%core1(:,n,l,itype)*hybdat%core1(:,n2,l2,itype)&
+hybdat%core2(:,n,l,itype)*hybdat%core2(:,n2,l2,itype) ) / atoms%rmsh(:,itype)
rprod(:atoms%jri(itype)) = ( hybdat%core1(:atoms%jri(itype),n,l,itype)*hybdat%core1(:atoms%jri(itype),n2,l2,itype)&
+hybdat%core2(:atoms%jri(itype),n,l,itype)*hybdat%core2(:atoms%jri(itype),n2,l2,itype) ) / atoms%rmsh(:atoms%jri(itype),itype)
CALL primitivef(primf1,rprod(:)*atoms%rmsh(:,itype)**(ll+1) ,atoms%rmsh,atoms%dx,atoms%jri,atoms%jmtd, itype,atoms%ntype)
CALL primitivef(primf2,rprod(:)/atoms%rmsh(:,itype)**ll ,atoms%rmsh,atoms%dx,atoms%jri,atoms%jmtd,-itype,atoms%ntype) ! -itype is to enforce inward integration
......@@ -520,8 +520,8 @@ CONTAINS
DO n1 = 1,hybdat%nindxc(l1,itype)
rprod(:) = ( hybdat%core1(:,n,l,itype)*hybdat%core1(:,n1,l1,itype)&
+hybdat%core2(:,n,l,itype)*hybdat%core2(:,n1,l1,itype) ) / atoms%rmsh(:,itype)
rprod(:atoms%jri(itype)) = ( hybdat%core1(:atoms%jri(itype),n,l,itype)*hybdat%core1(:atoms%jri(itype),n1,l1,itype)&
+hybdat%core2(:atoms%jri(itype),n,l,itype)*hybdat%core2(:atoms%jri(itype),n1,l1,itype) ) / atoms%rmsh(:atoms%jri(itype),itype)
integrand = rprod * (primf1 + primf2)
......
......@@ -51,7 +51,7 @@ CONTAINS
hybrid%l_subvxc = ( hybrid%l_hybrid.AND..not.xcpot%is_name("exx") )
!If this is the first iteration loop we can not calculate a new
!non-local potential
IF (.NOT.ALLOCATED(v%pw)) THEN
IF (it<2) THEN
hybrid%l_calhf=.FALSE.
if (hybrid%l_addhf) INQUIRE(file="cdnc",exist=hybrid%l_addhf)
hybrid%l_subvxc = ( hybrid%l_subvxc .AND. hybrid%l_addhf)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment