potl0.f 1.47 KB
Newer Older
1 2 3 4 5 6 7
      MODULE m_potl0
c     ******************************************************************
c     evaluate the xc-potential vxc for charge density and its
c     gradients,dens,... only for nonmagnetic.
c     ******************************************************************
      CONTAINS
      SUBROUTINE potl0(
8
     >                 xcpot,mshd,jspd,jspins,msh,dx,rad,dens,
9 10 11 12
     <                 vxc)

      USE m_grdchlh
      USE m_mkgl0
13
      USE m_types
14 15
      IMPLICIT NONE
c     ..
16
      CLASS(t_xcpot),intent(in)::xcpot
17 18 19 20 21 22 23 24
      INTEGER, INTENT (IN) :: jspins,jspd,mshd,msh
      REAL,    INTENT (IN) :: dx
      REAL,    INTENT (IN) :: rad(msh),dens(mshd,jspd)
      REAL,    INTENT (OUT):: vxc(mshd,jspd)

c     .. previously untyped names ..
      INTEGER,PARAMETER :: ndvgrd=6

25 26
      TYPE(t_gradients)::grad

27
      INTEGER i,ispin
28
      REAL, ALLOCATABLE :: drr(:,:),ddrr(:,:)
29 30 31
      
      REAL              :: vx(mshd,jspd)

32
      ALLOCATE ( drr(mshd,jspd),ddrr(mshd,jspd)) 
33 34 35
!
!-->  evaluate gradients of dens.
!
36
      CALL xcpot%alloc_gradients(msh,1,grad)
37 38 39 40 41 42 43 44
      DO ispin = 1, jspins
        CALL grdchlh(
     >               1,1,msh,dx,rad,dens(1,ispin),ndvgrd,
     <               drr(1,ispin),ddrr(1,ispin))
      ENDDO

      CALL mkgl0(
     >           mshd,msh,jspd,jspins,rad,dens,drr,ddrr,
45
     <           grad)
46 47 48
!
! --> calculate the potential.
!
49
      call xcpot%get_vxc(jspins,dens,vxc,vx,grad)
50

51
      DEALLOCATE ( drr,ddrr )
52 53
      END SUBROUTINE potl0
      END MODULE m_potl0