Skip to content

Commit

Permalink
Merge pull request dftbplus#1442 from bhourahine/removeRedundantCall
Browse files Browse the repository at this point in the history
Remove extraneous call and amalgamate loops
  • Loading branch information
vanderhe authored Apr 19, 2024
2 parents 4f8877b + 86ff1fa commit 7547844
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/dftbp/dftb/hybridxc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ subroutine THybridXcFunc_init(this, nAtom0, species0, hubbu, screeningThreshold,
allocate(this%lrGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%lrdGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%lrddGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%hfGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%hfdGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%hfddGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
do iSp2 = 1, nUniqueSpecies
do iSp1 = 1, nUniqueSpecies
this%lrGammaAtDamping(iSp1, iSp2) = getLrAnalyticalGammaValue_workhorse(this%hubbu(iSp1),&
Expand All @@ -536,23 +539,14 @@ subroutine THybridXcFunc_init(this, nAtom0, species0, hubbu, screeningThreshold,
& this%omega, this%gammaDamping)
this%lrddGammaAtDamping(iSp1, iSp2)&
& = getddLrNumericalGammaValue_workhorse(this%hubbu(iSp1), this%hubbu(iSp2),&
& this%omega, this%gammaDamping, 1e-08_dp)
end do
end do

nUniqueSpecies = getNumberOfUniqueInt(this%species0)
allocate(this%hfGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%hfdGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
allocate(this%hfddGammaAtDamping(nUniqueSpecies, nUniqueSpecies))
do iSp2 = 1, nUniqueSpecies
do iSp1 = 1, nUniqueSpecies
& this%omega, this%gammaDamping, 1.0E-8_dp)
this%hfGammaAtDamping(iSp1, iSp2) = getHfAnalyticalGammaValue_workhorse(this%hubbu(iSp1),&
& this%hubbu(iSp2), this%gammaDamping)
this%hfdGammaAtDamping(iSp1, iSp2)&
& = getdHfAnalyticalGammaValue_workhorse(this%hubbu(iSp1), this%hubbu(iSp2),&
& this%gammaDamping)
this%hfddGammaAtDamping(iSp1, iSp2) = getddHfNumericalGammaDeriv(this, iSp1, iSp2,&
& this%gammaDamping, 1e-08_dp)
& this%gammaDamping, 1.0E-8_dp)
end do
end do
end if
Expand Down

0 comments on commit 7547844

Please sign in to comment.