aboutsummaryrefslogtreecommitdiff
blob: 39035274564a3d30450ef72c45fc44bb2f3f93b0 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
diff -urN bigdft-1.2.0.old/src/PSolver/xcenergy.f90 bigdft-1.2.0.new/src/PSolver/xcenergy.f90
--- bigdft-1.2.0.old/src/PSolver/xcenergy.f90      2008-12-09 17:41:42.000000000 +0100
+++ bigdft-1.2.0.new/src/PSolver/xcenergy.f90      2009-11-19 15:19:03.000000000 +0100
@@ -96,16 +96,16 @@
   real(dp) :: elocal,vlocal,rho,pot,potion,facpotion,sfactor
   integer :: npts,i_all,order,offset,i_stat,ispden
   integer :: i1,i2,i3,j1,j2,j3,jp2,jpp2,jppp2
-  integer :: ndvxc,nvxcdgr,ngr2
+  integer :: ndvxc,nvxcdgr,ngr2,nd2vxc
 
   !interface with drivexc
   interface
-     subroutine drivexc(exc,ixc,npts,nspden,order,rho_updn,vxc,ndvxc,ngr2,nvxcdgr,&
-          dvxc,d2vxc,grho2_updn,vxcgr,exexch)    !Optional arguments 
+     subroutine drivexc(exc,ixc,npts,nspden,order,rho_updn,vxc,ndvxc,ngr2,nd2vxc,nvxcdgr,&
+          dvxc,d2vxc,grho2_updn,vxcgr,exexch,lrho_updn,vxclrho,tau_updn,vxctau)!Optional arguments
        implicit none
        !Arguments ------------------------------------
        !scalars
-       integer,intent(in) :: ixc,ndvxc,ngr2,npts,nspden,nvxcdgr,order
+       integer,intent(in) :: ixc,ndvxc,ngr2,nd2vxc,npts,nspden,nvxcdgr,order
        integer,intent(in),optional :: exexch
        !arrays
        real(kind=8),intent(in) :: rho_updn(npts,nspden)
@@ -113,6 +113,8 @@
        real(kind=8),intent(out) :: exc(npts),vxc(npts,nspden)
        real(kind=8),intent(out),optional :: d2vxc(npts),dvxc(npts,ndvxc)
        real(kind=8),intent(out),optional :: vxcgr(npts,nvxcdgr)
+       real(kind=8),intent(in),optional :: lrho_updn(npts,nspden), tau_updn(npts,nspden)
+       real(kind=8),intent(out),optional :: vxclrho(npts,nspden),vxctau(npts,nspden)
      end subroutine drivexc
   end interface
 
@@ -153,7 +155,8 @@
 !     end do
 
      !Allocations of the exchange-correlation terms, depending on the ixc value
-     call size_dvxc(ixc,ndvxc,ngr2,nspden,nvxcdgr,order)
+     nd2vxc=1
+     call size_dvxc(ixc,ndvxc,ngr2,nd2vxc,nspden,nvxcdgr,order)
 
      if (ixc >= 11 .and. ixc <= 16) then
         !computation of the gradient
@@ -204,26 +207,26 @@
      if (ixc >= 11 .and. ixc <= 16) then
       if (order**2 <= 1 .or. ixc == 16) then
          if (ixc /= 13) then             
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                  &grho2_updn=gradient,vxcgr=dvxcdgr) 
          else
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                  &grho2_updn=gradient) 
          end if
       else if (order /= 3) then
          if (ixc /= 13) then             
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                  &dvxc=dvxci,grho2_updn=gradient,vxcgr=dvxcdgr) 
          else
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                  &dvxc=dvxci,grho2_updn=gradient) 
          end if
       else if (order == 3) then
          if (ixc /= 13) then             
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                  &dvxc=dvxci,d2vxc=d2vxci,grho2_updn=gradient,vxcgr=dvxcdgr) 
          else
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                  &dvxc=dvxci,d2vxc=d2vxci,grho2_updn=gradient) 
          end if
       end if
@@ -259,12 +262,12 @@
         !cases without gradient
      else
         if (order**2 <=1 .or. ixc >= 31 .and. ixc<=34) then
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr)
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr)
         else if (order==3 .and. (ixc==3 .or. ixc>=7 .and. ixc<=10)) then
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                 &dvxc=dvxci,d2vxc=d2vxci)
         else
-           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nvxcdgr,&
+           call drivexc(exci,ixc,npts,nspden,order,rhopot(1,1,offset,1),vxci,ndvxc,ngr2,nd2vxc,nvxcdgr,&
                 &dvxc=dvxci)
         end if
      end if