Line data Source code
1 : MODULE m_potl0
2 : ! ******************************************************************
3 : ! evaluate the xc-potential vxc for charge density and its
4 : ! gradients,dens,... only for nonmagnetic.
5 : ! ******************************************************************
6 : CONTAINS
7 1150 : SUBROUTINE potl0(xcpot,jspins,dx,rad,dens, &
8 1150 : vxc)
9 :
10 : USE m_grdchlh
11 : USE m_mkgl0
12 : USE m_types
13 : IMPLICIT NONE
14 :
15 : CLASS(t_xcpot),intent(in)::xcpot
16 : INTEGER, INTENT (IN) :: jspins
17 : REAL, INTENT (IN) :: dx
18 : REAL, INTENT (IN) :: rad(:),dens(:,:)
19 : REAL, INTENT (OUT):: vxc(:,:)
20 :
21 : ! .. previously untyped names ..
22 :
23 1150 : TYPE(t_gradients)::grad
24 :
25 : INTEGER i,ispin,msh
26 : REAL, ALLOCATABLE :: drr(:,:),ddrr(:,:)
27 :
28 1150 : REAL :: vx(size(vxc,1),jspins)
29 :
30 1150 : msh = size(rad)
31 6900 : ALLOCATE ( drr(msh,jspins),ddrr(msh,jspins))
32 : !
33 : !--> evaluate gradients of dens.
34 : !
35 1150 : CALL xcpot%alloc_gradients(msh,jspins,grad)
36 2987 : DO ispin = 1, jspins
37 : CALL grdchlh(dx,dens(1:msh,ispin),&
38 2987 : drr(:,ispin),ddrr(:,ispin),rad)
39 : ENDDO
40 :
41 : CALL mkgl0(jspins,rad,dens,drr,ddrr,&
42 1150 : grad)
43 : !
44 : ! --> calculate the potential.
45 : !
46 1150 : CALL xcpot%get_vxc(jspins, dens(:msh,:), vxc, vx, grad)
47 :
48 1150 : DEALLOCATE ( drr,ddrr )
49 1150 : END SUBROUTINE potl0
50 : END MODULE m_potl0
|