Skip to content

Commit

Permalink
Interface
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Aug 9, 2023
1 parent a28d4d3 commit 68373f6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ subroutine run_driver(config, error)
end if

if (allocated(param)) then
call get_dispersion_atomic(mol, d3, param, realspace_cutoff(), energies,&
call get_dispersion(mol, d3, param, realspace_cutoff(), energies, &
& gradient, sigma)

Check warning on line 181 in app/driver.f90

View check run for this annotation

Codecov / codecov/patch

app/driver.f90#L181

Added line #L181 was not covered by tests
energy = sum(energies)

Expand Down
5 changes: 2 additions & 3 deletions src/dftd3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

module dftd3
use dftd3_cutoff, only : realspace_cutoff, get_lattice_points
use dftd3_disp, only : get_dispersion_atomic, get_dispersion, &
& get_pairwise_dispersion
use dftd3_disp, only : get_dispersion, get_pairwise_dispersion
use dftd3_ncoord, only : get_coordination_number
use dftd3_damping, only : damping_param
use dftd3_damping_mzero, only : mzero_damping_param, new_mzero_damping
Expand All @@ -32,7 +31,7 @@ module dftd3
implicit none
private

public :: get_dispersion_atomic, get_dispersion, get_pairwise_dispersion
public :: get_dispersion, get_pairwise_dispersion
public :: get_coordination_number
public :: realspace_cutoff, get_lattice_points
public :: damping_param, d3_param
Expand Down
14 changes: 11 additions & 3 deletions src/dftd3/disp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ module dftd3_disp
implicit none
private

public :: get_dispersion_atomic, get_dispersion, get_pairwise_dispersion
public :: get_dispersion, get_pairwise_dispersion


!> Calculate dispersion energy
interface get_dispersion
module procedure :: get_dispersion_atomic
module procedure :: get_dispersion_scalar
end interface get_dispersion

contains


!> Calculate atom-resolved dispersion energies.
subroutine get_dispersion_atomic(mol, disp, param, cutoff, energies, gradient, sigma)

!> Molecular structure data
Expand Down Expand Up @@ -100,7 +107,8 @@ subroutine get_dispersion_atomic(mol, disp, param, cutoff, energies, gradient, s
end subroutine get_dispersion_atomic


subroutine get_dispersion(mol, disp, param, cutoff, energy, gradient, sigma)
!> Calculate scalar dispersion energy.
subroutine get_dispersion_scalar(mol, disp, param, cutoff, energy, gradient, sigma)

!> Molecular structure data
class(structure_type), intent(in) :: mol
Expand Down Expand Up @@ -131,7 +139,7 @@ subroutine get_dispersion(mol, disp, param, cutoff, energy, gradient, sigma)

energy = sum(energies)

end subroutine get_dispersion
end subroutine get_dispersion_scalar


!> Wrapper to handle the evaluation of pairwise representation of the dispersion energy
Expand Down
1 change: 1 addition & 0 deletions src/dftd3/output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ subroutine ascii_system_properties(unit, mol, disp, cn, c6)
end subroutine ascii_system_properties


!> Print atom-resolved dispersion energies
subroutine ascii_energy_atom(unit, mol, energies)

Check warning on line 144 in src/dftd3/output.f90

View check run for this annotation

Codecov / codecov/patch

src/dftd3/output.f90#L144

Added line #L144 was not covered by tests

!> Unit for output
Expand Down

0 comments on commit 68373f6

Please sign in to comment.