Commit 3ddb201b authored by Robin Hilgers's avatar Robin Hilgers

Fully fully noco not working (temporarily) with LDA anymore after this commit....

Fully fully noco not working (temporarily) with LDA anymore after this commit. Preparations to fix GGA which has never been working with fully fully noco.
parent 16b18e8b
......@@ -46,24 +46,24 @@ SUBROUTINE rotateMagnetToSpinAxis(vacuum,sphhar,stars&
! atoms%theta_mt_avg(i)=0.0
! END IF
! END DO
write(*,*) "mx1"
write(*,*) moments(1,1)
write(*,*) "mz1"
write(*,*) moments(1,3)
write(*,*) "mx2"
write(*,*) moments(2,1)
write(*,*) "mz2"
write(*,*) moments(2,3)
!write(*,*) "mx1"
!write(*,*) moments(1,1)
!write(*,*) "mz1"
!write(*,*) moments(1,3)
!write(*,*) "mx2"
!write(*,*) moments(2,1)
!write(*,*) "mz2"
!write(*,*) moments(2,3)
CALL flipcdn(atoms,input,vacuum,sphhar,stars,sym,noco,oneD,cell,-atoms%phi_mt_avg,-atoms%theta_mt_avg,den)
!write (*,*)"mx my mz"
!CALL sphericaltocart(SQRT(moments(1,1)**2+moments(1,2)**2+moments(1,3)**2),thetaTemp(1),phiTemp(1),x,y,z)
!write(*,*) x,y,z
!CALL sphericaltocart(SQRT(moments(2,1)**2+moments(2,2)**2+moments(2,3)**2),thetaTemp(2),phiTemp(2),x,y,z)
!write(*,*) x,y,z
write(*,*) "atoms%phi_mt_avg"
write(*,*) atoms%phi_mt_avg
write(*,*) "atoms%theta_mt_avg"
write(*,*) atoms%theta_mt_avg
!write(*,*) "atoms%phi_mt_avg"
!!write(*,*) atoms%phi_mt_avg
!write(*,*) "atoms%theta_mt_avg"
!write(*,*) atoms%theta_mt_avg
noco%alph=mod(atoms%phi_mt_avg+phiTemp,2*pimach())
noco%beta=mod(atoms%theta_mt_avg+thetaTemp,2*pimach())
atoms%phi_mt_avg=noco%alph
......
......@@ -28,7 +28,6 @@ SUBROUTINE magnMomFromDen(input,atoms,noco,den,moments)
INTEGER :: jsp,i,j
REAL :: mx,my,mz
REAL :: eps=1E-14
REAL, ALLOCATABLE :: dummyResults(:,:)
......
......@@ -89,7 +89,7 @@ CONTAINS
CALL denRot%init(stars,atoms,sphhar,vacuum,noco,input%jspins,0)
denRot=den
CALL rotate_int_den_to_local(DIMENSION,sym,stars,atoms,sphhar,vacuum,cell,input,noco,oneD,denRot)
IF (noco%l_mtnocoPot) CALL rotate_mt_den_to_local(atoms,sphhar,sym,denrot)
IF (noco%l_mtnocoPot) CALL rotate_mt_den_to_local(atoms,sphhar,sym,noco,denrot)
ENDIF
CALL vgen_xcpot(hybrid,input,xcpot,dimension,atoms,sphhar,stars,vacuum,sym,&
......
......@@ -48,8 +48,6 @@ vgen/b_field.F90
vgen/write_xcstuff.f90
vgen/xy_av_den.f90
vgen/VYukawaFilm.f90
vgen/divergence.f90
vgen/xcBfield.f90
)
#vdW Stuff
set(fleur_F90 ${fleur_F90}
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ CONTAINS
!ENDIF
END SUBROUTINE init_mt_grid
SUBROUTINE mt_to_grid(dograds, jspins, atoms, sphhar, den_mt, n, grad, ch)
SUBROUTINE mt_to_grid(dograds, jspins, atoms, sphhar, den_mt, n, noco ,grad, ch)
USE m_grdchlh
USE m_mkgylm
IMPLICIT NONE
......@@ -64,6 +64,7 @@ CONTAINS
INTEGER, INTENT(IN) :: n, jspins
REAL, INTENT(OUT), OPTIONAL :: ch(:, :)
TYPE(t_gradients), INTENT(INOUT):: grad
TYPE(t_noco), INTENT(IN) :: noco
REAL, ALLOCATABLE :: chlh(:, :, :), chlhdr(:, :, :), chlhdrr(:, :, :)
REAL, ALLOCATABLE :: chdr(:, :), chdt(:, :), chdf(:, :), ch_tmp(:, :)
......
......@@ -12,10 +12,11 @@ MODULE m_rotate_mt_den_tofrom_local
use m_mt_tofrom_grid
IMPLICIT NONE
CONTAINS
SUBROUTINE rotate_mt_den_to_local(atoms,sphhar,sym,den)
SUBROUTINE rotate_mt_den_to_local(atoms,sphhar,sym,noco,den)
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_potden),INTENT(INOUT) :: den
......@@ -35,7 +36,7 @@ CONTAINS
CALL init_mt_grid(4,atoms,sphhar,xcpot%needs_grad(),sym)
DO n=1,atoms%ntype
CALL mt_to_grid(xcpot%needs_grad(),4,atoms,sphhar,den%mt(:,0:,n,:),n,grad,ch)
CALL mt_to_grid(xcpot%needs_grad(),4,atoms,sphhar,den%mt(:,0:,n,:),n,noco,grad,ch)
DO imesh = 1,nsp*atoms%jri(n)
rho_11 = ch(imesh,1)
......@@ -66,11 +67,12 @@ CONTAINS
CALL finish_mt_grid()
END SUBROUTINE rotate_mt_den_to_local
SUBROUTINE rotate_mt_den_from_local(atoms,sphhar,sym,den,vtot)
SUBROUTINE rotate_mt_den_from_local(atoms,sphhar,sym,den,noco,vtot)
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_potden),INTENT(IN) :: den
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_potden),INTENT(INOUT) :: vtot
TYPE(t_xcpot_inbuild) :: xcpot !local xcpot that is LDA to indicate we do not need gradients
......@@ -91,7 +93,7 @@ CONTAINS
vtot%mt(i,:,n,:)=vtot%mt(i,:,n,:)*atoms%rmsh(i,n)**2
ENDDO
CALL mt_to_grid(xcpot%needs_grad(),4,atoms,sphhar,vtot%mt(:,0:,n,:),n,grad,ch)
CALL mt_to_grid(xcpot%needs_grad(),4,atoms,sphhar,vtot%mt(:,0:,n,:),n,noco,grad,ch)
DO imesh = 1,nsp*atoms%jri(n)
vup = ch(imesh,1)
vdown = ch(imesh,2)
......
......@@ -43,7 +43,7 @@ CONTAINS
ELSEIF(noco%l_noco) THEN
CALL vmatgen(stars,atoms,vacuum,sym,input,denRot,vTot)
IF (noco%l_mtnocoPot) THEN
CALL rotate_mt_den_from_local(atoms,sphhar,sym,denRot,vtot)
CALL rotate_mt_den_from_local(atoms,sphhar,sym,denRot,noco,vtot)
END IF
ENDIF
......
......@@ -135,13 +135,10 @@ CONTAINS
CALL timestart("Vxc in MT")
END IF
IF (noco%l_mtNocoPot) THEN
CALL vmt_xc(mpi, sphhar, atoms, denRot, xcpot, input, sym, &
EnergyDen, vTot, vx, exc)
ELSE
CALL vmt_xc(mpi, sphhar, atoms, den, xcpot, input, sym, &
EnergyDen, vTot, vx, exc)
END IF
EnergyDen, noco,vTot, vx, exc)
! add MT EXX potential to vr
IF (mpi%irank == 0) THEN
CALL timestop("Vxc in MT")
......
......@@ -24,7 +24,7 @@
CONTAINS
SUBROUTINE vmt_xc(mpi,sphhar,atoms,&
den,xcpot,input,sym,EnergyDen,vTot,vx,exc)
den,xcpot,input,sym,EnergyDen,noco,vTot,vx,exc)
#include"cpp_double.h"
use m_libxc_postprocess_gga
USE m_mt_tofrom_grid
......@@ -41,6 +41,7 @@
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: den,EnergyDen
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_potden),INTENT(INOUT) :: vTot,vx,exc
#ifdef CPP_MPI
include "mpif.h"
......@@ -105,7 +106,7 @@
call xcpot%kinED%alloc_mt(nsp*atoms%jmtd,input%jspins, n_start, atoms%ntype, n_stride)
DO n = n_start,atoms%ntype,n_stride
loc_n = loc_n + 1
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms,sphhar,den%mt(:,0:,n,:),n,grad,ch)
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms,sphhar,den%mt(:,0:,n,:),n,noco,grad,ch)
!
! calculate the ex.-cor. potential
......@@ -133,7 +134,7 @@
ENDIF
!Add postprocessing for libxc
IF (l_libxc.AND.xcpot%needs_grad()) CALL libxc_postprocess_gga_mt(xcpot,atoms,sphhar,n,v_xc,grad, atom_num=n)
IF (l_libxc.AND.xcpot%needs_grad()) CALL libxc_postprocess_gga_mt(xcpot,atoms,sphhar,noco,n,v_xc,grad, atom_num=n)
CALL mt_from_grid(atoms,sphhar,n,input%jspins,v_xc,vTot%mt(:,0:,n,:))
CALL mt_from_grid(atoms,sphhar,n,input%jspins,v_x,vx%mt(:,0:,n,:))
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
MODULE m_libxc_postprocess_gga
CONTAINS
SUBROUTINE libxc_postprocess_gga_mt(xcpot,atoms,sphhar,n,v_xc,grad, atom_num)
SUBROUTINE libxc_postprocess_gga_mt(xcpot,atoms,sphhar,noco,n,v_xc,grad, atom_num)
USE m_mt_tofrom_grid
USE m_types
use m_judft_string
......@@ -15,6 +15,7 @@ CONTAINS
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_noco),INTENT(IN) :: noco
INTEGER,INTENT(IN) :: n
REAL,INTENT(INOUT) :: v_xc(:,:)
TYPE(t_gradients),INTENT(IN):: grad
......@@ -35,7 +36,7 @@ CONTAINS
vsigma_mt(i,:,:)=vsigma_mt(i,:,:)*atoms%rmsh(i,n)**2
ENDDO
ALLOCATE(grad_vsigma%gr(3,nsp,n_sigma))
CALL mt_to_grid(xcpot%needs_grad(),n_sigma,atoms,sphhar,vsigma_mt,n,grad=grad_vsigma)
CALL mt_to_grid(xcpot%needs_grad(),n_sigma,atoms,sphhar,vsigma_mt,n,noco,grad=grad_vsigma)
CALL libxc_postprocess_gga(transpose(grad%vsigma),grad,grad_vsigma,v_xc)
END SUBROUTINE libxc_postprocess_gga_mt
......
......@@ -231,7 +231,7 @@ CONTAINS
call undo_vgen_finalize(vTot_corrected, atoms, noco, stars)
call set_kinED_is(xcpot, input, noco, stars, sym, cell, den, EnergyDen, vTot_corrected)
call set_kinED_mt(mpi, sphhar, atoms, sym, core_den, val_den, &
call set_kinED_mt(mpi, sphhar, atoms, sym, noco,core_den, val_den, &
xcpot, EnergyDen, input, vTot_corrected)
end subroutine set_kinED
......@@ -267,7 +267,7 @@ CONTAINS
xcpot%kinED%set = .True.
end subroutine set_kinED_is
subroutine set_kinED_mt(mpi, sphhar, atoms, sym, core_den, val_den, &
subroutine set_kinED_mt(mpi, sphhar, atoms, sym, noco,core_den, val_den, &
xcpot, EnergyDen, input, vTot)
use m_types
use m_mt_tofrom_grid
......@@ -276,6 +276,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_potden),INTENT(IN) :: core_den, val_den, EnergyDen, vTot
CLASS(t_xcpot),INTENT(INOUT) :: xcpot
TYPE(t_input),INTENT(IN) :: input
......@@ -317,19 +318,19 @@ CONTAINS
vTot_mt(jr,0:,:) = vTot%mt(jr,0:,n,:) * atoms%rmsh(jr,n)**2
enddo
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms, sphhar, EnergyDen%mt(:, 0:, n, :), &
n, tmp_grad, ED_rs)
n, noco, tmp_grad, ED_rs)
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms, sphhar, vTot_mt(:,0:,:), &
n, tmp_grad, vTot_rs)
n, noco,tmp_grad, vTot_rs)
tmp_sphhar%nlhd = sphhar%nlhd
tmp_sphhar%nlh = [(0, cnt=1,size(sphhar%nlh))]
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms, tmp_sphhar, vTot_mt(:,0:0,:), &
n, tmp_grad, vTot0_rs)
n, noco, tmp_grad, vTot0_rs)
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms, sphhar, &
core_den%mt(:,0:,n,:), n, tmp_grad, core_den_rs)
core_den%mt(:,0:,n,:), n,noco, tmp_grad, core_den_rs)
CALL mt_to_grid(xcpot%needs_grad(), input%jspins, atoms, sphhar, &
val_den%mt(:,0:,n,:), n, tmp_grad, val_den_rs)
val_den%mt(:,0:,n,:), n,noco, tmp_grad, val_den_rs)
call calc_kinEnergyDen_mt(ED_RS, vTot_rs, vTot0_rs, core_den_rs, val_den_rs, &
xcpot%kinED%mt(:,:,loc_n))
......
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