Commit f9bbab3a authored by Daniel Wortmann's avatar Daniel Wortmann

Refactored PW part of xc-correlation potential setup

parent 95583309
......@@ -33,8 +33,8 @@ vgen/prp_xcfft_map.f90
vgen/psqpw.F90
vgen/rotate_int_den_to_local.F90
vgen/vintcz.f90
vgen/visxc.f90
vgen/visxcg.f90
vgen/vis_xc.F90
vgen/pw_tofrom_grid.F90
vgen/vmatgen.f90
vgen/vmts.F90
vgen/vmt_xc.F90
......
This diff is collapsed.
This diff is collapsed.
......@@ -22,8 +22,7 @@ CONTAINS
USE m_vmt_xc
USE m_vvacxc
USE m_vvacxcg
USE m_visxc
USE m_visxcg
USE m_vis_xc
USE m_checkdopall
USE m_cdn_io
USE m_types
......@@ -54,7 +53,7 @@ CONTAINS
TYPE(t_potden) :: workDen,exc,veff
! .. Local Scalars ..
INTEGER i,i3,irec2,irec3,ivac,j,js,k,k3,lh,n,nzst1
INTEGER ifftd,ifftd2, ifftxc3d
INTEGER ifftd2
INTEGER jsp,l
#ifdef CPP_MPI
include 'mpif.h'
......@@ -122,26 +121,10 @@ CONTAINS
! ----------------------------------------
! ---> interstitial region
CALL timestart("Vxc in interstitial")
ifftd=27*stars%mx1*stars%mx2*stars%mx3
IF ( (.NOT. obsolete%lwb) .OR. ( .not.xcpot%is_gga() ) ) THEN
! no White-Bird-trick
ifftxc3d = stars%kxc1_fft*stars%kxc2_fft*stars%kxc3_fft
IF ( .NOT.xcpot%is_gga() ) THEN
! LDA
CALL visxc(ifftd,stars,noco,xcpot,input,den,vTot,vx,exc)
ELSE ! GGA
CALL visxcg(ifftd,stars,sym,ifftxc3d,cell,den,xcpot,input,&
obsolete,noco,vTot,vx,exc)
END IF
CALL vis_xc(stars,sym,cell,den,xcpot,input,noco,vTot,vx,exc)
ELSE
! White-Bird-trick
......
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_vis_xc
USE m_juDFT
! ******************************************************
! subroutine generates the exchange-correlation potential
! in the interstitial region c.l.fu
! including gradient corrections. t.a. 1996.
! ******************************************************
CONTAINS
SUBROUTINE vis_xc(stars,sym,cell,den,xcpot,input,noco, vxc,vx,exc)
! ******************************************************
! instead of visxcor.f: the different exchange-correlation
! potentials defined through the key icorr are called through
! the driver subroutine vxcallg.f,for the energy density - excallg
! subroutines vectorized
! ** r.pentcheva 22.01.96
! *********************************************************
! in case of total = .true. calculates the ex-corr. energy
! density
! ** r.pentcheva 08.05.96
! ******************************************************************
USE m_pw_tofrom_grid
USE m_types
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_input),INTENT(IN) :: input
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_potden),INTENT(IN) :: den
TYPE(t_potden),INTENT(INOUT) :: vxc,vx,exc
TYPE(t_gradients) :: grad
REAL, ALLOCATABLE :: rho(:,:)
REAL, ALLOCATABLE :: v_x(:,:),v_xc(:,:),e_xc(:,:)
CALL init_pw_grid(stars,sym,cell)
!Put the charge on the grid, in GGA case also calculate gradients
CALL pw_to_grid(xcpot,input,noco,stars,cell,den,rho,grad)
ALLOCATE(v_xc,v_x,mold=rho)
CALL xcpot%get_vxc(input%jspins,rho,v_xc,v_x,grad)
!Put the potentials in rez. space.
CALL pw_from_grid(stars,input%total,v_xc,vxc)
CALL pw_from_grid(stars,input%total,v_x,vx)
!calculate the ex.-cor energy density
IF (ALLOCATED(exc%pw_w)) THEN
ALLOCATE ( e_xc(SIZE(rho,1),1) )
CALL xcpot%get_exc(input%jspins,rho,e_xc(:,1),grad)
CALL pw_from_grid(stars,.true.,e_xc,exc)
ENDIF
CALL finish_pw_grid()
END SUBROUTINE vis_xc
END MODULE m_vis_xc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment