madelcoef Subroutine

public subroutine madelcoef(linterface, lpot, a, b, smat, cleb, icleb, iend, lpotd, lmpotd, lmxspd, nclebd)

Calculation of the structure dependent Madelung coefficients for the determination of the electrostatic potential.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: linterface

If True a matching with semi-inifinite surfaces must be performed

integer, intent(in) :: lpot

Maximum l component in potential expansion

real(kind=dp), intent(out), dimension(lmpotd, lmpotd) :: a

Madelung coefficients

real(kind=dp), intent(out), dimension(lmpotd) :: b

Madelung coefficients

real(kind=dp), intent(in), dimension(lmxspd) :: smat

Lattice summations coming from the Ewald method

real(kind=dp), intent(in), dimension(nclebd) :: cleb

!! GAUNT coefficients (GAUNT)

integer, intent(in), dimension(nclebd,3) :: icleb

Pointer array

integer, intent(in) :: iend

Number of nonzero gaunt coefficients

integer, intent(in) :: lpotd

Maximum l component in potential expansion

integer, intent(in) :: lmpotd

(lpot+1)**2

integer, intent(in) :: lmxspd

(2lpot+1)*2

integer, intent(in) :: nclebd

lmxspd*lmpotd