summaryrefslogtreecommitdiff
path: root/src/labat/ldaec.f
blob: 01e18ca056f01ad282ed8fff3deed9d1ac47d3e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
      subroutine ldaec(rs,zet,ec)
c  uniform-gas correlation of perdew and wang 1991
c  calculates the local correlation energy within the lda approx.
c  input rs  : seitz radius
c  input zet : relative spin polarization 
c  output ec : correlation energy per electron 
      implicit double precision (a-h,o-z)
      data gam,fzz/0.5198421d0,1.709921d0/
      data thrd4/1.333333333333d0/
      f = ((1.d0+zet)**thrd4+(1.d0-zet)**thrd4-2.d0)/gam
      call gcor(0.0310907d0,0.21370d0,7.5957d0,3.5876d0,1.6382d0,
     1     0.49294d0,1.00d0,rs,eu,eurs)
      call gcor(0.01554535d0,0.20548d0,14.1189d0,6.1977d0,3.3662d0,
     1     0.62517d0,1.00d0,rs,ep,eprs)
      call gcor(0.0168869d0,0.11125d0,10.357d0,3.6231d0,0.88026d0,
     1     0.49671d0,1.00d0,rs,alfm,alfrsm)
c  alfm is minus the spin stiffness alfc
      z4 = zet**4
      ec = eu*(1.d0-f*z4)+ep*f*z4-alfm*f*(1.d0-z4)/fzz
      return
      end