File: x_pbe.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (30 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

! This routine is based on code written by K. Burke.

subroutine x_pbe(kappa,mu,rho,s,u,v,ex,vx)
implicit none
! arguments
real(8), intent(in) :: kappa,mu
real(8), intent(in) :: rho,s,u,v
real(8), intent(out) :: ex,vx
! local variables
real(8), parameter :: ax=-0.7385587663820224058d0
real(8), parameter :: thrd=1.d0/3.d0
real(8), parameter :: thrd4=4.d0/3.d0
real(8) ul,exu,s2,p0
real(8) fxpbe,fs,fss
ul=mu/kappa
! LDA exchange energy density
exu=ax*rho**thrd
! PBE enhancement factor
s2=s**2
p0=1.d0+ul*s2
fxpbe=1.d0+kappa-kappa/p0
ex=exu*fxpbe
fs=2.d0*kappa*ul/(p0*p0)
fss=-4.d0*ul*s*fs/p0
! exchange potential
vx=exu*(thrd4*fxpbe-(u-thrd4*s2*s)*fss-v*fs)
return
end subroutine