Commit 25868dd7 authored by Alexander Neukirchen's avatar Alexander Neukirchen

fix for last commit; derivatives are now a tad more general

parent a6f87bc1
......@@ -12,7 +12,7 @@
!! In addition to overloading the t_xcpot datatype also mpi_bc_xcpot must be adjusted
!! for additional implementations.
MODULE m_types_xcpot
use m_types_potden
USE m_types_potden
IMPLICIT NONE
PRIVATE
PUBLIC :: t_xcpot,t_gradients
......@@ -69,8 +69,8 @@ MODULE m_types_xcpot
REAL,ALLOCATABLE :: laplace(:,:)
END TYPE t_gradients
CONTAINS
subroutine kED_alloc_mt(kED,nsp_x_jmtd, jspins, n_start, n_types, n_stride)
implicit none
SUBROUTINE kED_alloc_mt(kED,nsp_x_jmtd, jspins, n_start, n_types, n_stride)
IMPLICIT NONE
class(t_kinED), intent(inout) :: kED
integer, intent(in) :: nsp_x_jmtd, jspins, n_start, n_types, n_stride
integer :: cnt, n
......
......@@ -63,7 +63,7 @@ CONTAINS
ALLOCATE (ylhtf, MOLD=ylh)
!Calculate the required lattice harmonics and their derivatives:
CALL lhglptg(sphhar, atoms, rx, atoms%nsp(), xcpot%xcpot_needs_grad(), sym, &
CALL lhglptg(sphhar, atoms, rx, atoms%nsp(), xcpot%needs_grad(), sym, &
ylh, thet, phi, ylht, ylhtt, ylhf, ylhff, ylhtf)
nd = atoms%ntypsy(SUM(atoms%neq(:n - 1)) + 1)
......
......@@ -73,7 +73,7 @@ CONTAINS
USE m_fft3dxc
USE m_fft3d
USE m_types
use m_constants
USE m_constants
IMPLICIT NONE
LOGICAL,INTENT(IN) :: dograds
INTEGER,INTENT(IN) :: jspins
......@@ -215,8 +215,21 @@ CONTAINS
ENDDO !jdm
ENDDO !idm
END IF
CALL 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
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))
!!!!!!!!!
!
! calculate the quantities such as abs(grad(rho)),.. used in
! evaluating the gradient contributions to potential and energy.
......
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