Commit 5216671f authored by Gregor Michalicek's avatar Gregor Michalicek

Make use of vTot%pw_w and vTot%pw mor consistent with respect to their content

pw_w is the warped potential (with step function)
pw is the potential without the step function
parent 40779707
...@@ -68,7 +68,7 @@ CONTAINS ...@@ -68,7 +68,7 @@ CONTAINS
CALL timestart("Interstitial part") CALL timestart("Interstitial part")
!Generate interstitial part of Hamiltonian !Generate interstitial part of Hamiltonian
CALL hs_int(input,noco,stars,lapw,mpi,cell,isp,v%pw,smat,hmat) CALL hs_int(input,noco,stars,lapw,mpi,cell,isp,v%pw_w,smat,hmat)
CALL timestop("Interstitial part") CALL timestop("Interstitial part")
CALL timestart("MT part") CALL timestart("MT part")
!MT-part of Hamiltonian. In case of noco, we need an loop over the local spin of the atoms !MT-part of Hamiltonian. In case of noco, we need an loop over the local spin of the atoms
......
...@@ -37,18 +37,15 @@ CONTAINS ...@@ -37,18 +37,15 @@ CONTAINS
ENDDO ENDDO
ENDDO ! js =1,input%jspins ENDDO ! js =1,input%jspins
! Rescale pw_w with number of stars
!Copy pw_w into pw if present and rescale with number of stars IF (.NOT.noco%l_noco) THEN
IF (.NOT.noco%l_noco.AND.ALLOCATED(vtot%pw_w)) THEN
DO js=1,SIZE(vtot%pw_w,2) DO js=1,SIZE(vtot%pw_w,2)
DO i=1,stars%ng3 DO i=1,stars%ng3
vTot%pw(i,js)=vtot%pw_w(i,js)/stars%nstr(i) vTot%pw_w(i,js)=vtot%pw_w(i,js) / stars%nstr(i)
ENDDO END DO
ENDDO END DO
DEALLOCATE(vtot%pw_w)
ELSEIF(noco%l_noco) THEN ELSEIF(noco%l_noco) THEN
CALL vmatgen(stars, atoms,vacuum,sym,input, denRot,vtot) CALL vmatgen(stars,atoms,vacuum,sym,input,denRot,vTot)
IF (ALLOCATED(vtot%pw_w)) DEALLOCATE(vtot%pw_w)
ENDIF ENDIF
!Copy first vacuum into second vacuum if this was not calculated before !Copy first vacuum into second vacuum if this was not calculated before
......
...@@ -23,7 +23,7 @@ MODULE m_vmatgen ...@@ -23,7 +23,7 @@ MODULE m_vmatgen
! Philipp Kurz 99/11/01 ! Philipp Kurz 99/11/01
!********************************************************************** !**********************************************************************
CONTAINS CONTAINS
SUBROUTINE vmatgen(stars, atoms,vacuum, sym,input, den,v) SUBROUTINE vmatgen(stars,atoms,vacuum,sym,input,den,vTot)
!******** ABBREVIATIONS *********************************************** !******** ABBREVIATIONS ***********************************************
! ifft3 : size of the 3d real space mesh ! ifft3 : size of the 3d real space mesh
...@@ -48,7 +48,7 @@ CONTAINS ...@@ -48,7 +48,7 @@ CONTAINS
TYPE(t_stars),INTENT(IN) :: stars TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: den TYPE(t_potden),INTENT(IN) :: den
TYPE(t_potden),INTENT(INOUT):: v TYPE(t_potden),INTENT(INOUT):: vTot
! .. ! ..
...@@ -70,7 +70,7 @@ CONTAINS ...@@ -70,7 +70,7 @@ CONTAINS
!---> fouriertransform the spin up and down potential !---> fouriertransform the spin up and down potential
!---> in the interstitial, vpw, to real space (vis) !---> in the interstitial, vpw, to real space (vis)
DO jspin = 1,input%jspins DO jspin = 1,input%jspins
CALL fft3d(vis(:,jspin),fftwork, v%pw(:,jspin), stars,+1) CALL fft3d(vis(:,jspin),fftwork, vTot%pw(:,jspin), stars,+1)
ENDDO ENDDO
!---> calculate the four components of the matrix potential on !---> calculate the four components of the matrix potential on
...@@ -102,9 +102,9 @@ CONTAINS ...@@ -102,9 +102,9 @@ CONTAINS
!---> Fouriertransform the matrix potential back to reciprocal space !---> Fouriertransform the matrix potential back to reciprocal space
DO ipot = 1,2 DO ipot = 1,2
fftwork=0.0 fftwork=0.0
CALL fft3d(vis(:,ipot),fftwork, v%pw(1,ipot), stars,-1) CALL fft3d(vis(:,ipot),fftwork, vTot%pw_w(1,ipot), stars,-1)
ENDDO ENDDO
CALL fft3d(vis(:,3),vis(:,4), v%pw(1,3), stars,-1) CALL fft3d(vis(:,3),vis(:,4), vTot%pw_w(1,3), stars,-1)
IF (.NOT. input%film) RETURN IF (.NOT. input%film) RETURN
...@@ -131,7 +131,7 @@ CONTAINS ...@@ -131,7 +131,7 @@ CONTAINS
! & %igf,odl%pgf,odi%nst2) ! & %igf,odl%pgf,odi%nst2)
ELSE ELSE
CALL fft2d(stars, vvacxy(:,imz,ivac,jspin),fftwork,& CALL fft2d(stars, vvacxy(:,imz,ivac,jspin),fftwork,&
v%vacz(imz,ivac,jspin),vziw,v%vacxy(imz,1,ivac,jspin), vacuum%nmzxyd,1) vTot%vacz(imz,ivac,jspin),vziw,vTot%vacxy(imz,1,ivac,jspin), vacuum%nmzxyd,1)
ENDIF ENDIF
ENDDO ENDDO
ENDDO ENDDO
...@@ -155,16 +155,16 @@ CONTAINS ...@@ -155,16 +155,16 @@ CONTAINS
ENDDO ENDDO
ENDDO ENDDO
DO imz = vacuum%nmzxyd+1,vacuum%nmzd DO imz = vacuum%nmzxyd+1,vacuum%nmzd
vup = v%vacz(imz,ivac,1) vup = vTot%vacz(imz,ivac,1)
vdown = v%vacz(imz,ivac,2) vdown = vTot%vacz(imz,ivac,2)
theta = den%theta_vacz(imz,ivac) theta = den%theta_vacz(imz,ivac)
phi = den%phi_vacz(imz,ivac) phi = den%phi_vacz(imz,ivac)
veff = (vup + vdown)/2.0 veff = (vup + vdown)/2.0
beff = (vup - vdown)/2.0 beff = (vup - vdown)/2.0
v%vacz(imz,ivac,1) = veff + beff*COS(theta) vTot%vacz(imz,ivac,1) = veff + beff*COS(theta)
v%vacz(imz,ivac,2) = veff - beff*COS(theta) vTot%vacz(imz,ivac,2) = veff - beff*COS(theta)
v%vacz(imz,ivac,3) = beff*SIN(theta)*COS(phi) vTot%vacz(imz,ivac,3) = beff*SIN(theta)*COS(phi)
v%vacz(imz,ivac,4) = beff*SIN(theta)*SIN(phi) vTot%vacz(imz,ivac,4) = beff*SIN(theta)*SIN(phi)
ENDDO ENDDO
ENDDO ENDDO
...@@ -184,7 +184,7 @@ CONTAINS ...@@ -184,7 +184,7 @@ CONTAINS
! & %igf,odl%pgf,odi%nst2) ! & %igf,odl%pgf,odi%nst2)
ELSE ELSE
CALL fft2d(stars, vvacxy(:,imz,ivac,ipot),fftwork,& CALL fft2d(stars, vvacxy(:,imz,ivac,ipot),fftwork,&
v%vacz(imz,ivac,ipot),vziw,v%vacxy(imz,:,ivac,ipot), vacuum%nmzxyd,-1) vTot%vacz(imz,ivac,ipot),vziw,vTot%vacxy(imz,:,ivac,ipot), vacuum%nmzxyd,-1)
END IF END IF
ENDDO ENDDO
ENDDO ENDDO
...@@ -204,7 +204,7 @@ CONTAINS ...@@ -204,7 +204,7 @@ CONTAINS
! & %igf,odl%pgf,odi%nst2) ! & %igf,odl%pgf,odi%nst2)
ELSE ELSE
CALL fft2d(stars, vvacxy(:,imz,ivac,3),vvacxy(:,imz,ivac,4),& CALL fft2d(stars, vvacxy(:,imz,ivac,3),vvacxy(:,imz,ivac,4),&
v%vacz(imz,ivac,3),v%vacz(imz,ivac,4),v%vacxy(imz,:,ivac,3), vacuum%nmzxyd,-1) vTot%vacz(imz,ivac,3),vTot%vacz(imz,ivac,4),vTot%vacxy(imz,:,ivac,3), vacuum%nmzxyd,-1)
END IF END IF
ENDDO ENDDO
ENDDO ENDDO
......
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