Skip to content

Commit 66b104f

Browse files
committed
Clean mDFTB
1 parent a562397 commit 66b104f

File tree

3 files changed

+16
-31
lines changed

3 files changed

+16
-31
lines changed

src/dftbp/dftb/hamiltonian.F90

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ subroutine addChargePotentials(env, sccCalc, tblite, updateScc, qInput, q0, char
211211
! local variables
212212
real(dp), allocatable :: atomPot(:,:)
213213
real(dp), allocatable :: shellPot(:,:,:)
214-
real(dp), allocatable :: deltaMAtom(:)
215214
real(dp), allocatable :: dipPot(:,:), quadPot(:,:)
216215
integer, pointer :: pSpecies0(:)
217216
integer :: nAtom, nSpin
@@ -269,12 +268,9 @@ subroutine addChargePotentials(env, sccCalc, tblite, updateScc, qInput, q0, char
269268
end if
270269
end if
271270

272-
if (allocated(dftbMultiExpan)) then
273-
allocate(deltaMAtom(nAtom))
274-
call sccCalc%getDeltaQAtom(deltaMAtom)
275-
call dftbMultiExpan%updateDQPotentials(deltaMAtom)
276-
deallocate(deltaMAtom)
277-
end if
271+
! if (allocated(dftbMultiExpan)) then
272+
! call dftbMultiExpan%updateDQPotentials(sum(qInput(:,:,1) - q0(:,:,1), dim=1))
273+
! end if
278274

279275
if (allocated(thirdOrd)) then
280276
call thirdOrd%updateCharges(pSpecies0, neighbourList, qInput, q0, img2CentCell, orb)

src/dftbp/dftb/scc.F90

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ module dftbp_dftb_scc
152152
!> Updates the SCC module, if the charges have been changed
153153
procedure :: updateCharges
154154

155-
!> get DeltaQAtom for multipole contribution
156-
procedure :: getDeltaQAtom
157-
158155
!> Set external charge field
159156
procedure :: setExternalCharges
160157

@@ -445,22 +442,6 @@ subroutine updateCharges(this, env, qOrbital, orb, species, q0)
445442
end subroutine updateCharges
446443

447444

448-
!> get DeltaQAtom
449-
subroutine getDeltaQAtom(this, deltaQAtom)
450-
451-
!> Resulting module variables
452-
class(TScc), intent(in) :: this
453-
454-
!> Output DeltaQAtom
455-
real(dp), intent(out) :: deltaQAtom(:)
456-
457-
@:ASSERT(this%tInitialised)
458-
459-
deltaQAtom = this%deltaQAtom
460-
461-
end subroutine getDeltaQAtom
462-
463-
464445
!> Update potential shifts. Call after updateCharges
465446
subroutine updateShifts(this, env, orb, species, iNeighbour, img2CentCell)
466447

src/dftbp/dftbplus/main.F90

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,14 @@ subroutine processOutputCharges(env, this)
877877

878878
end if
879879

880+
if (allocated(this%dftbMultiExpan)) then
881+
call this%dftbMultiExpan%updateDeltaDQAtom(this%ints%overlap, this%rhoPrim(:,1),&
882+
& this%orb, this%neighbourList%iNeighbour, this%nNeighbourSK, this%img2CentCell,&
883+
& this%iSparseStart, this%q0)
884+
885+
call this%dftbMultiExpan%updateDQPotentials(sum(this%qOutput(:,:,1) - this%q0(:,:,1), dim=1))
886+
end if
887+
880888
#:if WITH_TRANSPORT
881889
! Overrides input charges with uploaded contact charges
882890
if (this%tUpload) then
@@ -1427,11 +1435,11 @@ subroutine processGeometry(this, env, iGeoStep, iLatGeoStep, tWriteRestart, tSto
14271435
& this%nNeighbourCam, this%nNeighbourCamSym, this%deltaDftb, errStatus)
14281436
if (errStatus%hasError()) call error(errStatus%message)
14291437

1430-
if (allocated(this%dftbMultiExpan)) then
1431-
call this%dftbMultiExpan%updateDeltaDQAtom(this%ints%overlap, this%rhoPrim(:,1),&
1432-
& this%orb, this%neighbourList%iNeighbour, this%nNeighbourSK, this%img2CentCell,&
1433-
& this%iSparseStart, this%q0)
1434-
end if
1438+
! if (allocated(this%dftbMultiExpan)) then
1439+
! call this%dftbMultiExpan%updateDeltaDQAtom(this%ints%overlap, this%rhoPrim(:,1),&
1440+
! & this%orb, this%neighbourList%iNeighbour, this%nNeighbourSK, this%img2CentCell,&
1441+
! & this%iSparseStart, this%q0)
1442+
! end if
14351443

14361444
if (this%tWriteBandDat) then
14371445
if (this%deltaDftb%nDeterminant() == 1) then

0 commit comments

Comments
 (0)