Commit 541c2e25 authored by Gregor Michalicek's avatar Gregor Michalicek

Call kpoints in set_inp and put more code into that subroutine.

parent ed1d3b11
......@@ -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})
......
......@@ -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
......
......@@ -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
......@@ -53,7 +52,7 @@
INTEGER nel,i,j, nkptOld
REAL kmax,dtild,dvac1,n1,n2,gam,kmax0,dtild0,dvac0,sumWeight
REAL recVecLength
LOGICAL l_test,l_gga,l_exists, l_explicit
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)
......@@ -365,6 +364,7 @@
ENDIF
ENDIF
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
......@@ -375,17 +375,7 @@
ELSE
kpts%specificationType = 1
END IF
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 = 'set_inp')
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)
div(:) = kpts%nkpt3(:)
END IF
l_kpts = .FALSE.
IF(TRIM(ADJUSTL(sym%namgrp)).EQ.'any') THEN
sym%symSpecType = 1
......@@ -446,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'
......@@ -517,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,&
......
......@@ -121,7 +121,7 @@ SUBROUTINE r_inpXML(&
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)
......@@ -1073,18 +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 (kpts%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(kpts%kPointDensity(i) * recVecLength)
END DO
kpts%nkpt = kpts%nkpt3(1) * kpts%nkpt3(2) * kpts%nkpt3(3)
END IF
! Construction of missing symmetry information
IF ((symmetryDef.EQ.2).OR.(symmetryDef.EQ.3)) THEN
nop48 = 48
......
......@@ -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