Commit c2775cea authored by Gregor Michalicek's avatar Gregor Michalicek

Initial commit for writing input data into out.xml

Note that there are still some known issues:

1. Possibly incorrect data for energy parameters, LOs
2. Incomplete data: electron configuration, comment
3. Not neccessarily explicit data: Bravais matrix
parent a799828d
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
CHARACTER(len=3) :: latnamTemp CHARACTER(len=3) :: latnamTemp
INTEGER nu,iofile INTEGER nu,iofile
INTEGER iggachk INTEGER iggachk
INTEGER n ,iostat, errorStatus INTEGER n ,iostat, errorStatus, numSpecies
REAL scale,scpos ,zc REAL scale,scpos ,zc
REAL ello0(atoms%nlod,atoms%ntype),evac0(2) REAL ello0(atoms%nlod,atoms%ntype),evac0(2)
...@@ -416,13 +416,13 @@ ...@@ -416,13 +416,13 @@
IF(errorStatus.NE.0) THEN IF(errorStatus.NE.0) THEN
STOP 'Error: Cannot print out FleurInputSchema.xsd' STOP 'Error: Cannot print out FleurInputSchema.xsd'
END IF END IF
numSpecies = atoms%nat
CALL w_inpXML(& CALL w_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,& & atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,& & cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,name,& & noel,namex,relcor,a1,a2,a3,scale,dtild,name,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,& & xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,& & atomTypeSpecies,speciesRepAtomType,.FALSE.,numSpecies,&
& enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1)) & enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1))
IF(juDFT_was_argument("-explicit")) THEN IF(juDFT_was_argument("-explicit")) THEN
......
...@@ -3,7 +3,9 @@ MODULE m_rinpXML ...@@ -3,7 +3,9 @@ MODULE m_rinpXML
CONTAINS CONTAINS
SUBROUTINE r_inpXML(& SUBROUTINE r_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,dimension,& & atoms,obsolete,vacuum,input,stars,sliceplot,banddos,dimension,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,enpara,sphhar,l_opti) & cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,enpara,sphhar,l_opti,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,xmlElectronStates,&
& xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType)
USE iso_c_binding USE iso_c_binding
USE m_juDFT USE m_juDFT
...@@ -63,7 +65,17 @@ SUBROUTINE r_inpXML(& ...@@ -63,7 +65,17 @@ SUBROUTINE r_inpXML(&
TYPE(t_dimension),INTENT(OUT) :: dimension TYPE(t_dimension),INTENT(OUT) :: dimension
TYPE(t_enpara) ,INTENT(OUT) :: enpara TYPE(t_enpara) ,INTENT(OUT) :: enpara
TYPE(t_sphhar) ,INTENT(OUT) :: sphhar TYPE(t_sphhar) ,INTENT(OUT) :: sphhar
LOGICAL, INTENT(OUT) :: l_opti LOGICAL, INTENT(OUT) :: l_opti
INTEGER, ALLOCATABLE, INTENT(INOUT) :: xmlElectronStates(:,:)
INTEGER, ALLOCATABLE, INTENT(INOUT) :: atomTypeSpecies(:)
INTEGER, ALLOCATABLE, INTENT(INOUT) :: speciesRepAtomType(:)
REAL, ALLOCATABLE, INTENT(INOUT) :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE, INTENT(INOUT) :: xmlPrintCoreStates(:,:)
CHARACTER(len=3), ALLOCATABLE, INTENT(INOUT) :: noel(:)
CHARACTER(len=4), INTENT(OUT) :: namex
CHARACTER(len=12), INTENT(OUT) :: relcor
REAL, INTENT(OUT) :: a1(3),a2(3),a3(3)
REAL, INTENT(OUT) :: scale, dtild
CHARACTER(len=8) :: name(10) CHARACTER(len=8) :: name(10)
...@@ -76,7 +88,7 @@ SUBROUTINE r_inpXML(& ...@@ -76,7 +88,7 @@ SUBROUTINE r_inpXML(&
!-odim !-odim
! .. ! ..
! .. Local Variables ! .. Local Variables
REAL ::dtild ,scpos ,zc REAL :: scpos ,zc
INTEGER ::nw INTEGER ::nw
INTEGER ieq,i,k,na,n,ii INTEGER ieq,i,k,na,n,ii
REAL s3,ah,a,hs2,rest REAL s3,ah,a,hs2,rest
...@@ -122,11 +134,11 @@ SUBROUTINE r_inpXML(& ...@@ -122,11 +134,11 @@ SUBROUTINE r_inpXML(&
INTEGER :: speciesEParams(0:3) INTEGER :: speciesEParams(0:3)
INTEGER :: mrotTemp(3,3,48) INTEGER :: mrotTemp(3,3,48)
REAL :: tauTemp(3,48) REAL :: tauTemp(3,48)
REAL :: a1(3),a2(3),a3(3), bk(3) REAL :: bk(3)
LOGICAL :: flipSpin, l_eV, invSym, l_qfix, relaxX, relaxY, relaxZ, l_gga, l_kpts LOGICAL :: flipSpin, l_eV, invSym, l_qfix, relaxX, relaxY, relaxZ, l_gga, l_kpts
LOGICAL :: l_vca, coreConfigPresent, l_enpara LOGICAL :: l_vca, coreConfigPresent, l_enpara
REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr
REAL :: aTemp, scale, zp, rmtmax, sumWeight, ldau_u, ldau_j, tempReal REAL :: aTemp, zp, rmtmax, sumWeight, ldau_u, ldau_j, tempReal
REAL :: weightScale REAL :: weightScale
LOGICAL :: l_amf LOGICAL :: l_amf
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
...@@ -138,8 +150,6 @@ SUBROUTINE r_inpXML(& ...@@ -138,8 +150,6 @@ SUBROUTINE r_inpXML(&
CHARACTER(LEN=255) :: valueString, lString, nString, token CHARACTER(LEN=255) :: valueString, lString, nString, token
CHARACTER(LEN=255) :: xPathA, xPathB, xPathC, xPathD, xPathE CHARACTER(LEN=255) :: xPathA, xPathB, xPathC, xPathD, xPathE
CHARACTER(LEN=11) :: latticeType CHARACTER(LEN=11) :: latticeType
CHARACTER(len=4) :: namex
CHARACTER(len=12) :: relcor
INTEGER, ALLOCATABLE :: lNumbers(:), nNumbers(:), speciesLLO(:) INTEGER, ALLOCATABLE :: lNumbers(:), nNumbers(:), speciesLLO(:)
INTEGER, ALLOCATABLE :: loOrderList(:) INTEGER, ALLOCATABLE :: loOrderList(:)
...@@ -149,9 +159,6 @@ SUBROUTINE r_inpXML(& ...@@ -149,9 +159,6 @@ SUBROUTINE r_inpXML(&
INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:) INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:)
INTEGER, ALLOCATABLE :: speciesLOEDeriv(:) INTEGER, ALLOCATABLE :: speciesLOEDeriv(:)
REAL, ALLOCATABLE :: speciesLOeParams(:), speciesLLOReal(:) REAL, ALLOCATABLE :: speciesLOeParams(:), speciesLLOReal(:)
REAL, ALLOCATABLE :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE :: xmlCoreStates(:,:)
LOGICAL, ALLOCATABLE :: xmlPrintCoreStates(:,:)
EXTERNAL prp_xcfft_box EXTERNAL prp_xcfft_box
...@@ -251,9 +258,25 @@ SUBROUTINE r_inpXML(& ...@@ -251,9 +258,25 @@ SUBROUTINE r_inpXML(&
ALLOCATE(noco%soc_opt(atoms%ntype+2),noco%l_relax(atoms%ntype),noco%b_con(2,atoms%ntype)) ALLOCATE(noco%soc_opt(atoms%ntype+2),noco%l_relax(atoms%ntype),noco%b_con(2,atoms%ntype))
ALLOCATE(noco%alph(atoms%ntype),noco%beta(atoms%ntype)) ALLOCATE(noco%alph(atoms%ntype),noco%beta(atoms%ntype))
ALLOCATE (Jij%alph1(atoms%ntype),Jij%l_magn(atoms%ntype),Jij%M(atoms%ntype) ) ALLOCATE (Jij%alph1(atoms%ntype),Jij%l_magn(atoms%ntype),Jij%M(atoms%ntype))
ALLOCATE (Jij%magtype(atoms%ntype),Jij%nmagtype(atoms%ntype) ) ALLOCATE (Jij%magtype(atoms%ntype),Jij%nmagtype(atoms%ntype))
DEALLOCATE(atomTypeSpecies,speciesRepAtomType)
ALLOCATE(atomTypeSpecies(atoms%ntype))
ALLOCATE(speciesRepAtomType(numSpecies))
atomTypeSpecies = -1
speciesRepAtomType = -1
DEALLOCATE(xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs)
ALLOCATE(xmlElectronStates(29,atoms%ntype))
ALLOCATE(xmlPrintCoreStates(29,atoms%ntype))
ALLOCATE(xmlCoreOccs(2,29,atoms%ntype))
xmlElectronStates = noState_const
xmlPrintCoreStates = .FALSE.
xmlCoreOccs = 0.0
WRITE(*,*) 'Note: core states output (from input) into out.xml file has to be implemented!'
! Read in constants ! Read in constants
xPathA = '/fleurInput/constants/constant' xPathA = '/fleurInput/constants/constant'
...@@ -1237,6 +1260,8 @@ SUBROUTINE r_inpXML(& ...@@ -1237,6 +1260,8 @@ SUBROUTINE r_inpXML(&
atoms%lda_u(iType)%u = ldau_u atoms%lda_u(iType)%u = ldau_u
atoms%lda_u(iType)%j = ldau_j atoms%lda_u(iType)%j = ldau_j
atoms%lda_u(iType)%l_amf = l_amf atoms%lda_u(iType)%l_amf = l_amf
atomTypeSpecies(iType) = iSpecies
IF(speciesRepAtomType(iSpecies).EQ.-1) speciesRepAtomType(iSpecies) = iType
END IF END IF
END DO END DO
...@@ -1908,6 +1933,9 @@ SUBROUTINE r_inpXML(& ...@@ -1908,6 +1933,9 @@ SUBROUTINE r_inpXML(&
ALLOCATE(atoms%volmts(atoms%ntype)) ALLOCATE(atoms%volmts(atoms%ntype))
ALLOCATE(atoms%vr0(atoms%ntype)) ! This should actually not be in the atoms type! ALLOCATE(atoms%vr0(atoms%ntype)) ! This should actually not be in the atoms type!
atoms%vr0(:) = 0.0 atoms%vr0(:) = 0.0
na = 0
DEALLOCATE(noel)
ALLOCATE(noel(atoms%ntypd))
DO iType = 1, atoms%ntype DO iType = 1, atoms%ntype
l_vca = .FALSE. l_vca = .FALSE.
INQUIRE (file="vca.in", exist=l_vca) INQUIRE (file="vca.in", exist=l_vca)
...@@ -1944,6 +1972,8 @@ SUBROUTINE r_inpXML(& ...@@ -1944,6 +1972,8 @@ SUBROUTINE r_inpXML(&
atoms%volmts(iType) = (fpi_const/3.0)*atoms%rmt(iType)**3 atoms%volmts(iType) = (fpi_const/3.0)*atoms%rmt(iType)**3
cell%volint = cell%volint - atoms%volmts(iType)*atoms%neq(iType) cell%volint = cell%volint - atoms%volmts(iType)*atoms%neq(iType)
noel(iType) = namat_const(atoms%nz(iType))
END DO END DO
! Read in enpara file iff available ! Read in enpara file iff available
......
...@@ -15,12 +15,13 @@ SUBROUTINE w_inpXML(& ...@@ -15,12 +15,13 @@ SUBROUTINE w_inpXML(&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,& & cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild_opt,name_opt,& & noel,namex,relcor,a1,a2,a3,scale,dtild_opt,name_opt,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,& & xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,& & atomTypeSpecies,speciesRepAtomType,l_outFile,numSpecies,&
& el0,ello0,evac0) & el0,ello0,evac0)
USE m_types USE m_types
USE m_juDFT_init USE m_juDFT_init
USE m_constants USE m_constants
USE m_xmlOutput
IMPLICIT NONE IMPLICIT NONE
...@@ -40,24 +41,25 @@ SUBROUTINE w_inpXML(& ...@@ -40,24 +41,25 @@ SUBROUTINE w_inpXML(&
TYPE(t_banddos),INTENT(IN) :: banddos TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_sliceplot),INTENT(IN):: sliceplot TYPE(t_sliceplot),INTENT(IN):: sliceplot
TYPE(t_xcpot),INTENT(IN) :: xcpot TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_noco),INTENT(IN) :: noco TYPE(t_noco),INTENT(IN) :: noco
INTEGER, INTENT (IN) :: numSpecies
INTEGER, INTENT (IN) :: div(3) INTEGER, INTENT (IN) :: div(3)
INTEGER, INTENT (IN) :: atomTypeSpecies(atoms%ntype) INTEGER, INTENT (IN) :: atomTypeSpecies(atoms%ntype)
INTEGER, INTENT (IN) :: speciesRepAtomType(atoms%nat) INTEGER, INTENT (IN) :: speciesRepAtomType(numSpecies)
LOGICAL, INTENT (IN) :: l_gamma LOGICAL, INTENT (IN) :: l_gamma, l_outFile
REAL, INTENT (IN) :: a1(3),a2(3),a3(3),scale REAL, INTENT (IN) :: a1(3),a2(3),a3(3),scale
REAL, INTENT (IN) :: el0(0:3,atoms%ntype),ello0(atoms%nlod,atoms%ntype),evac0(2) REAL, INTENT (IN) :: el0(0:3,atoms%ntype),ello0(atoms%nlod,atoms%ntype),evac0(2)
REAL, INTENT (IN) :: xmlCoreOccs(2,29,atoms%ntype) REAL, INTENT (IN) :: xmlCoreOccs(2,29,atoms%ntype)
INTEGER, INTENT (IN) :: xmlElectronStates(29,atoms%ntype) INTEGER, INTENT (IN) :: xmlElectronStates(29,atoms%ntype)
LOGICAL, INTENT (IN) :: xmlPrintCoreStates(29,atoms%ntype) LOGICAL, INTENT (IN) :: xmlPrintCoreStates(29,atoms%ntype)
CHARACTER(len=3),INTENT(IN) :: noel(atoms%ntypd) CHARACTER(len=3),INTENT(IN) :: noel(atoms%ntypd)
CHARACTER(len=4),INTENT(IN) :: namex CHARACTER(len=4),INTENT(IN) :: namex
CHARACTER(len=12),INTENT(IN):: relcor CHARACTER(len=12),INTENT(IN):: relcor
REAL,INTENT(IN),OPTIONAL :: dtild_opt REAL,INTENT(IN),OPTIONAL :: dtild_opt
CHARACTER(len=8),INTENT(IN),OPTIONAL:: name_opt(10) CHARACTER(len=8),INTENT(IN),OPTIONAL:: name_opt(10)
INTEGER :: iSpecies INTEGER :: iSpecies, fileNum
CHARACTER(len=8) :: name(10) CHARACTER(len=8) :: name(10)
!+lda+u !+lda+u
...@@ -100,7 +102,7 @@ SUBROUTINE w_inpXML(& ...@@ -100,7 +102,7 @@ SUBROUTINE w_inpXML(&
CHARACTER(len=10) :: loType CHARACTER(len=10) :: loType
CHARACTER(len=10) :: bzIntMode CHARACTER(len=10) :: bzIntMode
CHARACTER(len=200) :: symFilename CHARACTER(len=200) :: symFilename
LOGICAL :: kptGamma, l_relcor LOGICAL :: kptGamma, l_relcor, l_explicit
INTEGER :: iAtomType, startCoreStates, endCoreStates INTEGER :: iAtomType, startCoreStates, endCoreStates
CHARACTER(len=100) :: xPosString, yPosString, zPosString CHARACTER(len=100) :: xPosString, yPosString, zPosString
CHARACTER(len=200) :: coreStatesString, valenceStatesString CHARACTER(len=200) :: coreStatesString, valenceStatesString
...@@ -126,7 +128,8 @@ SUBROUTINE w_inpXML(& ...@@ -126,7 +128,8 @@ SUBROUTINE w_inpXML(&
kptGamma = l_gamma kptGamma = l_gamma
band = .false. band = .false.
nw=1 nw=1
IF (namex.EQ.'hf '.OR.namex.EQ.'exx '.OR.namex.EQ.'hse '.OR.namex.EQ.'vhse') l_hyb = .true. IF (TRIM(ADJUSTL(namex)).EQ.'hf'.OR.TRIM(ADJUSTL(namex)).EQ.'exx'.OR.&
TRIM(ADJUSTL(namex)).EQ.'hse'.OR.TRIM(ADJUSTL(namex)).EQ.'vhse') l_hyb = .true.
l_relcor=.true. l_relcor=.true.
IF(relcor.EQ.'relativi') THEN IF(relcor.EQ.'relativi') THEN
l_relcor=.true. l_relcor=.true.
...@@ -140,23 +143,29 @@ SUBROUTINE w_inpXML(& ...@@ -140,23 +143,29 @@ SUBROUTINE w_inpXML(&
a3Temp(i) = a3(i) a3Temp(i) = a3(i)
END DO END DO
OPEN (5,file='inp.xml',form='formatted',status='unknown') fileNum = -1
REWIND (5) IF(l_outFile) THEN
fileNum = getXMLOutputUnitNumber()
ELSE
fileNum = 5
OPEN (fileNum,file='inp.xml',form='formatted',status='unknown')
REWIND (fileNum)
WRITE (5,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' WRITE (fileNum,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
WRITE (5,'(a)') '<fleurInput fleurInputVersion="0.27">' WRITE (fileNum,'(a)') '<fleurInput fleurInputVersion="0.27">'
END IF
IF(PRESENT(name_opt)) THEN IF(PRESENT(name_opt)) THEN
WRITE (5,'(a)') ' <comment>' WRITE (fileNum,'(a)') ' <comment>'
WRITE (5,'(a6,10a8)') ' ',name WRITE (fileNum,'(a6,10a8)') ' ',name
WRITE (5,'(a)') ' </comment>' WRITE (fileNum,'(a)') ' </comment>'
END IF END IF
WRITE (5,'(a)') ' <calculationSetup>' WRITE (fileNum,'(a)') ' <calculationSetup>'
! <cutoffs Kmax="3.60000" Gmax="11.000000" GmaxXC="9.200000" numbands="0"/> ! <cutoffs Kmax="3.60000" Gmax="11.000000" GmaxXC="9.200000" numbands="0"/>
110 FORMAT(' <cutoffs Kmax="',f0.8,'" Gmax="',f0.8,'" GmaxXC="',f0.8,'" numbands="',i0,'"/>') 110 FORMAT(' <cutoffs Kmax="',f0.8,'" Gmax="',f0.8,'" GmaxXC="',f0.8,'" numbands="',i0,'"/>')
WRITE (5,110) input%rkmax,stars%gmax,xcpot%gmaxxc,input%gw_neigd WRITE (fileNum,110) input%rkmax,stars%gmax,xcpot%gmaxxc,input%gw_neigd
! <scfLoop itmax="9" maxIterBroyd="99" imix="Anderson" alpha="0.05" spinf="2.00"/> ! <scfLoop itmax="9" maxIterBroyd="99" imix="Anderson" alpha="0.05" spinf="2.00"/>
120 FORMAT(' <scfLoop itmax="',i0,'" maxIterBroyd="',i0,'" imix="',a,'" alpha="',f0.8,'" spinf="',f0.8,'"/>') 120 FORMAT(' <scfLoop itmax="',i0,'" maxIterBroyd="',i0,'" imix="',a,'" alpha="',f0.8,'" spinf="',f0.8,'"/>')
...@@ -172,19 +181,19 @@ SUBROUTINE w_inpXML(& ...@@ -172,19 +181,19 @@ SUBROUTINE w_inpXML(&
CASE DEFAULT CASE DEFAULT
mixingScheme='errorUnknownMixing' mixingScheme='errorUnknownMixing'
END SELECT END SELECT
WRITE (5,120) input%itmax,input%maxiter,TRIM(mixingScheme),input%alpha,input%spinf WRITE (fileNum,120) input%itmax,input%maxiter,TRIM(mixingScheme),input%alpha,input%spinf
! <coreElectrons ctail="T" frcor="F" kcrel="0"/> ! <coreElectrons ctail="T" frcor="F" kcrel="0"/>
130 FORMAT(' <coreElectrons ctail="',l1,'" frcor="',l1,'" kcrel="',i0,'"/>') 130 FORMAT(' <coreElectrons ctail="',l1,'" frcor="',l1,'" kcrel="',i0,'"/>')
WRITE (5,130) input%ctail,input%frcor,input%kcrel WRITE (fileNum,130) input%ctail,input%frcor,input%kcrel
! <magnetism jspins="1" l_noco="F" l_J="F" swsp="F" lflip="F"/> ! <magnetism jspins="1" l_noco="F" l_J="F" swsp="F" lflip="F"/>
140 FORMAT(' <magnetism jspins="',i0,'" l_noco="',l1,'" l_J="',l1,'" swsp="',l1,'" lflip="',l1,'"/>') 140 FORMAT(' <magnetism jspins="',i0,'" l_noco="',l1,'" l_J="',l1,'" swsp="',l1,'" lflip="',l1,'"/>')
WRITE (5,140) input%jspins,noco%l_noco,jij%l_J,input%swsp,input%lflip WRITE (fileNum,140) input%jspins,noco%l_noco,jij%l_J,input%swsp,input%lflip
! <soc theta="0.00000" phi="0.00000" l_soc="F" spav="F" off="F" soc66="F"/> ! <soc theta="0.00000" phi="0.00000" l_soc="F" spav="F" off="F" soc66="F"/>
150 FORMAT(' <soc theta="',f0.8,'" phi="',f0.8,'" l_soc="',l1,'" spav="',l1,'" off="',l1,'" soc66="',l1,'"/>') 150 FORMAT(' <soc theta="',f0.8,'" phi="',f0.8,'" l_soc="',l1,'" spav="',l1,'" off="',l1,'" soc66="',l1,'"/>')
WRITE (5,150) noco%theta,noco%phi,noco%l_soc,noco%soc_opt(atoms%ntype+2),noco%soc_opt(atoms%ntype+1),obsolete%eig66(2) WRITE (fileNum,150) noco%theta,noco%phi,noco%l_soc,noco%soc_opt(atoms%ntype+2),noco%soc_opt(atoms%ntype+1),obsolete%eig66(2)
IF (noco%l_noco) THEN IF (noco%l_noco) THEN
160 FORMAT(' <nocoParams l_ss="',l1,'" l_mperp="',l1,'" l_constr="',l1,'" l_disp="',l1,'" sso_opt="',a3,'" mix_b="',f0.8,'" thetaJ="',f0.8,'" nsh="',i0,'"/>') 160 FORMAT(' <nocoParams l_ss="',l1,'" l_mperp="',l1,'" l_constr="',l1,'" l_disp="',l1,'" sso_opt="',a3,'" mix_b="',f0.8,'" thetaJ="',f0.8,'" nsh="',i0,'"/>')
...@@ -193,16 +202,16 @@ SUBROUTINE w_inpXML(& ...@@ -193,16 +202,16 @@ SUBROUTINE w_inpXML(&
IF (oneD%odd%d1) THEN IF (oneD%odd%d1) THEN
170 FORMAT(' <oneDParams d1="',l1,'" MM="',i0,'" vM="',i0,'" m_cyl="',i0,'" chi="',i0,'" rot="',i0,'" invs1="',l1,'" zrfs1="',l1,'"/>') 170 FORMAT(' <oneDParams d1="',l1,'" MM="',i0,'" vM="',i0,'" m_cyl="',i0,'" chi="',i0,'" rot="',i0,'" invs1="',l1,'" zrfs1="',l1,'"/>')
WRITE (5,170) oneD%odd%d1,oneD%odd%M,oneD%odd%mb,oneD%odd%m_cyl,oneD%odd%chi,oneD%odd%rot,oneD%odd%invs,oneD%odd%zrfs WRITE (fileNum,170) oneD%odd%d1,oneD%odd%M,oneD%odd%mb,oneD%odd%m_cyl,oneD%odd%chi,oneD%odd%rot,oneD%odd%invs,oneD%odd%zrfs
END IF END IF
! <expertModes gw="0" pot8="F" eig66="F" lpr="0" isec1="99" secvar="F" /> ! <expertModes gw="0" pot8="F" eig66="F" lpr="0" isec1="99" secvar="F" />
180 FORMAT(' <expertModes gw="',i0,'" pot8="',l1,'" eig66="',l1,'" lpr="',i0,'" isec1="',i0,'" secvar="',l1,'"/>') 180 FORMAT(' <expertModes gw="',i0,'" pot8="',l1,'" eig66="',l1,'" lpr="',i0,'" isec1="',i0,'" secvar="',l1,'"/>')
WRITE (5,180) input%gw,obsolete%pot8,obsolete%eig66(1),obsolete%lpr,input%isec1,input%secvar WRITE (fileNum,180) input%gw,obsolete%pot8,obsolete%eig66(1),obsolete%lpr,input%isec1,input%secvar
! <geometryOptimization l_f="F" xa="2.00000" thetad="330.00000" epsdisp="0.00001" epsforce="0.00001"/> ! <geometryOptimization l_f="F" xa="2.00000" thetad="330.00000" epsdisp="0.00001" epsforce="0.00001"/>
190 FORMAT(' <geometryOptimization l_f="',l1,'" xa="',f0.8,'" thetad="',f0.8,'" epsdisp="',f0.8,'" epsforce="',f0.8,'"/>') 190 FORMAT(' <geometryOptimization l_f="',l1,'" xa="',f0.8,'" thetad="',f0.8,'" epsdisp="',f0.8,'" epsforce="',f0.8,'"/>')
WRITE (5,190) input%l_f,input%xa,input%thetad,input%epsdisp,input%epsforce WRITE (fileNum,190) input%l_f,input%xa,input%thetad,input%epsdisp,input%epsforce
IF(input%gauss.AND.input%tria) THEN IF(input%gauss.AND.input%tria) THEN
STOP 'Error: bz integration modes gauss AND tria selected!' STOP 'Error: bz integration modes gauss AND tria selected!'
...@@ -216,58 +225,59 @@ SUBROUTINE w_inpXML(& ...@@ -216,58 +225,59 @@ SUBROUTINE w_inpXML(&
END IF END IF
! <bzIntegration valenceElectrons="8.00000" mode="hist" fermiSmearingEnergy="0.00100"> ! <bzIntegration valenceElectrons="8.00000" mode="hist" fermiSmearingEnergy="0.00100">
200 FORMAT(' <bzIntegration valenceElectrons="',f0.8,'" mode="',a,'" fermiSmearingEnergy="',f0.8,'">') 200 FORMAT(' <bzIntegration valenceElectrons="',f0.8,'" mode="',a,'" fermiSmearingEnergy="',f0.8,'">')
WRITE (5,200) input%zelec,TRIM(ADJUSTL(bzIntMode)),input%tkb WRITE (fileNum,200) input%zelec,TRIM(ADJUSTL(bzIntMode)),input%tkb
IF(juDFT_was_argument("-explicit")) THEN l_explicit = juDFT_was_argument("-explicit").OR.l_outFile
IF(l_explicit) THEN
sumWeight = 0.0 sumWeight = 0.0
DO i = 1, kpts%nkpt DO i = 1, kpts%nkpt
sumWeight = sumWeight + kpts%weight(i) sumWeight = sumWeight + kpts%weight(i)
END DO END DO
205 FORMAT(' <kPointList posScale="',f0.8,'" weightScale="',f0.8,'" count="',i0,'">') 205 FORMAT(' <kPointList posScale="',f0.8,'" weightScale="',f0.8,'" count="',i0,'">')
WRITE (5,205) kpts%posScale, sumWeight, kpts%nkpt WRITE (fileNum,205) kpts%posScale, sumWeight, kpts%nkpt
DO i = 1, kpts%nkpt DO i = 1, kpts%nkpt
206 FORMAT(' <kPoint weight="',f12.6,'">',f12.6,' ',f12.6,' ',f12.6,'</kPoint>') 206 FORMAT(' <kPoint weight="',f12.6,'">',f12.6,' ',f12.6,' ',f12.6,'</kPoint>')
WRITE (5,206) kpts%weight(i), kpts%bk(1,i), kpts%bk(2,i), kpts%bk(3,i) WRITE (fileNum,206) kpts%weight(i), kpts%bk(1,i), kpts%bk(2,i), kpts%bk(3,i)
END DO END DO
WRITE (5,'(a)')(' </kPointList>') WRITE (fileNum,'(a)')(' </kPointList>')
ELSE IF( (div(1) == 0).OR.(div(2) == 0) ) THEN ELSE IF( (div(1) == 0).OR.(div(2) == 0) ) THEN
! <kPointCount count="100" gamma="F"/> ! <kPointCount count="100" gamma="F"/>
208 FORMAT(' <kPointCount count="',i0,'" gamma="',l1,'"/>') 208 FORMAT(' <kPointCount count="',i0,'" gamma="',l1,'"/>')
WRITE (5,208) kpts%nkpt,kptGamma WRITE (fileNum,208) kpts%nkpt,kptGamma
ELSE ELSE
! <kPointMesh nx="10" ny="10" nz="10" gamma="F"/> ! <kPointMesh nx="10" ny="10" nz="10" gamma="F"/>
210 FORMAT(' <kPointMesh nx="',i0,'" ny="',i0,'" nz="',i0,'" gamma="',l1,'"/>') 210 FORMAT(' <kPointMesh nx="',i0,'" ny="',i0,'" nz="',i0,'" gamma="',l1,'"/>')
WRITE (5,210) div(1),div(2),div(3),kptGamma WRITE (fileNum,210) div(1),div(2),div(3),kptGamma
END IF END IF
WRITE (5,'(a)') ' </bzIntegration>' WRITE (fileNum,'(a)') ' </bzIntegration>'
! <energyParameterLimits ellow="-2.00000" elup="2.00000"/> ! <energyParameterLimits ellow="-2.00000" elup="2.00000"/>
220 FORMAT(' <energyParameterLimits ellow="',f0.8,'" elup="',f0.8,'"/>') 220 FORMAT(' <energyParameterLimits ellow="',f0.8,'" elup="',f0.8,'"/>')
WRITE (5,220) input%ellow,input%elup WRITE (fileNum,220) input%ellow,input%elup
WRITE (5,'(a)') ' </calculationSetup>' WRITE (fileNum,'(a)') ' </calculationSetup>'
WRITE (5,'(a)') ' <cell>' WRITE (fileNum,'(a)') ' <cell>'
IF(juDFT_was_argument("-explicit")) THEN IF(l_explicit) THEN
WRITE(5,'(a)') ' <symmetryOperations>' WRITE(fileNum,'(a)') ' <symmetryOperations>'
DO i = 1, sym%nop DO i = 1, sym%nop
WRITE(5,'(a)') ' <symOp>' WRITE(fileNum,'(a)') ' <symOp>'
224 FORMAT(' <row-1>',i0,' ',i0,' ',i0,' ',f0.15,'</row-1>') 224 FORMAT(' <row-1>',i0,' ',i0,' ',i0,' ',f0.15,'</row-1>')
WRITE(5,224) sym%mrot(1,1,i), sym%mrot(1,2,i), sym%mrot(1,3,i), sym%tau(1,i) WRITE(fileNum,224) sym%mrot(1,1,i), sym%mrot(1,2,i), sym%mrot(1,3,i), sym%tau(1,i)
225 FORMAT(' <row-2>',i0,' ',i0,' ',i0,' ',f0.15,'</row-2>') 225 FORMAT(' <row-2>',i0,' ',i0,' ',i0,' ',f0.15,'</row-2>')
WRITE(5,225) sym%mrot(2,1,i), sym%mrot(2,2,i), sym%mrot(2,3,i), sym%tau(2,i) WRITE(fileNum,225) sym%mrot(2,1,i), sym%mrot(2,2,i), sym%mrot(2,3,i), sym%tau(2,i)
226 FORMAT(' <row-3>',i0,' ',i0,' ',i0,' ',f0.15,'</row-3>') 226 FORMAT(' <row-3>',i0,' ',i0,' ',i0,' ',f0.15,'</row-3>')
WRITE(5,226) sym%mrot(3,1,i), sym%mrot(3,2,i), sym%mrot(3,3,i), sym%tau(3,i) WRITE(fileNum,226) sym%mrot(3,1,i), sym%mrot(3,2,i), sym%mrot(3,3,i), sym%tau(3,i)
WRITE(5,'(a)') ' </symOp>' WRITE(fileNum,'(a)') ' </symOp>'
END DO END DO
WRITE(5,'(a)') ' </symmetryOperations>' WRITE(fileNum,'(a)') ' </symmetryOperations>'
ELSE IF(TRIM(ADJUSTL(sym%namgrp)).EQ.'any') THEN ELSE IF(TRIM(ADJUSTL(sym%namgrp)).EQ.'any') THEN
228 FORMAT(' <symmetryFile filename="',a,'"/>') 228 FORMAT(' <symmetryFile filename="',a,'"/>')
WRITE(5,228) TRIM(ADJUSTL(symFilename)) WRITE(fileNum,228) TRIM(ADJUSTL(symFilename))
ELSE ELSE
! <symmetry spgrp="any" invs="T" zrfs="F"/> ! <symmetry spgrp="any" invs="T" zrfs="F"/>
230 FORMAT(' <symmetry spgrp="',a,'" invs="',l1,'" zrfs="',l1,'"/>') 230 FORMAT(' <symmetry spgrp="',a,'" invs="',l1,'" zrfs="',l1,'"/>')
WRITE (5,230) TRIM(ADJUSTL(sym%namgrp)),sym%invs,sym%zrfs WRITE (fileNum,230) TRIM(ADJUSTL(sym%namgrp)),sym%invs,sym%zrfs
END IF END IF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...@@ -290,102 +300,102 @@ SUBROUTINE w_inpXML(& ...@@ -290,102 +300,102 @@ SUBROUTINE w_inpXML(&
! <xsd:attribute name="dTilda" type="xsd:double" use="required"/> ! <xsd:attribute name="dTilda" type="xsd:double" use="required"/>
! <filmLattice ...> ! <filmLattice ...>
241 FORMAT(' <filmLattice scale="',f0.8,'" latnam="',a,'" dVac="',f0.8,'" dTilda="',f0.8,'">') 241 FORMAT(' <filmLattice scale="',f0.8,'" latnam="',a,'" dVac="',f0.8,'" dTilda="',f0.8,'">')
WRITE(5,241) scale, TRIM(ADJUSTL(cell%latnam)), vacuum%dvac, dtild WRITE(fileNum,241) scale, TRIM(ADJUSTL(cell%latnam)), vacuum%dvac, dtild
IF (cell%latnam.EQ.'any') THEN IF (cell%latnam.EQ.'any') THEN
WRITE (5,'(a)') ' <bravaisMatrix>' WRITE (fileNum,'(a)') ' <bravaisMatrix>'
255 FORMAT(' <row-1>',f0.12,' ',f0.12,' ',f0.12,'</row-1>') 255 FORMAT(' <row-1>',f0.12,' ',f0.12,' ',f0.12,'</row-1>')
WRITE (5,255) a1Temp(1),a1Temp(2),a1Temp(3) WRITE (fileNum,255) a1Temp(1),a1Temp(2),a1Temp(3)
265 FORMAT(' <row-2>',f0.12,' ',f0.12,' ',f0.12,'</row-2>') 265 FORMAT(' <row-2>',f0.12,' ',f0.12,' ',f0.12,'</row-2>')
WRITE (5,265) a2Temp(1),a2Temp(2),a2Temp(3) WRITE (fileNum,265) a2Temp(1),a2Temp(2),a2Temp(3)
275 FORMAT(' <row-3>',f0.12,' ',f0.12,' ',f0.12,'</row-3>') 275 FORMAT(' <row-3>',f0.12,' ',f0.12,' ',f0.12,'</row-3>')
WRITE (5,275) a3Temp(1),a3Temp(2),a3Temp(3) WRITE (fileNum,275) a3Temp(1),a3Temp(2),a3Temp(3)
WRITE (5,'(a)') ' </bravaisMatrix>' WRITE (fileNum,'(a)') ' </bravaisMatrix>'
ELSE ELSE
IF ((cell%latnam.EQ.'squ').OR.(cell%latnam.EQ.'hex').OR.& IF ((cell%latnam.EQ.'squ').OR.(cell%latnam.EQ.'hex').OR.&
& (cell%latnam.EQ.'c-b').OR.(cell%latnam.EQ.'hx3').OR.& & (cell%latnam.EQ.'c-b').OR.(cell%latnam.EQ.'hx3').OR.&
& (cell%latnam.EQ.'c-r').OR.(cell%latnam.EQ.'p-r')) THEN & (cell%latnam.EQ.'c-r').OR.(cell%latnam.EQ.'p-r')) THEN
256 FORMAT(' <a1>',f0.12,'</a1>') 256 FORMAT(' <a1>',f0.12,'</a1>')
WRITE (5,256) a1Temp(1) WRITE (fileNum,256) a1Temp(1)
END IF END IF
IF ((cell%latnam.EQ.'c-r').OR.(cell%latnam.EQ.'p-r')) THEN IF ((cell%latnam.EQ.'c-r').OR.(cell%latnam.EQ.'p-r')) THEN
266 FORMAT(' <a2>',f0.12,'</a2>') 266 FORMAT(' <a2>',f0.12,'</a2>')
WRITE (5,266) a2Temp(2) WRITE (fileNum,266) a2Temp(2)
END IF END IF
IF (cell%latnam.EQ.'obl') THEN IF (cell%latnam.EQ.'obl') THEN
257 FORMAT(' <row-1>',f0.12,' ',f0.12,'</row-1>') 257 FORMAT(' <row-1>',f0.12,' ',f0.12,'</row-1>')
WRITE (5,257) a1Temp(1), a1Temp(2) WRITE (fileNum,257) a1Temp(1), a1Temp(2)
267 FORMAT(' <row-2>',f0.12,' ',f0.12,'</row-2>') 267 FORMAT(' <row-2>',f0.12,' ',f0.12,'</row-2>')
WRITE (5,267) a2Temp(1), a2Temp(2) WRITE (fileNum,267) a2Temp(1), a2Temp(2)
END IF END IF
END IF END IF
WRITE (5,'(a)') ' </filmLattice>' WRITE (fileNum,'(a)') ' </filmLattice>'
ELSE ELSE
242 FORMAT(' <bulkLattice scale="',f0.12,'" latnam="',a,'">') 242 FORMAT(' <bulkLattice scale="',f0.12,'" latnam="',a,'">')
WRITE (5,242) scale, TRIM(ADJUSTL(cell%latnam)) WRITE (fileNum,242) scale, TRIM(ADJUSTL(cell%latnam))
IF (cell%latnam.EQ.'any') THEN IF (cell%latnam.EQ.'any') THEN
! <bravaisMatrix scale="1.0000000"> ! <bravaisMatrix scale="1.0000000">
WRITE (5,'(a)') ' <bravaisMatrix>' WRITE (fileNum,'(a)') ' <bravaisMatrix>'
! <row-1>0.00000 5.13000 5.13000</row-1> ! <row-1>0.00000 5.13000 5.13000</row-1>
250 FORMAT(' <row-1>',f0.12,' ',f0.12,' ',f0.12,'</row-1>') 250 FORMAT(' <row-1>',f0.12,' ',f0.12,' ',f0.12,'</row-1>')
WRITE (5,250) a1Temp(1),a1Temp(2),a1Temp(3) WRITE (fileNum,250) a1Temp(1),a1Temp(2),a1Temp(3)
! <row-2>5.13000 0.00000 5.13000</row-2> ! <row-2>5.13000 0.00000 5.13000</row-2>