Commit 39b856f7 authored by Alexander Neukirchen's avatar Alexander Neukirchen

searching for the problem; in pw_to_grid?

parent 8bf35788
......@@ -40,7 +40,7 @@ CONTAINS
END SUBROUTINE init_pw_grid
SUBROUTINE pw_to_grid(dograds,jspins,l_noco,stars,cell,den_pw,grad,rho)
SUBROUTINE pw_to_grid(dograds,jspins,l_noco,stars,cell,den_pw,grad,rho,xcpot)
!.....------------------------------------------------------------------
!-------> abbreviations
!
......@@ -75,6 +75,9 @@ CONTAINS
USE m_types
USE m_constants
IMPLICIT NONE
CLASS(t_xcpot), INTENT(IN) :: xcpot
LOGICAL,INTENT(IN) :: dograds
INTEGER,INTENT(IN) :: jspins
LOGICAL,INTENT(IN) :: l_noco
......@@ -216,20 +219,20 @@ CONTAINS
ENDDO !idm
END IF
! CALL xcpot%alloc_gradients(ifftxc3,jspins,grad)
CALL xcpot%alloc_gradients(ifftxc3,jspins,grad)
!!!!!!!THIS IS A QUICKFIX! TO BE REMOVED ASAP!!!!!!!!!
!A. Neukirchen 25.09.19
IF (ALLOCATED(grad%agrt)) THEN
DEALLOCATE(grad%agrt,grad%agru,grad%agrd)
DEALLOCATE(grad%g2ru,grad%g2rd,grad%gggrt)
DEALLOCATE(grad%gggru,grad%gzgr,grad%g2rt)
DEALLOCATE(grad%gggrd,grad%grgru,grad%grgrd)
ENDIF
!IF (ALLOCATED(grad%agrt)) THEN
!DEALLOCATE(grad%agrt,grad%agru,grad%agrd)
!DEALLOCATE(grad%g2ru,grad%g2rd,grad%gggrt)
!DEALLOCATE(grad%gggru,grad%gzgr,grad%g2rt)
!DEALLOCATE(grad%gggrd,grad%grgru,grad%grgrd)
!ENDIF
ALLOCATE(grad%agrt(ifftxc3),grad%agru(ifftxc3),grad%agrd(ifftxc3))
ALLOCATE(grad%g2ru(ifftxc3),grad%g2rd(ifftxc3),grad%gggrt(ifftxc3))
ALLOCATE(grad%gggru(ifftxc3),grad%gzgr(ifftxc3),grad%g2rt(ifftxc3))
ALLOCATE(grad%gggrd(ifftxc3),grad%grgru(ifftxc3),grad%grgrd(ifftxc3))
!ALLOCATE(grad%agrt(ifftxc3),grad%agru(ifftxc3),grad%agrd(ifftxc3))
!ALLOCATE(grad%g2ru(ifftxc3),grad%g2rd(ifftxc3),grad%gggrt(ifftxc3))
!ALLOCATE(grad%gggru(ifftxc3),grad%gzgr(ifftxc3),grad%g2rt(ifftxc3))
!ALLOCATE(grad%gggrd(ifftxc3),grad%grgru(ifftxc3),grad%grgrd(ifftxc3))
!!!!!!!!!
!
......
......@@ -58,7 +58,7 @@ CONTAINS
CALL init_pw_grid(xcpot%needs_grad(),stars,sym,cell)
!Put the charge on the grid, in GGA case also calculate gradients
CALL pw_to_grid(xcpot%needs_grad(),input%jspins,noco%l_noco,stars,cell,den%pw,grad,rho)
CALL pw_to_grid(xcpot%needs_grad(),input%jspins,noco%l_noco,stars,cell,den%pw,grad,rho,xcpot)
ALLOCATE(v_xc,mold=rho)
ALLOCATE(v_x,mold=rho)
......
......@@ -63,7 +63,7 @@ CONTAINS
CALL pw_from_grid(xcpot%needs_grad(),stars,.FALSE.,vsigma,vsigma_g)
!vsigma_g(:,1)=vsigma_g(:,1)*stars%nstr(:)
ALLOCATE(grad_vsigma%gr(3,nsp,n_sigma))
CALL pw_to_grid(xcpot%needs_grad(),n_sigma,.false.,stars,cell,vsigma_g,grad_vsigma)
CALL pw_to_grid(xcpot%needs_grad(),n_sigma,.false.,stars,cell,vsigma_g,grad_vsigma,xcpot)
CALL libxc_postprocess_gga(transpose(grad%vsigma),grad,grad_vsigma,v_xc)
END SUBROUTINE libxc_postprocess_gga_pw
......
......@@ -254,11 +254,11 @@ CONTAINS
CALL init_pw_grid(xcpot%needs_grad(),stars,sym,cell)
CALL pw_to_grid(xcpot%needs_grad(), input%jspins, noco%l_noco, stars, &
cell, EnergyDen%pw, tmp_grad, ED_rs)
cell, EnergyDen%pw, tmp_grad, ED_rs,xcpot)
CALL pw_to_grid(xcpot%needs_grad(), input%jspins, noco%l_noco, stars, &
cell, vTot%pw, tmp_grad, vTot_rs)
cell, vTot%pw, tmp_grad, vTot_rs,xcpot)
CALL pw_to_grid(xcpot%needs_grad(), input%jspins, noco%l_noco, stars, &
cell, den%pw, tmp_grad, den_rs)
cell, den%pw, tmp_grad, den_rs,xcpot)
CALL finish_pw_grid()
......
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