Commit ff6793c4 authored by Matthias Redies's avatar Matthias Redies

clean up libxc_postproc

parent a6bf96fa
......@@ -6,8 +6,6 @@
MODULE m_libxc_postprocess_gga
CONTAINS
SUBROUTINE libxc_postprocess_gga_mt(xcpot,atoms,sphhar,n,v_xc,grad)
USE m_mt_tofrom_grid
USE m_types
......@@ -55,7 +53,7 @@ CONTAINS
nsp=SIZE(v_xc,1) !no of points
n_sigma=MERGE(1,3,SIZE(v_xc,2)==1) !See in _mt routine
ALLOCATE(vsigma_g(stars%ng3,n_sigma),vsigma(nsp,n_sigma));vsigma_g=0.0
ALLOCATE(vsigma_g(stars%ng3,n_sigma),vsigma(nsp,n_sigma)); vsigma_g=0.0
vsigma=TRANSPOSE(grad%vsigma) !create a (nsp,n_sigma) matrix
CALL pw_from_grid(xcpot,stars,.FALSE.,vsigma,vsigma_g)
!vsigma_g(:,1)=vsigma_g(:,1)*stars%nstr(:)
......@@ -66,37 +64,6 @@ CONTAINS
END SUBROUTINE libxc_postprocess_gga_pw
SUBROUTINE libxc_postprocess_gga_pw_alt(xcpot,stars,cell,v_xc,grad)
USE m_pw_tofrom_grid
USE m_types
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_cell),INTENT(IN) :: cell
REAL,INTENT(INOUT) :: v_xc(:,:)
TYPE(t_gradients),INTENT(IN):: grad
COMPLEX,ALLOCATABLE:: vsigma_g(:,:)
REAL,ALLOCATABLE:: vsigma(:,:)
TYPE(t_gradients)::grad_vsigma
INTEGER :: nsp,n_sigma,i
nsp=SIZE(v_xc,1) !no of points
n_sigma=MERGE(1,3,SIZE(v_xc,2)==1) !See in _mt routine
ALLOCATE(vsigma_g(stars%ng3,n_sigma),vsigma(nsp,n_sigma));vsigma_g=0.0
ALLOCATE(grad_vsigma%gr(3,nsp,n_sigma))
DO i=1,3
vsigma=TRANSPOSE(grad%vsigma) !create a (nsp,n_sigma) matrix
!Multiply with gradient
vsigma(:,1)=vsigma(:,1)*grad%gr(i,:,1)
CALL pw_from_grid(xcpot,stars,.FALSE.,vsigma,vsigma_g)
CALL pw_to_grid(xcpot,n_sigma,.FALSE.,stars,cell,vsigma_g,grad_vsigma)
v_xc(:,1)=v_xc(:,1)-2*grad_vsigma%gr(i,:,1)
ENDDO
END SUBROUTINE libxc_postprocess_gga_pw_alt
SUBROUTINE libxc_postprocess_gga(vsigma,grad,grad_vsigma,v_xc)
USE m_types
IMPLICIT NONE
......@@ -119,5 +86,4 @@ CONTAINS
END SUBROUTINE libxc_postprocess_gga
END MODULE m_libxc_postprocess_gga
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