Commit 12c8019f authored by Gregor Michalicek's avatar Gregor Michalicek

Initial commit of xml input file generator.

Besides the conventional input, the new inpgen now also generates an
inp.xml file containing all required data to start a calculation. The
commit also includes additional command line parameters for inpgen:

   "-explicit": This writes k-points, symmetry operations, and the Bravais
                matrix explicitly into the inp.xml file.
   "-noXML":    This switches of the generation of the inp.xml file.
parent 6b2d091c
......@@ -37,12 +37,14 @@ inpgen/atom_sym.f inpgen/generator.f inpgen/read_record.f inpgen/soc_or_ssdw.f i
inpgen/bravais_symm.f inpgen/set_atom_core.f inpgen/spg_gen.f global/triang.f
inpgen/closure.f inpgen/lapw_input.f inpgen/struct_input.f inpgen/write_struct.f
global/hybridmix.f io/calculator.f global/ss_sym.f global/soc_sym.f math/inv3.f io/rw_symfile.f
global/sort.f
global/sort.f init/kptgen_hybrid.f init/od_kptsgen.f init/bravais.f init/divi.f init/brzone.f
init/kptmop.f init/kpttet.f init/bandstr1.F init/ordstar.f init/fulstar.f init/kprep.f
init/tetcon.f init/kvecon.f
)
set(inpgen_F90 io/xsf_io.f90
global/types.F90 global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 io/rw_inp.f90 juDFT/juDFT.F90
juDFT/stop.F90 juDFT/time.F90 juDFT/init.F90)
juDFT/stop.F90 juDFT/time.F90 juDFT/init.F90 io/w_inpXML.f90 init/julia.f90)
set(fleur_SRC ${fleur_F90} ${fleur_F77})
......
......@@ -246,9 +246,10 @@
TYPE t_kpts
!no
INTEGER ::nkpts
INTEGER ::nkpt
INTEGER ::nkptd
INTEGER :: nkpts
INTEGER :: nkpt
INTEGER :: nkptd
LOGICAL :: l_gamma
INTEGER :: nmop(3) !<number of k-points in 3 directions
!(3,nkpts) k-vectors internal units
REAL,ALLOCATABLE ::bk(:,:)
......
......@@ -331,7 +331,7 @@
sym%nop2=1
CALL julia(&
& sym,cell,input,noco,banddos,&
& kpts,.false.)
& kpts,.false.,.FALSE.)
sym%nop=n1
sym%nop2=n2
ELSE IF(l_gamma .and. banddos%ndir .eq. 0) THEN
......@@ -341,7 +341,7 @@
ELSE
CALL julia(&
& sym,cell,input,noco,banddos,&
& kpts,.false.)
& kpts,.false.,.FALSE.)
ENDIF
ELSE
CALL od_kptsgen (kpts%nkpt)
......@@ -381,7 +381,7 @@
noco%l_soc=.false.
CALL julia(&
& sym,cell,input,noco,banddos,&
& kpts,.true.)
& kpts,.true.,.FALSE.)
noco%l_ss=l_tmp(1); noco%l_soc=l_tmp(2)
ENDIF
......
......@@ -3,7 +3,7 @@
CONTAINS
SUBROUTINE julia(&
& sym,cell,input,noco,banddos,&
& kpts,l_q)
& kpts,l_q,l_fillArrays)
!----------------------------------------------------------------------+
! Generate a k-point file with approx. nkpt k-pts or a Monkhorst-Pack |
! set with nmod(i) divisions in i=x,y,z direction. Interface to kptmop |
......@@ -27,7 +27,7 @@
TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_kpts),INTENT(INOUT) :: kpts
LOGICAL, INTENT (IN) :: l_q
LOGICAL, INTENT (IN) :: l_q, l_fillArrays
INTEGER, PARAMETER :: nop48 = 48
INTEGER, PARAMETER :: mface = 51
......@@ -103,6 +103,7 @@
! oblique = p-monoclinic ( 1+2 axis ) 6/1
!
!------------------------------------------------------------
IF(l_q) THEN
trias=input%tria
input%tria=.false.
......@@ -246,6 +247,7 @@
ndiv3 = 6*(mkpt+1)
ALLOCATE (vkxyz(3,mkpt),wghtkp(mkpt) )
ALLOCATE ( voltet(ndiv3),vktet(3,mkpt),ntetra(4,ndiv3) )
vkxyz = 0.0
CALL kpttet(&
& iofile,ibfile,iokpt,&
& kpri,ktest,kmidtet,mkpt,ndiv3,&
......@@ -269,6 +271,7 @@
& kpts%nkpt,cell%bmat,input%film,sym%nop,sym%nop2,&
& kpts%nmop)
ENDIF
!
! Now calculate Monkhorst-Pack k-points:
!
......@@ -282,6 +285,7 @@
IF (.not.input%film) mkpt = mkpt*kpts%nmop(3)
ENDIF
ALLOCATE (vkxyz(3,mkpt),wghtkp(mkpt) )
vkxyz = 0.0
CALL kptmop(&
& iofile,iokpt,kpri,ktest,&
......@@ -292,6 +296,7 @@
& kpts%nkpt,divis,vkxyz,nkstar,wghtkp)
ENDIF
!
idivis(1) = int(divis(1))
idivis(2) = int(divis(2))
......@@ -332,29 +337,47 @@
8050 FORMAT (2(f14.10,1x),f14.10)
!
! write k-points file
! write k-points file or write data into arrays
!
OPEN (41,file='kpts',form='formatted',status='new')
IF (input%film) THEN
WRITE (41,FMT=8110) kpts%nkpt,real(idiv),.false.
DO j=kpts%nkpt,1,-1
WRITE (41,FMT=8040) (vkxyz(i,j),i=1,2),wghtkp(j)
ENDDO
IF (l_fillArrays) THEN
IF (ALLOCATED(kpts%bk)) THEN
DEALLOCATE(kpts%bk)
END IF
IF (ALLOCATED(kpts%weight)) THEN
DEALLOCATE(kpts%weight)
END IF
ALLOCATE(kpts%bk(3,kpts%nkpt),kpts%weight(kpts%nkpt))
DO j = 1, kpts%nkpt
kpts%bk(1,j) = vkxyz(1,j) / real(idiv)
kpts%bk(2,j) = vkxyz(2,j) / real(idiv)
kpts%bk(3,j) = vkxyz(3,j) / real(idiv)
kpts%weight(j) = wghtkp(j)
END DO
ELSE
WRITE (41,FMT=8100) kpts%nkpt,real(idiv)
DO j = 1, kpts%nkpt
WRITE (41,FMT=8040) (vkxyz(i,j),i=1,3),wghtkp(j)
ENDDO
IF (input%tria.AND.random) THEN
WRITE (41,'(i5)') ntet
WRITE (41,'(4(4i6,4x))') ((ntetra(i,j),i=1,4),j=1,ntet)
WRITE (41,'(4f20.13)') (ABS(voltet(j)),j=1,ntet)
ENDIF
OPEN (41,file='kpts',form='formatted',status='new')
IF (input%film) THEN
WRITE (41,FMT=8110) kpts%nkpt,real(idiv),.false.
DO j=kpts%nkpt,1,-1
WRITE (41,FMT=8040) (vkxyz(i,j),i=1,2),wghtkp(j)
END DO
ELSE
WRITE (41,FMT=8100) kpts%nkpt,real(idiv)
DO j = 1, kpts%nkpt
WRITE (41,FMT=8040) (vkxyz(i,j),i=1,3),wghtkp(j)
END DO
IF (input%tria.AND.random) THEN
WRITE (41,'(i5)') ntet
WRITE (41,'(4(4i6,4x))') ((ntetra(i,j),i=1,4),j=1,ntet)
WRITE (41,'(4f20.13)') (ABS(voltet(j)),j=1,ntet)
END IF
END IF
8100 FORMAT (i5,f20.10)
8110 FORMAT (i5,f20.10,3x,l1)
8040 FORMAT (4f10.5)
CLOSE (41)
END IF
8100 FORMAT (i5,f20.10)
8110 FORMAT (i5,f20.10,3x,l1)
8040 FORMAT (4f10.5)
CLOSE (41)
DEALLOCATE ( vkxyz,wghtkp )
IF (input%tria.AND..not.input%film) DEALLOCATE ( voltet,vktet,ntetra )
......
......@@ -20,11 +20,11 @@ PROGRAM inpgen
IMPLICIT NONE
INTEGER natmax,nop48,nline,natin,ngen,i,j
INTEGER nops,no3,no2,na
INTEGER nops,no3,no2,na,numSpecies
INTEGER infh,errfh,bfh,warnfh,symfh,dbgfh,outfh,dispfh
LOGICAL cal_symm,checkinp
LOGICAL cal_symm,checkinp,newSpecies
LOGICAL cartesian,oldfleur,l_hyb ,inistop
REAL aa
REAL aa
REAL a1(3),a2(3),a3(3),scale(3),factor(3)
INTEGER, ALLOCATABLE :: mmrot(:,:,:)
......@@ -32,6 +32,7 @@ PROGRAM inpgen
REAL, ALLOCATABLE :: idlist(:)
INTEGER, ALLOCATABLE :: ntyrep(:) ! these variables are allocated with
INTEGER, ALLOCATABLE :: natype(:),natrep(:),natmap(:) ! or 'nat'
INTEGER, ALLOCATABLE :: speciesRepAtomType(:),atomTypeSpecies(:)
INTEGER, PARAMETER :: xl_buffer=16384 ! maximum length of read record
CHARACTER(len=xl_buffer) :: buffer
......@@ -48,7 +49,7 @@ PROGRAM inpgen
TYPE(t_vacuum) :: vacuum
nop48 = 48
natmax = 5999
natmax = 9999
ngen = 0
infh = 5
errfh = 6 ; warnfh = 6 ; dbgfh = 6 ; outfh = 6
......@@ -146,7 +147,7 @@ PROGRAM inpgen
DO i=1,atoms%nat
atoms%pos(:,i) = matmul( cell%amat , atoms%taual(:,i) )
ENDDO
DEALLOCATE ( ntyrep, natype, natrep, atomid )
!
! --> write a file 'sym.out' with accepted symmetry operations
!
......@@ -157,15 +158,42 @@ PROGRAM inpgen
& 'W',symfh,symfn,nops,cell%bmat,&
& sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor)
ALLOCATE (atomTypeSpecies(atoms%ntype))
ALLOCATE (speciesRepAtomType(atoms%nat))
numSpecies = 0
speciesRepAtomType = -1
atomTypeSpecies = -1
DO i = 1, atoms%nat
newSpecies = .TRUE.
DO j = 1, i-1
IF(atomid(i).EQ.atomid(j)) THEN
newSpecies = .FALSE.
atomTypeSpecies(natype(i)) = atomTypeSpecies(natype(j))
EXIT
END IF
END DO
IF(newSpecies) THEN
numSpecies = numSpecies + 1
speciesRepAtomType(numSpecies) = natype(i)
atomTypeSpecies(natype(i)) = numSpecies
END IF
END DO
!
! --> set defaults for FLEUR inp-file
!
ALLOCATE ( atoms%rmt(atoms%ntype) )
atoms%nlod=9 ! This fixed dimensioning might have to be made more dynamical!
CALL set_inp(&
& infh,nline,xl_buffer,buffer,l_hyb,&
& atoms,sym,cell,title,idlist,&
& input,vacuum,noco,&
& atomTypeSpecies,speciesRepAtomType,&
& a1,a2,a3)
DEALLOCATE (atomTypeSpecies,speciesRepAtomType)
DEALLOCATE ( ntyrep, natype, natrep, atomid )
!
! --> Structure in povray or xsf-format
!
......
......@@ -10,14 +10,22 @@
& infh,nline,xl_buffer,buffer,l_hyb,&
& atoms,sym,cell,title,idlist,&
& input,vacuum,noco,&
& atomTypeSpecies,speciesRepAtomType,&
& a1,a2,a3)
USE m_chkmt
USE m_constants, ONLY : namat_const
USE m_constants
USE m_atominput
USE m_lapwinput
USE m_rwinp
USE m_winpXML
USE m_types
USE m_juDFT_init
USE m_julia
USE m_kptgen_hybrid
USE m_od_kptsgen
USE m_inv3
IMPLICIT NONE
TYPE(t_input),INTENT(INOUT) :: input
TYPE(t_vacuum),INTENT(INOUT) :: vacuum
......@@ -28,14 +36,16 @@
INTEGER, INTENT (IN) :: infh,xl_buffer
INTEGER, INTENT (INOUT) :: nline
INTEGER, INTENT (IN) :: atomTypeSpecies(atoms%ntype)
INTEGER, INTENT (IN) :: speciesRepAtomType(atoms%nat)
CHARACTER(len=xl_buffer) :: buffer
LOGICAL, INTENT (IN) :: l_hyb
REAL, INTENT (IN) :: idlist(:)
REAL, INTENT (INOUT) :: a1(3),a2(3),a3(3)
CHARACTER(len=80), INTENT (IN) :: title
INTEGER nel,i,j
REAL kmax,dtild,dvac1,n1,n2,gam,kmax0,dtild0,dvac0
INTEGER nel,i,j, nkptOld
REAL kmax,dtild,dvac1,n1,n2,gam,kmax0,dtild0,dvac0,sumWeight
LOGICAL l_test,l_gga,l_exists
REAL dx0(atoms%ntype), rmtTemp(atoms%ntype)
INTEGER div(3)
......@@ -45,6 +55,7 @@
CHARACTER(len=8) :: name(10)
CHARACTER(len=3) :: noel(atoms%ntype)
CHARACTER(len=12) :: relcor
CHARACTER(len=3) :: latnamTemp
INTEGER nu,iofile
INTEGER iggachk
INTEGER n ,iostat
......@@ -316,21 +327,85 @@
nu = 8
input%gw = 0
CALL rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,name)
iofile = 6
OPEN (iofile,file='inp',form='formatted',status='old',position='append')
IF (kpts%nkpt == 0) THEN ! set some defaults for the k-points
IF (input%film) THEN
cell%area = cell%omtil / vacuum%dvac
kpts%nkpt = nint((3600/cell%area)/sym%nop2)
ELSE
kpts%nkpt = nint((216000/cell%omtil)/sym%nop)
kpts%nkpt = nint((216000/cell%omtil)/sym%nop)
ENDIF
ENDIF
IF(.NOT.juDFT_was_argument("-noXML")) THEN
nkptOld = kpts%nkpt
latnamTemp = cell%latnam
IF(juDFT_was_argument("-explicit")) THEN
! kpts generation
CALL inv3(cell%amat,cell%bmat,cell%omtil)
cell%bmat=tpi_const*cell%bmat
kpts%nmop(:) = div(:)
kpts%l_gamma = l_gamma
IF (.NOT.oneD%odd%d1) THEN
IF (jij%l_J) THEN
n1=sym%nop
n2=sym%nop2
sym%nop=1
sym%nop2=1
CALL julia(sym,cell,input,noco,banddos,kpts,.FALSE.,.TRUE.)
sym%nop=n1
sym%nop2=n2
ELSE IF(kpts%l_gamma .and. banddos%ndir .eq. 0) THEN
STOP 'Error: No kpoint set generation for gamma=T yet!'
CALL kptgen_hybrid(kpts%nmop(1),kpts%nmop(2),kpts%nmop(3),&
kpts%nkpt,sym%invs,noco%l_soc,sym%nop,&
sym%mrot,sym%tau)
ELSE
CALL julia(sym,cell,input,noco,banddos,kpts,.FALSE.,.TRUE.)
END IF
ELSE
STOP 'Error: No kpoint set generation for 1D systems yet!'
CALL od_kptsgen (kpts%nkpt)
END IF
kpts%nkpts = kpts%nkpt
ALLOCATE(kpts%wtkpt(kpts%nkpt))
sumWeight = 0.0
WRITE(*,*) 'nkpt: ', kpts%nkpt
DO i = 1, kpts%nkpt
sumWeight = sumWeight + kpts%weight(i)
END DO
DO i = 1, kpts%nkpt
kpts%weight(i) = kpts%weight(i) / sumWeight
kpts%wtkpt(i) = kpts%weight(i)
END DO
kpts%nkptd = kpts%nkpt
!set latnam to any
cell%latnam = 'any'
END IF
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,&
& xmlCoreStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,&
& el0,ello0,evac0)
kpts%nkpt = nkptOld
cell%latnam = latnamTemp
END IF !xml output
CALL rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,name)
iofile = 6
OPEN (iofile,file='inp',form='formatted',status='old',position='append')
IF( l_hyb ) THEN
WRITE (iofile,FMT=9999) product(nkpt3),nkpt3,l_gamma
ELSE IF( (div(1) == 0).OR.(div(2) == 0) ) THEN
......
MODULE m_winpXML
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!
!!! XML input file generator
!!!
!!! This subroutine is supposed to write out a file inp.xml
!!! containing all required input data.
!!! GM'16
!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CONTAINS
SUBROUTINE 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_opt,name_opt,&
& xmlCoreStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,&
& el0,ello0,evac0)
USE m_types
USE m_juDFT_init
IMPLICIT NONE
! arguments
TYPE(t_input),INTENT(IN) :: input
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_obsolete),INTENT(IN) :: obsolete
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_hybrid),INTENT(IN) :: hybrid
TYPE(t_Jij),INTENT(IN) :: Jij
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_sliceplot),INTENT(IN):: sliceplot
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_noco),INTENT(IN) :: noco
INTEGER, INTENT (IN) :: div(3)
INTEGER, INTENT (IN) :: atomTypeSpecies(atoms%ntype)
INTEGER, INTENT (IN) :: speciesRepAtomType(atoms%nat)
LOGICAL, INTENT (IN) :: l_gamma
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)
LOGICAL, INTENT (IN) :: xmlCoreStates(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=12),INTENT(IN):: relcor
REAL,INTENT(IN),OPTIONAL :: dtild_opt
CHARACTER(len=8),INTENT(IN),OPTIONAL:: name_opt(10)
INTEGER :: iSpecies
CHARACTER(len=8) :: name(10)
!+lda+u
REAL u,j
INTEGER l
LOGICAL l_amf
CHARACTER(len=3) ch_test
NAMELIST /ldaU/ l,u,j,l_amf
!-lda+u
!+odim
INTEGER MM,vM,m_cyl
LOGICAL invs1,zrfs1
INTEGER chi,rot
LOGICAL d1,band
NAMELIST /odim/ d1,MM,vM,m_cyl,chi,rot,invs1,zrfs1
!-odim
! ..
! .. Local Variables
REAL ::dtild ,scpos, zc, sumWeight
INTEGER ::nw,idsprs, n1, n2
INTEGER ieq,i,k,na,n,ilo
REAL s3,ah,a,hs2,rest
LOGICAL l_hyb,l_sym,ldum
INTEGER :: ierr
! ..
!... Local Arrays
CHARACTER :: helpchar(atoms%ntypd)
CHARACTER(len= 4) :: chntype
CHARACTER(len= 41) :: chform
CHARACTER(len=100) :: line
! added for HF and hybrid functionals
REAL :: aMix,omega
INTEGER :: idum
CHARACTER (len=1) :: check
CHARACTER(len=20) :: tempNumberString, speciesName
CHARACTER(len=150) :: format
CHARACTER(len=20) :: mixingScheme
CHARACTER(len=10) :: loType
CHARACTER(len=10) :: bzIntMode
CHARACTER(len=200) :: symFilename
LOGICAL :: kptGamma, l_relcor
INTEGER :: iAtomType, startCoreStates, endCoreStates
CHARACTER(len=100) :: xPosString, yPosString, zPosString
CHARACTER(len=200) :: coreStatesString
REAL :: tempTaual(3,atoms%nat)
REAL :: a1Temp(3),a2Temp(3),a3Temp(3)
REAL :: amatTemp(3,3), bmatTemp(3,3)
CHARACTER(len=7) :: coreStateList(29) !'(1s1/2)'
CHARACTER(len=4) :: nobleGasConfigList(6) !'[He]'
DATA coreStateList / '(1s1/2)','(2s1/2)','(2p1/2)','(2p3/2)','(3s1/2)',&
& '(3p1/2)','(3p3/2)','(4s1/2)','(3d3/2)','(3d5/2)',&
& '(4p1/2)','(4p3/2)','(5s1/2)','(4d3/2)','(4d5/2)',&
& '(5p1/2)','(5p3/2)','(6s1/2)','(4f5/2)','(4f7/2)',&
& '(5d3/2)','(5d5/2)','(6p1/2)','(6p3/2)','(7s1/2)',&
& '(5f5/2)','(5f7/2)','(6d3/2)','(6d5/2)' /
DATA nobleGasConfigList / '[He]','[Ne]','[Ar]','[Kr]','[Xe]','[Rn]' /
IF (PRESENT(dtild_opt)) dtild=dtild_opt
IF (PRESENT(name_opt)) name=name_opt
symFilename = 'sym.out'
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.
l_relcor=.true.
IF(relcor.EQ.'relativi') THEN
l_relcor=.true.
ELSE
l_relcor=.false.
END IF
DO i = 1, 3
a1Temp(i) = a1(i)
a2Temp(i) = a2(i)
a3Temp(i) = a3(i)
END DO
OPEN (5,file='inp.xml',form='formatted',status='unknown')
REWIND (5)
WRITE (5,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
WRITE (5,'(a)') '<fleurInput fleurInputVersion="0.27">'
IF(PRESENT(name_opt)) THEN
WRITE (5,'(a)') ' <comment>'
WRITE (5,'(a6,10a8)') ' ',name
WRITE (5,'(a)') ' </comment>'
END IF
WRITE (5,'(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
! <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,'"/>')
SELECT CASE (input%imix)
CASE (1)
mixingScheme='straight'
CASE (3)
mixingScheme='Broyden1'
CASE (5)
mixingScheme='Broyden2'
CASE (7)
mixingScheme='Anderson'
CASE DEFAULT
mixingScheme='errorUnknownMixing'
END SELECT
WRITE (5,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
! <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
! <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)
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,'"/>')
STOP 'Output of Noco input not yet implemented!'
END IF
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
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
! <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
IF(input%gauss.AND.input%tria) THEN
STOP 'Error: bz integration modes gauss AND tria selected!'
END IF
bzIntMode = 'hist'
IF(input%gauss) THEN
bzIntMode = 'gauss'
ELSE IF(input%tria) THEN
bzIntMode = 'tria'
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
IF(juDFT_was_argument("-explicit")) THEN
205 FORMAT(' <kPointList posScale="',f0.8,'" count="',i0,'">')
WRITE (5,205) 1.0, kpts%nkpt
DO i = 1, kpts%nkpt
206 FORMAT(' <kPoint weight="',f0.15,'">',f0.15,' ',f0.15,' ',f0.15,'</kPoint>')
WRITE (5,206) kpts%weight(i), kpts%bk(1,i), kpts%bk(2,i), kpts%bk(3,i)
END DO
WRITE (5,'(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
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
END IF
WRITE (5,'(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 (5,'(a)') ' </calculationSetup>'
WRITE (5,'(a)') ' <cell>'
IF(juDFT_was_argument("-explicit")) THEN
WRITE(5,'(a)') ' <symmetryOperations>'
DO i = 1, sym%nop
WRITE(5,'(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)
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)
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>'
END DO
WRITE(5,'(a)') ' </symmetryOperations>'
ELSE IF(TRIM(ADJUSTL(sym%namgrp)).EQ.'any') THEN
228 FORMAT(' <symmetryFile filename="',a,'"/>')
WRITE(5,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
END IF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Note: Different options for the cell definition!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (cell%latnam.EQ.'c-b') THEN
a1Temp(1) = sqrt(2.)* a1Temp(1)
END IF
IF (cell%latnam.EQ.'hex') THEN
s3 = sqrt(3.)
a1Temp(1) = 2*a1Temp(1)/sqrt(