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 @@
CHARACTER(len=3) :: latnamTemp
INTEGER nu,iofile
INTEGER iggachk
INTEGER n ,iostat, errorStatus
INTEGER n ,iostat, errorStatus, numSpecies
REAL scale,scpos ,zc
REAL ello0(atoms%nlod,atoms%ntype),evac0(2)
......@@ -416,13 +416,13 @@
IF(errorStatus.NE.0) THEN
STOP 'Error: Cannot print out FleurInputSchema.xsd'
END IF
numSpecies = atoms%nat
CALL w_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,name,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,&
& atomTypeSpecies,speciesRepAtomType,.FALSE.,numSpecies,&
& enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1))
IF(juDFT_was_argument("-explicit")) THEN
......
......@@ -3,7 +3,9 @@ MODULE m_rinpXML
CONTAINS
SUBROUTINE r_inpXML(&
& 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 m_juDFT
......@@ -63,7 +65,17 @@ SUBROUTINE r_inpXML(&
TYPE(t_dimension),INTENT(OUT) :: dimension
TYPE(t_enpara) ,INTENT(OUT) :: enpara
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)
......@@ -76,7 +88,7 @@ SUBROUTINE r_inpXML(&
!-odim
! ..
! .. Local Variables
REAL ::dtild ,scpos ,zc
REAL :: scpos ,zc
INTEGER ::nw
INTEGER ieq,i,k,na,n,ii
REAL s3,ah,a,hs2,rest
......@@ -122,11 +134,11 @@ SUBROUTINE r_inpXML(&
INTEGER :: speciesEParams(0:3)
INTEGER :: mrotTemp(3,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 :: l_vca, coreConfigPresent, l_enpara
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
LOGICAL :: l_amf
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
......@@ -138,8 +150,6 @@ SUBROUTINE r_inpXML(&
CHARACTER(LEN=255) :: valueString, lString, nString, token
CHARACTER(LEN=255) :: xPathA, xPathB, xPathC, xPathD, xPathE
CHARACTER(LEN=11) :: latticeType
CHARACTER(len=4) :: namex
CHARACTER(len=12) :: relcor
INTEGER, ALLOCATABLE :: lNumbers(:), nNumbers(:), speciesLLO(:)
INTEGER, ALLOCATABLE :: loOrderList(:)
......@@ -149,9 +159,6 @@ SUBROUTINE r_inpXML(&
INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:)
INTEGER, ALLOCATABLE :: speciesLOEDeriv(:)
REAL, ALLOCATABLE :: speciesLOeParams(:), speciesLLOReal(:)
REAL, ALLOCATABLE :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE :: xmlCoreStates(:,:)
LOGICAL, ALLOCATABLE :: xmlPrintCoreStates(:,:)
EXTERNAL prp_xcfft_box
......@@ -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%alph(atoms%ntype),noco%beta(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%alph1(atoms%ntype),Jij%l_magn(atoms%ntype),Jij%M(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
xPathA = '/fleurInput/constants/constant'
......@@ -1237,6 +1260,8 @@ SUBROUTINE r_inpXML(&
atoms%lda_u(iType)%u = ldau_u
atoms%lda_u(iType)%j = ldau_j
atoms%lda_u(iType)%l_amf = l_amf
atomTypeSpecies(iType) = iSpecies
IF(speciesRepAtomType(iSpecies).EQ.-1) speciesRepAtomType(iSpecies) = iType
END IF
END DO
......@@ -1908,6 +1933,9 @@ SUBROUTINE r_inpXML(&
ALLOCATE(atoms%volmts(atoms%ntype))
ALLOCATE(atoms%vr0(atoms%ntype)) ! This should actually not be in the atoms type!
atoms%vr0(:) = 0.0
na = 0
DEALLOCATE(noel)
ALLOCATE(noel(atoms%ntypd))
DO iType = 1, atoms%ntype
l_vca = .FALSE.
INQUIRE (file="vca.in", exist=l_vca)
......@@ -1944,6 +1972,8 @@ SUBROUTINE r_inpXML(&
atoms%volmts(iType) = (fpi_const/3.0)*atoms%rmt(iType)**3
cell%volint = cell%volint - atoms%volmts(iType)*atoms%neq(iType)
noel(iType) = namat_const(atoms%nz(iType))
END DO
! Read in enpara file iff available
......
......@@ -15,12 +15,13 @@ SUBROUTINE w_inpXML(&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild_opt,name_opt,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,&
& atomTypeSpecies,speciesRepAtomType,l_outFile,numSpecies,&
& el0,ello0,evac0)
USE m_types
USE m_juDFT_init
USE m_constants
USE m_xmlOutput
IMPLICIT NONE
......@@ -40,24 +41,25 @@ SUBROUTINE w_inpXML(&
TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_sliceplot),INTENT(IN):: sliceplot
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) :: atomTypeSpecies(atoms%ntype)
INTEGER, INTENT (IN) :: speciesRepAtomType(atoms%nat)
LOGICAL, INTENT (IN) :: l_gamma
INTEGER, INTENT (IN) :: speciesRepAtomType(numSpecies)
LOGICAL, INTENT (IN) :: l_gamma, l_outFile
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) :: xmlCoreOccs(2,29,atoms%ntype)
INTEGER, INTENT (IN) :: xmlElectronStates(29,atoms%ntype)
LOGICAL, INTENT (IN) :: xmlPrintCoreStates(29,atoms%ntype)
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
REAL,INTENT(IN),OPTIONAL :: dtild_opt
CHARACTER(len=8),INTENT(IN),OPTIONAL:: name_opt(10)
INTEGER :: iSpecies
INTEGER :: iSpecies, fileNum
CHARACTER(len=8) :: name(10)
!+lda+u
......@@ -100,7 +102,7 @@ SUBROUTINE w_inpXML(&
CHARACTER(len=10) :: loType
CHARACTER(len=10) :: bzIntMode
CHARACTER(len=200) :: symFilename
LOGICAL :: kptGamma, l_relcor
LOGICAL :: kptGamma, l_relcor, l_explicit
INTEGER :: iAtomType, startCoreStates, endCoreStates
CHARACTER(len=100) :: xPosString, yPosString, zPosString
CHARACTER(len=200) :: coreStatesString, valenceStatesString
......@@ -126,7 +128,8 @@ SUBROUTINE w_inpXML(&
kptGamma = l_gamma
band = .false.
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.
IF(relcor.EQ.'relativi') THEN
l_relcor=.true.
......@@ -140,23 +143,29 @@ SUBROUTINE w_inpXML(&
a3Temp(i) = a3(i)
END DO
OPEN (5,file='inp.xml',form='formatted',status='unknown')
REWIND (5)
fileNum = -1
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 (5,'(a)') '<fleurInput fleurInputVersion="0.27">'
WRITE (fileNum,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
WRITE (fileNum,'(a)') '<fleurInput fleurInputVersion="0.27">'
END IF
IF(PRESENT(name_opt)) THEN
WRITE (5,'(a)') ' <comment>'
WRITE (5,'(a6,10a8)') ' ',name
WRITE (5,'(a)') ' </comment>'
WRITE (fileNum,'(a)') ' <comment>'
WRITE (fileNum,'(a6,10a8)') ' ',name
WRITE (fileNum,'(a)') ' </comment>'
END IF
WRITE (5,'(a)') ' <calculationSetup>'
WRITE (fileNum,'(a)') ' <calculationSetup>'
! <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,'"/>')
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"/>
120 FORMAT(' <scfLoop itmax="',i0,'" maxIterBroyd="',i0,'" imix="',a,'" alpha="',f0.8,'" spinf="',f0.8,'"/>')
......@@ -172,19 +181,19 @@ SUBROUTINE w_inpXML(&
CASE DEFAULT
mixingScheme='errorUnknownMixing'
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"/>
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"/>
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"/>
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
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(&
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,'"/>')
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
! <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,'"/>')
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"/>
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
STOP 'Error: bz integration modes gauss AND tria selected!'
......@@ -216,58 +225,59 @@ SUBROUTINE w_inpXML(&
END IF
! <bzIntegration valenceElectrons="8.00000" mode="hist" fermiSmearingEnergy="0.00100">
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
DO i = 1, kpts%nkpt
sumWeight = sumWeight + kpts%weight(i)
END DO
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
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
WRITE (5,'(a)')(' </kPointList>')
WRITE (fileNum,'(a)')(' </kPointList>')
ELSE IF( (div(1) == 0).OR.(div(2) == 0) ) THEN
! <kPointCount count="100" gamma="F"/>
208 FORMAT(' <kPointCount count="',i0,'" gamma="',l1,'"/>')
WRITE (5,208) kpts%nkpt,kptGamma
WRITE (fileNum,208) kpts%nkpt,kptGamma
ELSE
! <kPointMesh nx="10" ny="10" nz="10" gamma="F"/>
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
WRITE (5,'(a)') ' </bzIntegration>'
WRITE (fileNum,'(a)') ' </bzIntegration>'
! <energyParameterLimits ellow="-2.00000" elup="2.00000"/>
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 (5,'(a)') ' <cell>'
WRITE (fileNum,'(a)') ' </calculationSetup>'
WRITE (fileNum,'(a)') ' <cell>'
IF(juDFT_was_argument("-explicit")) THEN
WRITE(5,'(a)') ' <symmetryOperations>'
IF(l_explicit) THEN
WRITE(fileNum,'(a)') ' <symmetryOperations>'
DO i = 1, sym%nop
WRITE(5,'(a)') ' <symOp>'
WRITE(fileNum,'(a)') ' <symOp>'
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>')
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>')
WRITE(5,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,226) sym%mrot(3,1,i), sym%mrot(3,2,i), sym%mrot(3,3,i), sym%tau(3,i)
WRITE(fileNum,'(a)') ' </symOp>'
END DO
WRITE(5,'(a)') ' </symmetryOperations>'
WRITE(fileNum,'(a)') ' </symmetryOperations>'
ELSE IF(TRIM(ADJUSTL(sym%namgrp)).EQ.'any') THEN
228 FORMAT(' <symmetryFile filename="',a,'"/>')
WRITE(5,228) TRIM(ADJUSTL(symFilename))
WRITE(fileNum,228) TRIM(ADJUSTL(symFilename))
ELSE
! <symmetry spgrp="any" invs="T" zrfs="F"/>
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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
......@@ -290,102 +300,102 @@ SUBROUTINE w_inpXML(&
! <xsd:attribute name="dTilda" type="xsd:double" use="required"/>
! <filmLattice ...>
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
WRITE (5,'(a)') ' <bravaisMatrix>'
WRITE (fileNum,'(a)') ' <bravaisMatrix>'
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>')
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>')
WRITE (5,275) a3Temp(1),a3Temp(2),a3Temp(3)
WRITE (5,'(a)') ' </bravaisMatrix>'
WRITE (fileNum,275) a3Temp(1),a3Temp(2),a3Temp(3)
WRITE (fileNum,'(a)') ' </bravaisMatrix>'
ELSE
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-r').OR.(cell%latnam.EQ.'p-r')) THEN
256 FORMAT(' <a1>',f0.12,'</a1>')
WRITE (5,256) a1Temp(1)
WRITE (fileNum,256) a1Temp(1)
END IF
IF ((cell%latnam.EQ.'c-r').OR.(cell%latnam.EQ.'p-r')) THEN
266 FORMAT(' <a2>',f0.12,'</a2>')
WRITE (5,266) a2Temp(2)
WRITE (fileNum,266) a2Temp(2)
END IF
IF (cell%latnam.EQ.'obl') THEN
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>')
WRITE (5,267) a2Temp(1), a2Temp(2)
WRITE (fileNum,267) a2Temp(1), a2Temp(2)
END IF
END IF
WRITE (5,'(a)') ' </filmLattice>'
WRITE (fileNum,'(a)') ' </filmLattice>'
ELSE
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
! <bravaisMatrix scale="1.0000000">
WRITE (5,'(a)') ' <bravaisMatrix>'
WRITE (fileNum,'(a)') ' <bravaisMatrix>'
! <row-1>0.00000 5.13000 5.13000</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>
260 FORMAT(' <row-2>',f0.12,' ',f0.12,' ',f0.12,'</row-2>')
WRITE (5,260) a2Temp(1),a2Temp(2),a2Temp(3)
WRITE (fileNum,260) a2Temp(1),a2Temp(2),a2Temp(3)
! <row-3>5.13000 5.13000 0.00000</row-3>
270 FORMAT(' <row-3>',f0.12,' ',f0.12,' ',f0.12,'</row-3>')
WRITE (5,270) a3Temp(1),a3Temp(2),a3Temp(3)
WRITE (fileNum,270) a3Temp(1),a3Temp(2),a3Temp(3)
WRITE (5,'(a)') ' </bravaisMatrix>'
WRITE (fileNum,'(a)') ' </bravaisMatrix>'
END IF
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-r').OR.(cell%latnam.EQ.'p-r')) THEN
252 FORMAT(' <a1>',f0.12,'</a1>')
WRITE (5,252) a1Temp(1)
WRITE (fileNum,252) a1Temp(1)
IF ((cell%latnam.EQ.'c-r').OR.(cell%latnam.EQ.'p-r')) THEN
262 FORMAT(' <a2>',f0.12,'</a2>')
WRITE (5,262) a2Temp(2)
WRITE (fileNum,262) a2Temp(2)
END IF
272 FORMAT(' <c>',f0.12,'</c>')
WRITE (5,272) dtild
WRITE (fileNum,272) dtild
END IF
IF (cell%latnam.EQ.'obl') THEN
254 FORMAT(' <row-1>',f0.12,' ',f0.12,'</row-1>')
WRITE (5,254) a1Temp(1), a1Temp(2)
WRITE (fileNum,254) a1Temp(1), a1Temp(2)
264 FORMAT(' <row-2>',f0.12,' ',f0.12,'</row-2>')
WRITE (5,264) a2Temp(1), a2Temp(2)
WRITE (fileNum,264) a2Temp(1), a2Temp(2)
274 FORMAT(' <c>',f0.12,'</c>')
WRITE (5,274) dtild
WRITE (fileNum,274) dtild
END IF
WRITE (5,'(a)') ' </bulkLattice>'
WRITE (fileNum,'(a)') ' </bulkLattice>'
END IF
WRITE (5,'(a)') ' </cell>'
WRITE (fileNum,'(a)') ' </cell>'
! <xcFunctional name="pbe" relativisticCorrections="F">
280 FORMAT(' <xcFunctional name="',a,'" relativisticCorrections="',l1,'"/>')
WRITE (5,280) TRIM(namex), l_relcor
WRITE (fileNum,280) TRIM(namex), l_relcor
! <xcParams igrd="1" lwb="F" ndvgrd="6" idsprs="0" chng="-0.100e-11"/>
! 290 FORMAT(' <xcParams igrd="',i0,'" lwb="',l1,'" ndvgrd="',i0,'" idsprs="',i0,'" chng="',e,'"/>')
! WRITE (5,290) xcpot%igrd,obsolete%lwb,obsolete%ndvgrd,0,obsolete%chng
! WRITE (5,'(a)') ' </xcFunctional>'
! WRITE (fileNum,290) xcpot%igrd,obsolete%lwb,obsolete%ndvgrd,0,obsolete%chng
! WRITE (fileNum,'(a)') ' </xcFunctional>'
WRITE (5,'(a)') ' <atomSpecies>'
DO iSpecies=1, atoms%nat
WRITE (fileNum,'(a)') ' <atomSpecies>'
DO iSpecies=1, numSpecies
iAtomType = speciesRepAtomType(iSpecies)
IF(iAtomType.EQ.-1) THEN
EXIT
......@@ -395,20 +405,20 @@ SUBROUTINE w_inpXML(&
tempNumberString = ''
WRITE(tempNumberString,'(i)') iSpecies
speciesName = TRIM(ADJUSTL(noel(iAtomType))) // '-' // TRIM(ADJUSTL(tempNumberString))
WRITE (5,300) TRIM(ADJUSTL(speciesName)),TRIM(ADJUSTL(noel(iAtomType))),atoms%nz(iAtomType),atoms%ncst(iAtomType),atoms%bmu(iAtomType),atoms%nflip(iAtomType)
WRITE (fileNum,300) TRIM(ADJUSTL(speciesName)),TRIM(ADJUSTL(noel(iAtomType))),atoms%nz(iAtomType),atoms%ncst(iAtomType),atoms%bmu(iAtomType),atoms%nflip(iAtomType)
! <mtSphere radius="2.160000" gridPoints="521" logIncrement="0.022000"/>
310 FORMAT(' <mtSphere radius="',f0.8,'" gridPoints="',i0,'" logIncrement="',f0.8,'"/>')
WRITE (5,310) atoms%rmt(iAtomType),atoms%jri(iAtomType),atoms%dx(iAtomType)
WRITE (fileNum,310) atoms%rmt(iAtomType),atoms%jri(iAtomType),atoms%dx(iAtomType)
! <atomicCutoffs lmax="8" lnonsphr="6"/>
320 FORMAT(' <atomicCutoffs lmax="',i0,'" lnonsphr="',i0,'"/>')
WRITE (5,320) atoms%lmax(iAtomType),atoms%lnonsph(iAtomType)
WRITE (fileNum,320) atoms%lmax(iAtomType),atoms%lnonsph(iAtomType)
IF (ALL((el0(0:3,iAtomType)-INT(el0(0:3,iAtomType))).LE.0.00000001)) THEN
! <energyParameters s="3" p="3" d="3" f="4"/>
321 FORMAT(' <energyParameters s="',i0,'" p="',i0,'" d="',i0,'" f="',i0,'"/>')
WRITE (5,321) INT(el0(0,iAtomType)),INT(el0(1,iAtomType)),INT(el0(2,iAtomType)),INT(el0(3,iAtomType))
WRITE (fileNum,321) INT(el0(0,iAtomType)),INT(el0(1,iAtomType)),INT(el0(2,iAtomType)),INT(el0(3,iAtomType))
END IF
IF(ANY(xmlElectronStates(:,iAtomType).NE.noState_const)) THEN
......@@ -460,20 +470,20 @@ SUBROUTINE w_inpXML(&
valenceStatesString = TRIM(ADJUSTL(valenceStatesString)) // ' ' // coreStateList(i)
END IF
END DO
WRITE (5,'(a)') ' <electronConfig>'
WRITE (fileNum,'(a)') ' <electronConfig>'
! <coreConfig>[He] (2s1/2) (2p1/2) (2p3/2)</coreConfig>
322 FORMAT(' <coreConfig>',a,'</coreConfig>')
WRITE(5,322) TRIM(ADJUSTL(coreStatesString))
WRITE(fileNum,322) TRIM(ADJUSTL(coreStatesString))
323 FORMAT(' <valenceConfig>',a,'</valenceConfig>')
WRITE(5,323) TRIM(ADJUSTL(valenceStatesString))
WRITE(fileNum,323) TRIM(ADJUSTL(valenceStatesString))
DO i = startCoreStates, 29
IF ((xmlElectronStates(i,iAtomType).NE.noState_const).AND.(xmlPrintCoreStates(i,iAtomType))) THEN
! <coreStateOccupation state="(2s1/2)" spinUp="1.0" spinDown="1.0"/>
325 FORMAT(' <stateOccupation state="',a,'" spinUp="',f0.8,'" spinDown="',f0.8,'"/>')
WRITE(5,325) coreStateList(i), xmlCoreOccs(1,i,iAtomType), xmlCoreOccs(2,i,iAtomType)
WRITE(fileNum,325) coreStateList(i), xmlCoreOccs(1,i,iAtomType), xmlCoreOccs(2,i,iAtomType)
END IF
END DO
WRITE (5,'(a)') ' </electronConfig>'
WRITE (fileNum,'(a)') ' </electronConfig>'
END IF
DO ilo = 1, atoms%nlo(iAtomType)
......@@ -487,13 +497,13 @@ SUBROUTINE w_inpXML(&
END IF
END IF
324 FORMAT(' <lo type="',a,'" l="',i0,'" n="',i0,'" eDeriv="0"/>')
WRITE (5,324) TRIM(ADJUSTL(loType)), l, n
WRITE (fileNum,324) TRIM(ADJUSTL(loType)), l, n
END DO
WRITE (5,'(a)') ' </species>'
WRITE (fileNum,'(a)') ' </species>'
END DO
WRITE (5,'(a)') ' </atomSpecies>'
WRITE (5,'(a)') ' <atomGroups>'
WRITE (fileNum,'(a)') ' </atomSpecies>'
WRITE (fileNum,'(a)') ' <atomGroups>'
na = 0
DO iAtomType=1, atoms%ntype
iSpecies = atomTypeSpecies(iAtomType)
......@@ -502,7 +512,7 @@ SUBROUTINE w_inpXML(&
tempNumberString = ''
WRITE(tempNumberString,'(i)') iSpecies
speciesName = TRIM(ADJUSTL(noel(iAtomType))) // '-' // TRIM(ADJUSTL(tempNumberString))
WRITE (5,330) TRIM(ADJUSTL(speciesName))
WRITE (fileNum,330) TRIM(ADJUSTL(speciesName))
DO ieq=1,atoms%neq(iAtomType)
na = na + 1
......@@ -547,7 +557,7 @@ SUBROUTINE w_inpXML(&
WRITE(yPosString,'(f0.12)') tempTaual(2,na)
END IF
WRITE(zPosString,'(f0.12)') tempTaual(3,na)
WRITE (5,340) TRIM(ADJUSTL(xPosString)),TRIM(ADJUSTL(yPosString)),TRIM(ADJUSTL(zPosString))
WRITE (fileNum,340) TRIM(ADJUSTL(xPosString)),TRIM(ADJUSTL(yPosString)),TRIM(ADJUSTL(zPosString))
ELSE
! <relPos> x/myConstant y/myConstant z/myConstant</relPos>
350 FORMAT(' <relPos>',a,' ',a,' ',a,'</relPos>')
......@@ -563,47 +573,49 @@ SUBROUTINE w_inpXML(&
WRITE(yPosString,'(f0.12)') tempTaual(2,na)
WRITE(zPosString,'(f0.12)') tempTaual(3,na)
END IF
WRITE (5,350) TRIM(ADJUSTL(xPosString)),TRIM(ADJUSTL(yPosString)),TRIM(ADJUSTL(zPosString))
WRITE (fileNum,350) TRIM(ADJUSTL(xPosString)),TRIM(ADJUSTL(yPosString)),TRIM(ADJUSTL(zPosString))
END IF
END DO
! <force calculate="F" relaxX="T" relaxY="T" relaxZ="T"/>
360 FORMAT(' <force calculate="',l1,'" relaxXYZ="',3l1,'"/>')
WRITE (5,360) atoms%l_geo(iAtomType),atoms%relax(1,iAtomType),atoms%relax(2,iAtomType),atoms%relax(3,iAtomType)
WRITE (fileNum,360) atoms%l_geo(iAtomType),atoms%relax(1,iAtomType),atoms%relax(2,iAtomType),atoms%relax(3,iAtomType)
WRITE (5,'(a)') ' </atomGroup>'
WRITE (fileNum,'(a)') ' </atomGroup>'
END DO
WRITE (5,'(a)') ' </atomGroups>'
WRITE (fileNum,'(a)') ' </atomGroups>'
368 FORMAT(' <output dos="',l1,'" band="',l1,'" vacdos="',l1,'" slice="',l1,'">')
WRITE (5,368) banddos%dos,band,banddos%vacdos,sliceplot%slice
WRITE (fileNum,368) banddos%dos,band,banddos%vacdos,sliceplot%slice
! <checks vchk="F" cdinf="F" disp="F"/>
370 FORMAT(' <checks vchk="',l1,'" cdinf="',l1,'" disp="',l1,'"/>')
WRITE (5,370) input%vchk,input%cdinf,obsolete%disp
WRITE (fileNum,370) input%vchk,input%cdinf,obsolete%disp
! <densityOfStates ndir="0" minEnergy="-0.50000" maxEnergy="0.50000" sigma="0.01500"/>
380 FORMAT(' <densityOfStates ndir="',i0,'" minEnergy="',f0.8,'" maxEnergy="',f0.8,'" sigma="',f0.8,'"/>')
WRITE (5,380) banddos%ndir,banddos%e2_dos,banddos%e1_dos,banddos%sig_dos
WRITE (fileNum,380) banddos%ndir,banddos%e2_dos,banddos%e1_dos,banddos%sig_dos
! <vacuumDOS layers="0" integ="F" star="F" nstars="0" locx1="0.00" locy1="0.00" locx2="0.00" locy2="0.00" nstm="0" tworkf="0.000000"/>
390 FORMAT(' <vacuumDOS layers="',i0,'" integ="',l1,'" star="',l1,'" nstars="',i0,'" locx1="',f0.8,'" locy1="',f0.8,'" locx2="',f0.8,'" locy2="',f0.8,'" nstm="',i0,'" tworkf="',f0.8,'"/>')
WRITE (5,390) vacuum%layers,input%integ,vacuum%starcoeff,vacuum%nstars,vacuum%locx(1),vacuum%locy(1),vacuum%locx(2),vacuum%locy(2),vacuum%nstm,vacuum%tworkf
WRITE (fileNum,390) vacuum%layers,input%integ,vacuum%starcoeff,vacuum%nstars,vacuum%locx(1),vacuum%locy(1),vacuum%locx(2),vacuum%locy(2),vacuum%nstm,vacuum%tworkf
! <plotting iplot="F" score="F" plplot="F"/>
400 FORMAT(' <plotting iplot="',l1,'" score="',l1,'" plplot="',l1,'"/>')
WRITE (5,400) sliceplot%iplot,input%score,sliceplot%plpot
WRITE (fileNum,400) sliceplot%iplot,input%score,sliceplot%plpot
! <chargeDensitySlicing numkpt="0" minEigenval="0.000000" maxEigenval="0.000000" nnne="0" pallst="F"/>
410 FORMAT(' <chargeDensitySlicing numkpt="',i0,'" minEigenval="',f0.8,'" maxEigenval="',f0.8,'" nnne="',i0,'" pallst="',l1,'"/>')
WRITE (5,410) sliceplot%kk,sliceplot%e1s,sliceplot%e2s,sliceplot%nnne,input%pallst
WRITE (fileNum,410) sliceplot%kk,sliceplot%e1s,sliceplot%e2s,sliceplot%nnne,input%pallst
! <specialOutput form66="F" eonly="F" bmt="F"/>
420 FORMAT(' <specialOutput form66="',l1,'" eonly="',l1,'" bmt="',l1,'"/>')
WRITE (5,420) obsolete%form66,input%eonly,input%l_bmt
WRITE (fileNum,420) obsolete%form66,input%eonly,input%l_bmt
WRITE (5,'(a)') ' </output>'
WRITE (5,'(a)') '</fleurInput>'
CLOSE (5)
WRITE (fileNum,'(a)') ' </output>'
IF(.NOT.l_outFile) THEN
WRITE (fileNum,'(a)') '</fleurInput>'
CLOSE (fileNum)
END IF