Commit 9c2ad1ba authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' of fleur-git:fleur into develop

parents f10ba7a1 e20fa19f
......@@ -51,7 +51,7 @@ init/tetcon.f init/kvecon.f
set(inpgen_F90 io/xsf_io.f90
global/types.F90 global/types_rcmat.F90 global/types_xcpot.F90 global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 io/w_inpXML.f90 init/julia.f90 global/utility.F90
init/compile_descr.F90 io/xmlOutput.F90 init/brzone2.f90)
init/compile_descr.F90 init/kpoints.f90 io/xmlOutput.F90 init/brzone2.f90)
set(fleur_SRC ${fleur_F90} ${fleur_F77})
......
......@@ -282,6 +282,7 @@ MODULE m_types
REAL,ALLOCATABLE ::wtkpt(:)
INTEGER :: nkptf !<k-vectors in full BZ
INTEGER :: nkpt3(3)
REAL :: kPointDensity(3) ! only used if k point set is defined as density
REAL ,ALLOCATABLE :: bkf(:,:)
INTEGER,ALLOCATABLE :: bkp(:)
INTEGER,ALLOCATABLE :: bksym(:)
......@@ -565,6 +566,7 @@ MODULE m_types
LOGICAL:: tria
LOGICAL:: integ
LOGICAL:: pallst
LOGICAL:: l_eels
LOGICAL:: l_wann
LOGICAL:: secvar
LOGICAL:: evonly(2)
......
......@@ -7,10 +7,11 @@
module m_kpoints
contains
subroutine kpoints(oneD,jij,sym,cell,input,noco,banddos,kpts,l_kpts)
use m_types
use m_julia
use m_kptgen_hybrid
use m_od_kptsgen
USE m_juDFT
USE m_types
USE m_julia
USE m_kptgen_hybrid
USE m_od_kptsgen
implicit none
TYPE(t_input),INTENT(IN) :: input
......@@ -23,31 +24,44 @@ contains
TYPE(t_kpts),INTENT(INOUT) :: kpts
LOGICAL,INTENT(IN) :: l_kpts
TYPE(t_sym):: sym_hlp
if (.not.l_kpts) THEN
IF (.NOT.oneD%odd%d1) THEN
IF (jij%l_J) THEN
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL julia(sym_hlp,cell,input,noco,banddos,kpts,.FALSE.,.TRUE.)
ELSE IF(kpts%l_gamma .and. banddos%ndir .eq. 0) THEN
CALL kptgen_hybrid(kpts,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
endif
!Rescale weights and kpoints
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
kpts%bk(:,:) = kpts%bk(:,:) / kpts%posScale
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
TYPE(t_sym) :: sym_hlp
INTEGER :: i
REAL :: recVecLength
IF (kpts%specificationType.EQ.4) THEN
DO i = 1, 3
IF (kpts%kPointDensity(i).LE.0.0) THEN
CALL juDFT_error('Error: Nonpositive kpointDensity provided', calledby = 'kpoints')
END IF
recVecLength = SQRT(cell%bmat(i,1)**2 + cell%bmat(i,2)**2 + cell%bmat(i,3)**2)
kpts%nkpt3(i) = CEILING(kpts%kPointDensity(i) * recVecLength)
END DO
kpts%nkpt = kpts%nkpt3(1) * kpts%nkpt3(2) * kpts%nkpt3(3)
END IF
IF (.NOT.l_kpts) THEN
IF (.NOT.oneD%odd%d1) THEN
IF (jij%l_J) THEN
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL julia(sym_hlp,cell,input,noco,banddos,kpts,.FALSE.,.TRUE.)
ELSE IF(kpts%l_gamma .and. banddos%ndir .eq. 0) THEN
CALL kptgen_hybrid(kpts,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
END IF
!Rescale weights and kpoints
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
kpts%bk(:,:) = kpts%bk(:,:) / kpts%posScale
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
......
!--------------------------------------------------------------------------------
! Copyright (c) 2017 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_postprocessInput
CONTAINS
......
......@@ -8,7 +8,7 @@
CONTAINS
SUBROUTINE lapw_input(
> infh,nline,xl_buffer,bfh,buffer,
< jspins,kcrel,ndvgrd,nkpt,div,
< jspins,kcrel,ndvgrd,nkpt,div,kPointDensity,
< frcor,ctail,chng,tria,kmax,gmax,gmaxxc,
< dvac,dtild,tkb,namex,relcor)
......@@ -19,12 +19,14 @@
INTEGER, INTENT (OUT) :: jspins,kcrel,ndvgrd,nkpt,div(3)
LOGICAL, INTENT (OUT) :: frcor,ctail,tria
REAL, INTENT (OUT) :: kmax,gmax,gmaxxc,tkb,chng
REAL, INTENT (OUT) :: kPointDensity(3)
REAL, INTENT (INOUT) :: dvac,dtild
CHARACTER(len=4), INTENT (OUT) :: namex
CHARACTER(len=12),INTENT (OUT) :: relcor
CHARACTER(len=xl_buffer) :: buffer
INTEGER iflag,div1,div2,div3,nline,nbuffer,ios
REAL den, denX, denY, denZ
LOGICAL h_film,h_comp,h_exco,h_kpt,fatalerror,relxc
CHARACTER(len=4) :: xctyp
......@@ -33,7 +35,7 @@
& gmax, gmaxxc, kmax
NAMELIST /exco/ xctyp, relxc
NAMELIST /film/ dvac, dtild
NAMELIST /kpt/ nkpt, div1, div2, div3, tkb, tria
NAMELIST /kpt/ nkpt,div1,div2,div3,tkb,tria,den,denX,denY,denZ
h_film=.false. ; h_comp=.false.
......@@ -120,11 +122,21 @@
ELSEIF (buffer(1:4)=='&kpt') THEN
IF (h_kpt) CALL err(1)
div1 = 1 ; div2 = 1 ; div3 = 1
div1 = 0 ; div2 = 0 ; div3 = 0
denX = 0.0 ; denY = 0.0 ; denZ = 0.0
den = 0.0
READ (bfh,kpt,err=912, end=912, iostat=ios)
h_kpt=.true.
div(1) = div1 ; div(2) = div2 ; div(3) = div3
div(1) = div1 ; div(2) = div2 ; div(3) = div3
IF (den.NE.0.0) THEN
IF (denX.EQ.0.0) denX = den
IF (denY.EQ.0.0) denY = den
IF (denZ.EQ.0.0) denZ = den
END IF
kPointDensity(1) = denX
kPointDensity(2) = denY
kPointDensity(3) = denZ
!===> end
ELSEIF (buffer(1:4)=='&end') THEN
......
......@@ -28,8 +28,7 @@
USE m_winpXML
USE m_types
USE m_juDFT_init
USE m_julia
USE m_od_kptsgen
USE m_kpoints
USE m_inv3
IMPLICIT NONE
......@@ -52,7 +51,8 @@
INTEGER nel,i,j, nkptOld
REAL kmax,dtild,dvac1,n1,n2,gam,kmax0,dtild0,dvac0,sumWeight
LOGICAL l_test,l_gga,l_exists, l_explicit
REAL recVecLength
LOGICAL l_test,l_gga,l_exists, l_explicit, l_kpts
REAL dx0(atoms%ntype), rmtTemp(atoms%ntype)
REAL a1Temp(3),a2Temp(3),a3Temp(3)
INTEGER div(3)
......@@ -336,7 +336,7 @@
!
CALL lapw_input(&
& infh,nline,xl_buffer,bfh,buffer,&
& input%jspins,input%kcrel,obsolete%ndvgrd,kpts%nkpt,div,&
& input%jspins,input%kcrel,obsolete%ndvgrd,kpts%nkpt,div,kpts%kPointDensity,&
& input%frcor,input%ctail,obsolete%chng,input%tria,input%rkmax,stars%gmax,xcpot%gmaxxc,&
& vacuum%dvac,dtild,input%tkb,namex,relcor)
!
......@@ -363,11 +363,19 @@
kpts%nkpt = MAX(nint((216000/cell%omtil)/sym%nop),1)
ENDIF
ENDIF
IF((div(1).EQ.0).OR.(div(2).EQ.0)) THEN
kpts%specificationType = 1
ELSE
kpts%specificationType = 0
IF((ANY(div(:).NE.0)).AND.(ANY(kpts%kPointDensity(:).NE.0.0))) THEN
CALL juDFT_error('Double specification of k point set', calledby = 'set_inp')
END IF
IF (ANY(div(:).NE.0)) THEN
kpts%specificationType = 2
ELSE IF (ANY(kpts%kPointDensity(:).NE.0.0)) THEN
kpts%specificationType = 4
ELSE
kpts%specificationType = 1
END IF
l_kpts = .FALSE.
IF(TRIM(ADJUSTL(sym%namgrp)).EQ.'any') THEN
sym%symSpecType = 1
......@@ -428,27 +436,8 @@
kpts%l_gamma = l_gamma
kpts%specificationType = 3
sym%symSpecType = 3
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%nkpt3(1),kpts%nkpt3(2),kpts%nkpt3(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
CALL kpoints(oneD,jij,sym,cell,input,noco,banddos,kpts,l_kpts)
!set latnam to any
cell%latnam = 'any'
......@@ -499,6 +488,10 @@
WRITE(*,*) 'More than 999 atom types -> no conventional inp file generated!'
WRITE(*,*) 'Use inp.xml file instead!'
ELSE IF (juDFT_was_argument("-old")) THEN
IF (kpts%specificationType.EQ.4) THEN
CALL juDFT_error('No k point set specification by density supported for old inp file',&
calledby = 'set_inp')
END IF
CALL rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
......
......@@ -116,12 +116,12 @@ SUBROUTINE r_inpXML(&
INTEGER :: speciesEParams(0:3)
INTEGER :: mrotTemp(3,3,48)
REAL :: tauTemp(3,48)
REAL :: bk(3), kPointDensity(3)
REAL :: bk(3)
LOGICAL :: flipSpin, l_eV, invSym, l_qfix, relaxX, relaxY, relaxZ
LOGICAL :: l_vca, coreConfigPresent, l_enpara, l_orbcomp
REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr
REAL :: aTemp, zp, rmtmax, sumWeight, ldau_u(4), ldau_j(4), tempReal
REAL :: weightScale, eParamUp, eParamDown, recVecLength
REAL :: weightScale, eParamUp, eParamDown
LOGICAL :: l_amf(4)
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
INTEGER :: lcutm,lcutwf,select(4)
......@@ -406,13 +406,14 @@ SUBROUTINE r_inpXML(&
END IF
! Option kPointDensity
kpts%kPointDensity(:) = 0.0
xPathA = '/fleurInput/calculationSetup/bzIntegration/kPointDensity'
numberNodes = xmlGetNumberOfNodes(xPathA)
IF (numberNodes.EQ.1) THEN
l_kpts = .FALSE.
kPointDensity(1) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@denX'))
kPointDensity(2) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@denY'))
kPointDensity(3) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@denZ'))
kpts%kPointDensity(1) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@denX'))
kpts%kPointDensity(2) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@denY'))
kpts%kPointDensity(3) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@denZ'))
kpts%l_gamma = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@gamma'))
kpts%specificationType = 4
END IF
......@@ -1072,19 +1073,6 @@ SUBROUTINE r_inpXML(&
END IF
END IF
! Construction of k point mesh if kPointDensity is provided
IF (kpts%specificationType.EQ.4) THEN
DO i = 1, 3
IF (kPointDensity(i).LE.0.0) THEN
CALL juDFT_error('Error: Nonpositive kpointDensity provided', calledby = 'r_inpXML')
END IF
recVecLength = SQRT(cell%bmat(i,1)**2 + cell%bmat(i,2)**2 + cell%bmat(i,3)**2)
kpts%nkpt3(i) = CEILING(kPointDensity(i) * recVecLength)
END DO
kpts%nkpt = kpts%nkpt3(1) * kpts%nkpt3(2) * kpts%nkpt3(3)
kpts%specificationType = 2
END IF
! Construction of missing symmetry information
IF ((symmetryDef.EQ.2).OR.(symmetryDef.EQ.3)) THEN
nop48 = 48
......@@ -1687,6 +1675,7 @@ SUBROUTINE r_inpXML(&
banddos%band = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@band'))
banddos%vacdos = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@vacdos'))
sliceplot%slice = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@slice'))
input%l_eels = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@eels'))
input%l_wann = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@wannier'))
! Read in optional switches for checks
......@@ -1792,6 +1781,19 @@ SUBROUTINE r_inpXML(&
WRITE(*,*) 'band="T" --> Overriding "dos" and "ndir"!'
ENDIF
! Read in optional EELS input parameters
xPathA = '/fleurInput/output/eels'
numberNodes = xmlGetNumberOfNodes(xPathA)
IF ((input%l_eels).AND.(numberNodes.EQ.0)) THEN
CALL juDFT_error("eels is true but eels parameters are not set!", calledby = "r_inpXML")
END IF
IF (numberNodes.EQ.1) THEN
CALL juDFT_error("Reading in eels input not yet implemented!", calledby = "r_inpXML")
END IF
! Read in optional Wannier functions parameters
xPathA = '/fleurInput/output/wannier'
......
......@@ -265,10 +265,13 @@ SUBROUTINE w_inpXML(&
WRITE (fileNum,208) kpts%nkpt,kptGamma
END IF
ELSE !(kpts%specificationType.EQ.2)
ELSE IF (kpts%specificationType.EQ.2) THEN
! <kPointMesh nx="10" ny="10" nz="10" gamma="F"/>
210 FORMAT(' <kPointMesh nx="',i0,'" ny="',i0,'" nz="',i0,'" gamma="',l1,'"/>')
WRITE (fileNum,210) div(1),div(2),div(3),kptGamma
ELSE !(kpts%specificationType.EQ.4)
212 FORMAT(' <kPointDensity denX="',f0.6,'" denY="',f0.6,'" denZ="',f0.6,'" gamma="',l1,'"/>')
WRITE (fileNum,212) kpts%kPointDensity(1),kpts%kPointDensity(2),kpts%kPointDensity(3),kptGamma
END IF
WRITE (fileNum,'(a)') ' </bzIntegration>'
......
This diff is collapsed.
......@@ -284,7 +284,7 @@
! HF/hybrid functionals/EXX
ALLOCATE ( hybrid%nindx(0:atoms%lmaxd,atoms%ntype) )
kpts%specificationType = 0
atoms%numStatesProvided(:) = 0
jij%M(:) = 0.0
......
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