Skip to content

Commit

Permalink
Address code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
vnquanvuong committed Jan 16, 2025
1 parent d771564 commit 8b02aa3
Show file tree
Hide file tree
Showing 30 changed files with 618 additions and 796 deletions.
2 changes: 1 addition & 1 deletion src/dftbp/dftb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set(sources-fpp
${curdir}/halogenx.F90
${curdir}/hamiltonian.F90
${curdir}/hybridxc.F90
${curdir}/multiexpan.F90
${curdir}/mdftb.F90
${curdir}/nonscc.F90
${curdir}/onscorrection.F90
${curdir}/orbitalequiv.F90
Expand Down
59 changes: 27 additions & 32 deletions src/dftbp/dftb/energytypes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ module dftbp_dftb_energytypes
!> Range-separation energy
real(dp) :: Efock = 0.0_dp

!> MultiPole energy
!> Total energy due to all multipolar interactions except the monopole-monopole.
real(dp) :: EDftbMultiExpan = 0.0_dp

!> Energy contribution from monopole-dipole interactions.
real(dp) :: EDftbMultiExpanMD = 0.0_dp

!> Energy contribution from dipole-dipole interactions.
real(dp) :: EDftbMultiExpanDD = 0.0_dp

!> Energy contribution from monopole-quadrupole interactions.
real(dp) :: EDftbMultiExpanMQ = 0.0_dp

!> Energy contribution from dipole-quadrupole interactions.
real(dp) :: EDftbMultiExpanDQ = 0.0_dp

!> Energy contribution from quadrupole-quadrupole interactions.
real(dp) :: EDftbMultiExpanQQ = 0.0_dp

!> Spin orbit energy
Expand Down Expand Up @@ -129,7 +139,7 @@ module dftbp_dftb_energytypes
!> Atom resolved spin
real(dp), allocatable :: atomSpin(:)

!> Atom resolved Multipole
!> Atom resolved total multipolar energy
real(dp), allocatable :: atomDftbMultiExpan(:)

!> Atom resolved spin orbit
Expand Down Expand Up @@ -191,36 +201,21 @@ subroutine TEnergies_init(this, nAtom, nSpin)
this%E0(:) = 0.0_dp
this%EBand(:) = 0.0_dp

allocate(this%atomRep(nAtom))
allocate(this%atomNonSCC(nAtom))
allocate(this%atomSCC(nAtom))
allocate(this%atomSpin(nAtom))
allocate(this%atomLS(nAtom))
allocate(this%atomDftbu(nAtom))
allocate(this%atomExt(nAtom))
allocate(this%atomElec(nAtom))
allocate(this%atomDisp(nAtom))
allocate(this%atomOnSite(nAtom))
allocate(this%atomHalogenX(nAtom))
allocate(this%atom3rd(nAtom))
allocate(this%atomDftbMultiExpan(nAtom))
allocate(this%atomSolv(nAtom))
allocate(this%atomTotal(nAtom))
this%atomRep(:) = 0.0_dp
this%atomNonSCC(:) = 0.0_dp
this%atomSCC(:) = 0.0_dp
this%atomSpin(:) = 0.0_dp
this%atomLS(:) = 0.0_dp
this%atomDftbu(:) = 0.0_dp
this%atomExt(:) = 0.0_dp
this%atomElec(:) = 0.0_dp
this%atomDisp(:) = 0.0_dp
this%atomOnSite(:) = 0.0_dp
this%atomHalogenX(:) = 0.0_dp
this%atom3rd(:) = 0.0_dp
this%atomDftbMultiExpan(:) = 0.0_dp
this%atomSolv(:) = 0.0_dp
this%atomTotal(:) = 0.0_dp
allocate(this%atomRep(nAtom), source=0.0_dp)
allocate(this%atomNonSCC(nAtom), source=0.0_dp)
allocate(this%atomSCC(nAtom), source=0.0_dp)
allocate(this%atomSpin(nAtom), source=0.0_dp)
allocate(this%atomLS(nAtom), source=0.0_dp)
allocate(this%atomDftbu(nAtom), source=0.0_dp)
allocate(this%atomExt(nAtom), source=0.0_dp)
allocate(this%atomElec(nAtom), source=0.0_dp)
allocate(this%atomDisp(nAtom), source=0.0_dp)
allocate(this%atomOnSite(nAtom), source=0.0_dp)
allocate(this%atomHalogenX(nAtom), source=0.0_dp)
allocate(this%atom3rd(nAtom), source=0.0_dp)
allocate(this%atomDftbMultiExpan(nAtom), source=0.0_dp)
allocate(this%atomSolv(nAtom), source=0.0_dp)
allocate(this%atomTotal(nAtom), source=0.0_dp)

this%Erep = 0.0_dp
this%EnonSCC = 0.0_dp
Expand Down
4 changes: 2 additions & 2 deletions src/dftbp/dftb/getenergies.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module dftbp_dftb_getenergies
use dftbp_dftb_dftbplusu, only : TDftbU
use dftbp_dftb_dispiface, only : TDispersionIface
use dftbp_dftb_energytypes, only : TEnergies
use dftbp_dftb_multiexpan, only : TDftbMultiExpan
use dftbp_dftb_multiexpan, only : TMdftb
use dftbp_dftb_onsitecorrection, only : getEons
use dftbp_dftb_periodic, only : TNeighbourList
use dftbp_dftb_populations, only : mulliken
Expand Down Expand Up @@ -76,7 +76,7 @@ subroutine calcEnergies(env, sccCalc, tblite, qOrb, q0, chargePerShell, multipol
type(TMultipole), intent(in) :: multipole

!> DFTB multipole moments
type(TDftbMultiExpan), intent(inout), allocatable :: dftbMultiExpan
type(TMdftb), intent(inout), allocatable :: dftbMultiExpan

!> chemical species
!> Chemical species
Expand Down
4 changes: 2 additions & 2 deletions src/dftbp/dftb/hamiltonian.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module dftbp_dftb_hamiltonian
use dftbp_dftb_dftbplusu, only : TDftbU
use dftbp_dftb_dispersions, only : TDispersionIface
use dftbp_dftb_extfields, only : TEField
use dftbp_dftb_multiexpan, only : TDftbMultiExpan
use dftbp_dftb_multiexpan, only : TMdftb
use dftbp_dftb_periodic, only : TNeighbourList
use dftbp_dftb_potentials, only : TPotentials
use dftbp_dftb_scc, only : TScc
Expand Down Expand Up @@ -365,7 +365,7 @@ subroutine getSccHamiltonian(env, H0, ints, nNeighbourSK, neighbourList, species
type(TPotentials), intent(in) :: potential

!> DFTB multipole expansion
type(TDftbMultiExpan), allocatable, intent(inout) :: dftbMultiExpan
type(TMdftb), allocatable, intent(inout) :: dftbMultiExpan

!> Is this DFTB/SSR formalism
logical, intent(in) :: isREKS
Expand Down
Loading

0 comments on commit 8b02aa3

Please sign in to comment.