Commit b5744639 authored by Gregor Michalicek's avatar Gregor Michalicek

Write out magnetic moments to out.xml

Also in this commit: small bug fixes for core states output and
introduction of valenceDensity hierarchy layer in out.xml.
parent f58b6436
......@@ -88,6 +88,7 @@ CONTAINS
USE m_mpi_col_den ! collect density data from parallel nodes
#endif
USE m_types
USE m_xmlOutput
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_mpi),INTENT(IN) :: mpi
......@@ -325,8 +326,11 @@ CONTAINS
ALLOCATE ( kveclo(atoms%nlotot) )
IF (mpi%irank==0) WRITE (6,FMT=8000) jspin
IF (mpi%irank==0) WRITE (16,FMT=8000) jspin
IF (mpi%irank==0) THEN
WRITE (6,FMT=8000) jspin
WRITE (16,FMT=8000) jspin
CALL openXMLElementPoly('valenceDensity',(/'spin'/),(/jspin/))
END IF
8000 FORMAT (/,/,10x,'valence density: spin=',i2)
CALL cdn_read0(&
......@@ -971,6 +975,7 @@ enddo
ENDIF
!-for
ENDDO ! end of loop ispin = jsp_start,jsp_end
CALL closeXMLElement('valenceDensity')
ENDIF ! end of (mpi%irank==0)
!+t3e
!Note: no deallocation anymore, we rely on Fortran08 :-)
......
......@@ -230,12 +230,12 @@ CONTAINS
fl = fj + (.5e0)*isign(1,kappa(korb))
attributes = ''
WRITE(attributes(1),'(i0)') nprnc(korb)
WRITE(attributes(2),'(i0)') fl
WRITE(attributes(2),'(i0)') NINT(fl)
WRITE(attributes(3),'(f4.1)') fj
WRITE(attributes(4),'(f20.10)') stateEnergies(korb)
WRITE(attributes(5),'(f15.10)') weight
CALL writeXMLElementForm('state',(/'n ','l ','j ','energy','weight'/),&
attributes(1:5),reshape((/1,1,1,6,9,2,2,4,20,15/),(/5,2/)))
attributes(1:5),reshape((/1,1,1,6,6,2,2,4,20,15/),(/5,2/)))
END DO
CALL closeXMLElement('coreStates')
ENDDO
......
......@@ -32,6 +32,7 @@
use m_coredr
use m_m_perp
USE m_types
USE m_xmlOutput
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT):: results
TYPE(t_mpi),INTENT(IN) :: mpi
......@@ -74,6 +75,7 @@
COMPLEX,ALLOCATABLE :: vpw(:,:),vzxy(:,:,:,:)
COMPLEX,ALLOCATABLE :: qpw(:,:),rhtxy(:,:,:,:)
COMPLEX,ALLOCATABLE :: n_mmp(:,:,:,:)
CHARACTER(LEN=20) :: attributes(4)
!---> pk non-collinear
REAL rhoint,momint,alphdiff(atoms%ntypd)
INTEGER igq2_fft(0:stars%kq1d*stars%kq2d-1)
......@@ -351,17 +353,27 @@ enddo
WRITE (6,FMT=8020)
WRITE (16,FMT=8020)
noco_new=noco
CALL openXMLElement('magneticMomentsInMTSpheres',(/'units'/),(/'muBohr'/))
DO n = 1,atoms%ntype
smom = chmom(n,1) - chmom(n,input%jspins)
WRITE (6,FMT=8030) n,smom, (chmom(n,j),j=1,input%jspins)
WRITE (16,FMT=8030) n,smom, (chmom(n,j),j=1,input%jspins)
attributes = ''
WRITE(attributes(1),'(i0)'), n
WRITE(attributes(2),'(f15.10)'), smom
WRITE(attributes(3),'(f15.10)'), chmom(n,1)
WRITE(attributes(4),'(f15.10)'), chmom(n,2)
CALL writeXMLElementFormPoly('magneticMoment',(/'atomType ','moment ','spinUpCharge ',&
'spinDownCharge'/),&
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,n,noco_new,vr(:,0,:,:),chmom,qa21,alphdiff)
ENDIF
enddo
ENDDO
CALL closeXMLElement('magneticMomentsInMTSpheres')
!---> save the new nocoinp file if the dierctions of the local
!---> 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