Commit f4d1c6f1 authored by Gregor Michalicek's avatar Gregor Michalicek

Integrate m_perp call into magMoms subroutine

parent a91ad88e
...@@ -8,20 +8,24 @@ MODULE m_magMoms ...@@ -8,20 +8,24 @@ MODULE m_magMoms
CONTAINS CONTAINS
SUBROUTINE magMoms(dimension,input,atoms,chmom) SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,chmom,qa21)
USE m_types USE m_types
USE m_xmlOutput USE m_xmlOutput
USE m_m_perp
IMPLICIT NONE IMPLICIT NONE
TYPE(t_dimension), INTENT(IN) :: dimension TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input TYPE(t_input), INTENT(IN) :: input
TYPE(t_atoms), INTENT(IN) :: atoms TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_noco), INTENT(INOUT) :: noco
TYPE(t_potden),INTENT(IN) :: vTot
REAL, INTENT(INOUT) :: chmom(atoms%ntype,dimension%jspd) REAL, INTENT(INOUT) :: chmom(atoms%ntype,dimension%jspd)
COMPLEX, INTENT(IN) :: qa21(atoms%ntype)
INTEGER :: iType, j INTEGER :: iType, j, iRepAtom
REAL :: smom REAL :: smom
CHARACTER(LEN=20) :: attributes(4) CHARACTER(LEN=20) :: attributes(4)
...@@ -29,6 +33,7 @@ SUBROUTINE magMoms(dimension,input,atoms,chmom) ...@@ -29,6 +33,7 @@ SUBROUTINE magMoms(dimension,input,atoms,chmom)
WRITE (16,FMT=8020) WRITE (16,FMT=8020)
CALL openXMLElement('magneticMomentsInMTSpheres',(/'units'/),(/'muBohr'/)) CALL openXMLElement('magneticMomentsInMTSpheres',(/'units'/),(/'muBohr'/))
iRepAtom = 1
DO iType = 1, atoms%ntype DO iType = 1, atoms%ntype
smom = chmom(iType,1) - chmom(iType,input%jspins) smom = chmom(iType,1) - chmom(iType,input%jspins)
WRITE (6,FMT=8030) iType,smom, (chmom(iType,j),j=1,input%jspins) WRITE (6,FMT=8030) iType,smom, (chmom(iType,j),j=1,input%jspins)
...@@ -41,6 +46,14 @@ SUBROUTINE magMoms(dimension,input,atoms,chmom) ...@@ -41,6 +46,14 @@ SUBROUTINE magMoms(dimension,input,atoms,chmom)
CALL writeXMLElementFormPoly('magneticMoment',(/'atomType ','moment ','spinUpCharge ',& CALL writeXMLElementFormPoly('magneticMoment',(/'atomType ','moment ','spinUpCharge ',&
'spinDownCharge'/),& 'spinDownCharge'/),&
attributes,reshape((/8,6,12,14,6,15,15,15/),(/4,2/))) attributes,reshape((/8,6,12,14,6,15,15,15/),(/4,2/)))
IF (noco%l_mperp) THEN
!calculate the perpendicular part of the local moment
!and relax the angle of the local moment or calculate
!the constraint B-field.
CALL m_perp(atoms,iType,iRepAtom,noco,vTot%mt(:,0,:,:),chmom,qa21)
END IF
iRepAtom= iRepAtom + atoms%neq(iType)
END DO END DO
CALL closeXMLElement('magneticMomentsInMTSpheres') CALL closeXMLElement('magneticMomentsInMTSpheres')
......
...@@ -32,7 +32,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,& ...@@ -32,7 +32,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
USE m_rwnoco USE m_rwnoco
USE m_cored USE m_cored
USE m_coredr USE m_coredr
USE m_m_perp
USE m_types USE m_types
USE m_xmlOutput USE m_xmlOutput
USE m_magMoms USE m_magMoms
...@@ -328,18 +327,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,& ...@@ -328,18 +327,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
noco_new = noco noco_new = noco
CALL magMoms(dimension,input,atoms,chmom) CALL magMoms(dimension,input,atoms,noco_new,vTot,chmom,qa21)
IF (noco%l_mperp) THEN
iatom = 1
DO n = 1,atoms%ntype
!calculate the perpendicular part of the local moment
!and relax the angle of the local moment or calculate
!the constraint B-field.
CALL m_perp(atoms,n,iatom,noco_new,vTot%mt(:,0,:,:),chmom,qa21)
iatom= iatom + atoms%neq(n)
END DO
END IF
!save the new nocoinp file if the dierctions of the local !save the new nocoinp file if the dierctions of the local
!moments are relaxed or a constraint B-field is calculated. !moments are relaxed or a constraint B-field is calculated.
......
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