diff options
Diffstat (limited to 'src/labat/ldauc.f')
| -rw-r--r-- | src/labat/ldauc.f | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/labat/ldauc.f b/src/labat/ldauc.f new file mode 100644 index 0000000..4285c9a --- /dev/null +++ b/src/labat/ldauc.f | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | subroutine ldauc(rs,zet,ec,ecrs,eczet,vcup,vcdn) | ||
| 2 | c uniform-gas correlation of perdew and wang 1991 | ||
| 3 | c calculates the local correlation potential within the lda approx. | ||
| 4 | c input rs : seitz radius | ||
| 5 | c input zet : relative spin polarization | ||
| 6 | c output ec : correlation energy | ||
| 7 | c output ecrs : derivative of ec with respect to rs | ||
| 8 | c output eczet : derivative of ec with respect to zet | ||
| 9 | c output vcup, vcdn : up- and down-spin potentials | ||
| 10 | implicit double precision (a-h,o-z) | ||
| 11 | data gam,fzz/0.5198421d0,1.709921d0/ | ||
| 12 | data thrd,thrd4/0.333333333333d0,1.333333333333d0/ | ||
| 13 | f = ((1.d0+zet)**thrd4+(1.d0-zet)**thrd4-2.d0)/gam | ||
| 14 | call gcor(0.0310907d0,0.21370d0,7.5957d0,3.5876d0,1.6382d0, | ||
| 15 | 1 0.49294d0,1.00d0,rs,eu,eurs) | ||
| 16 | call gcor(0.01554535d0,0.20548d0,14.1189d0,6.1977d0,3.3662d0, | ||
| 17 | 1 0.62517d0,1.00d0,rs,ep,eprs) | ||
| 18 | call gcor(0.0168869d0,0.11125d0,10.357d0,3.6231d0,0.88026d0, | ||
| 19 | 1 0.49671d0,1.00d0,rs,alfm,alfrsm) | ||
| 20 | c alfm is minus the spin stiffness alfc | ||
| 21 | z4 = zet**4 | ||
| 22 | ec = eu*(1.d0-f*z4)+ep*f*z4-alfm*f*(1.d0-z4)/fzz | ||
| 23 | c energy done. now the potential: | ||
| 24 | ecrs = eurs*(1.d0-f*z4)+eprs*f*z4-alfrsm*f*(1.d0-z4)/fzz | ||
| 25 | fz = thrd4*((1.d0+zet)**thrd-(1.d0-zet)**thrd)/gam | ||
| 26 | eczet = 4.d0*(zet**3)*f*(ep-eu+alfm/fzz)+fz*(z4*ep-z4*eu | ||
| 27 | 1 -(1.d0-z4)*alfm/fzz) | ||
| 28 | comm = ec -rs*ecrs/3.d0-zet*eczet | ||
| 29 | vcup = comm + eczet | ||
| 30 | vcdn = comm - eczet | ||
| 31 | return | ||
| 32 | end | ||
