Commit 18169e7a authored by Gregor Michalicek's avatar Gregor Michalicek

Implementation of basic Wannier input in inp.xml

...still buggy and very incomplete.

The new test does not pass yet but it might already work.
parent 238fc39a
......@@ -59,7 +59,7 @@ CONTAINS
INTEGER i,i1 ,j,jsp,jsp1,k,ne,nn,nn1,nrec,info
INTEGER idim_c,idim_r,jsp2,nbas,j1
CHARACTER vectors
LOGICAL l_file,l_socvec,l_qsgw,l_open,l_real
LOGICAL l_socvec,l_qsgw,l_open,l_real
INTEGER irec,irecl_qsgw
COMPLEX cdum
! ..
......@@ -316,14 +316,13 @@ else
! i +
! reorder new e.w. in 2x2 spin space : zhelp(,1),zhelp(,2)
!
INQUIRE (file='wann_inp',exist=l_file)
DO i1 = 1,2
jsp = i1
jsp2= i1
IF (input%jspins.EQ.1) jsp = 1
IF (input%jspins.EQ.1 .AND..NOT.(l_file.OR.l_socvec)) jsp2=1
IF (input%jspins.EQ.1 .AND..NOT.(input%l_wann.OR.l_socvec)) jsp2=1
IF (i1.EQ.1) nn = 0
IF (i1.EQ.2) nn = nsz(1)
......
......@@ -51,7 +51,7 @@ CONTAINS
! .. Local Scalars ..
INTEGER i,j,nk,jspin,n ,l
INTEGER n_loc,n_plus,i_plus,n_end,nsz,nmat
LOGICAL l_file,l_socvec !,l_all
LOGICAL l_socvec !,l_all
INTEGER wannierspin
TYPE(t_enpara) :: enpara
TYPE(t_usdus):: usdus
......@@ -90,8 +90,7 @@ CONTAINS
enpara%evac0(2,DIMENSION%jspd),enpara%ello0(atoms%nlod,atoms%ntype,DIMENSION%jspd),&
enpara%el0(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd))
INQUIRE (file='wann_inp',exist=l_file)
IF (l_file.OR.l_socvec) THEN
IF (input%l_wann.OR.l_socvec) THEN
wannierspin = 2
ELSE
wannierspin = input%jspins
......
......@@ -39,23 +39,35 @@ contains
kpts%nkpt = kpts%nkpt3(1) * kpts%nkpt3(2) * kpts%nkpt3(3)
END IF
IF (input%l_wann) THEN
IF (kpts%specificationType.NE.2) THEN
CALL juDFT_error('l_wann only with kPointMesh', calledby = 'kpoints')
END IF
END IF
IF (.NOT.l_kpts) THEN
IF (.NOT.oneD%odd%d1) THEN
IF (jij%l_J) THEN
IF (input%l_wann) THEN
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL kptgen_hybrid(kpts,sym_hlp%invs,noco%l_soc,sym_hlp%nop,sym_hlp%mrot,sym_hlp%tau)
ELSE 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
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 juDFT_error('Error: No kpoint set generation for 1D systems yet!', calledby = 'kpoints')
CALL od_kptsgen (kpts%nkpt)
END IF
END IF
!Rescale weights and kpoints
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
......@@ -63,7 +75,5 @@ contains
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
end subroutine kpoints
end module m_kpoints
......@@ -1877,13 +1877,14 @@ SUBROUTINE r_inpXML(&
ELSE
wann%band_max(2) = wann%band_max(1)
END IF
wann%l_byindex = .TRUE.
END IF
xPathA = '/fleurInput/output/wannier/jobList'
numberNodes = xmlGetNumberOfNodes(xPathA)
IF (numberNodes.EQ.1) THEN
xPathA = 'normalize-space(/fleurInput/output/wannier/jobList/text())[1]'
xPathA = '/fleurInput/output/wannier/jobList/text()'
! Note: At the moment only 255 characters for the text in this node. Maybe this is not enough.
valueString = xmlGetAttributeValue(TRIM(ADJUSTL(xPathA)))
......
......@@ -109,7 +109,7 @@ CONTAINS
! .. Local Scalars ..
INTEGER:: eig_id, archiveType
INTEGER:: n,it,ithf,pc
LOGICAL:: stop80,reap,l_endit,l_opti,l_cont,l_qfix, l_error
LOGICAL:: stop80,reap,l_endit,l_opti,l_cont,l_qfix, l_error, l_wann_inp
REAL :: fermiEnergyTemp, fix
!--- J<
INTEGER :: phn
......@@ -152,11 +152,11 @@ CONTAINS
!+Wannier
input%l_wann = .FALSE.
INQUIRE (file='wann_inp',exist=input%l_wann)
INQUIRE (file='wann_inp',exist=l_wann_inp)
input%l_wann = input%l_wann.OR.l_wann_inp
IF (input%l_wann.AND.(mpi%irank==0).AND.(.NOT.wann%l_bs_comf)) THEN
IF(mpi%isize.NE.1) CALL juDFT_error('No Wannier+MPI at the moment',calledby = 'fleur')
CALL wann_optional(input,atoms,sym,cell,oneD,noco,wann)
CALL wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
END IF
IF (wann%l_gwf) input%itmax = 1
......@@ -559,10 +559,8 @@ CONTAINS
! ----> charge density
!
!+Wannier functions
input%l_wann = .FALSE.
INQUIRE (file='wann_inp',exist=input%l_wann)
IF ((input%l_wann).AND.(.NOT.wann%l_bs_comf)) THEN
CALL wannier(DIMENSION,mpi,input,sym,atoms,stars,vacuum,sphhar,oneD,&
CALL wannier(DIMENSION,mpi,input,kpts,sym,atoms,stars,vacuum,sphhar,oneD,&
wann,noco,cell,enpara,banddos,sliceplot,vTot,results,&
eig_idList,(sym%invs).AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco),kpts%nkpt)
END IF
......
......@@ -137,6 +137,7 @@
ENDIF
ENDIF
input%l_wann = .FALSE.
CALL initWannierDefaults(wann)
input%minDistance = 0.0
......@@ -574,17 +575,8 @@
END IF
! Initializations for Wannier functions (start)
wann%l_ms=.false.
wann%l_sgwf=.false.
wann%l_socgwf=.false.
wann%l_gwf=.false.
wann%l_bs_comf=.false. !.true.
wann%scale_param = 1.0
wann%aux_latt_const = 8.0!5.5!5.45886450 !5.98136400 !8.0725882513951497 !5.4170 !1.0
wann%param_file='qpts'
wann%l_dim=.false.
IF (mpi%irank.EQ.0) THEN
#ifdef CPP_WANN
#ifdef CPP_WANN
INQUIRE(FILE='plotbscomf',EXIST=wann%l_bs_comf)
WRITE(*,*)'l_bs_comf=',wann%l_bs_comf
WRITE(*,*) 'Logical variables for wannier functions to be read in!!'
......
......@@ -17,8 +17,8 @@ endif()
#Add Wannier tests if fleur is compiled with Wannier support
if (${FLEUR_USE_WANN})
set(Testdirs ${Testdirs} Cwann)
set(ParTestdirs ${ParTestdirs} Cwann)
set(Testdirs ${Testdirs} Cwann CwannXML)
set(ParTestdirs ${ParTestdirs} Cwann CwannXML)
endif()
#The serial tests
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
$test_name="C: simple test for the Wannier code with inp.xml";
$test_code="Fleur";
$test_stages=3;
$test_desc=<<EOF
Simple test of Fleur with three steps:
1.Generate a starting density and run 1 iteration
2.Generate projections for Wannier functions
3.Generate input for Wannier90 code
Uses: Wannier
EOF
;
#juDFT Testscript
jt::copyfile("files/inp.xml",$workdir);
jt::testrun($executable,$workdir);
#now test output
$result=jt::test_fileexists("$workdir/out");
jt::stageresult($workdir,$result,"1");
#juDFT Testscript
#The following arguments are passed: executable, working directory
jt::copyfile("files/projgen_inp",$workdir);
jt::copyfile("files/wann_inp-1.xml","$workdir/inp.xml");
jt::testrun($executable,$workdir);
#now test output
$result=jt::test_grepexists("$workdir/proj"," 8 8");
$result+=jt::test_grepexists("$workdir/proj"," 1 -3 1 0");
$result+=jt::test_grepexists("$workdir/proj"," 2 -3 4 0");
$result+=jt::test_grepexists("$workdir/proj"," 0.000000 0.000000 0.000000 0.000000 1.00");
jt::stageresult($workdir,$result,"2");
#juDFT Testscript
#The following arguments are passed: executable, working directory
jt::copyfile("files/wann_inp-2.xml","$workdir/inp.xml");
jt::testrun($executable,$workdir);
#now test output
$result=jt::test_fileexists("$workdir/WF1.amn");
$result+=jt::test_fileexists("$workdir/WF1.mmn");
$result+=jt::test_fileexists("$workdir/WF1.eig");
$result+=jt::test_fileexists("$workdir/WF1.win");
$result+=jt::test_fileexists("$workdir/WF1.wout");
$result+=jt::test_grepexists("$workdir/WF1.eig"," 1 1 -9.96004957");
$result+=jt::test_grepexists("$workdir/WF1.eig"," 8 1 24.36259922");
$result+=jt::test_grepexists("$workdir/WF1.eig"," 8 8 27.60170066");
$result+=jt::test_grepexists("$workdir/WF1.eig"," 5 6 16.51363508");
#Note:WF1.amn and WF1.mmn seem to differ strongly from the reference result.
#But this does not seem to be relevant as invoking wannier90.x WF1 yields high precision results.
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 8 8 8");
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 1 1 1 -0.21709150");
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 8 2 1 0.000000000000 0.29174760");
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 2 6 2 0.000000000000 -0.01714566");
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 3 5 2 -0.18082932");
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 8 8 8 0.000000000000 -0.11210751");
#$result+=jt::test_grepexists("$workdir/WF1.amn"," 6 7 8 -0.33695808");
#$result+=jt::test_grepexists("$workdir/WF1.mmn"," 8 8 8");
#$result+=jt::test_grepexists("$workdir/WF1.mmn"," 1 2 0 0 0");
#$result+=jt::test_grepexists("$workdir/WF1.mmn"," -0.757938912603");
#$result+=jt::test_grepexists("$workdir/WF1.mmn"," 0.257799685127");
#$result+=jt::test_grepexists("$workdir/WF1.mmn"," 8 7 0 0 1");
jt::stageresult($workdir,$result,"3");
......@@ -73,7 +73,6 @@ wannier/wann_projmethod.F
wannier/wann_radovlp_integrals.F
wannier/wann_rad_twf.f
wannier/wann_readcenters.f
wannier/wann_read_inp.f
wannier/wann_read_umatrix.F
wannier/wann_real.F
wannier/wann_rmat.f
......@@ -99,4 +98,5 @@ wannier/bs_comfort.F
)
set(fleur_F90 ${fleur_F90}
wannier/init_wannier_defaults.f90
wannier/wann_read_inp.f90
)
......@@ -143,11 +143,10 @@ SUBROUTINE initWannierDefaults(wann)
wann%fn_eig = ''
wann%param_file = ''
! REAL,ALLOCATABLE :: param_vec(:,:)
! REAL,ALLOCATABLE :: param_alpha(:,:)
! CHARACTER(LEN=20), ALLOCATABLE :: jobList(:)
wann%scale_param = 1.0
wann%aux_latt_const = 8.0!5.5!5.45886450 !5.98136400 !8.0725882513951497 !5.4170 !1.0
wann%param_file='qpts'
wann%l_dim=.false.
END SUBROUTINE initWannierDefaults
......
......@@ -19,8 +19,8 @@ c*******************************************c
USE m_juDFT
CONTAINS
SUBROUTINE wann_uHu(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos,
> oneD,noco,cell,vTot,wann,
> DIMENSION,stars,vacuum,atoms,sphhar,input,kpts,sym,mpi,
> banddos,oneD,noco,cell,vTot,wann,
> eig_idList,l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype,
> omtil,nlo,llo,lapw_l,invtab,mrot,ngopr,neq,lmax,
......@@ -76,6 +76,7 @@ c*******************************************c
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_banddos),INTENT(IN) :: banddos
......@@ -287,9 +288,7 @@ c ..initializations..
c-----read the input file to determine what to do
call wann_read_inp(
> l_p0,
< wann)
call wann_read_inp(input,l_p0,wann)
if(wann%l_byenergy.and.wann%l_byindex) CALL juDFT_error
+ ("byenergy.and.byindex",calledby ="wannier")
......@@ -442,7 +441,7 @@ c find symmetry-related elements in mmkb
c********************************************************
allocate(maptopair(3,fullnkpts,nntot))
allocate(pair_to_do(fullnkpts,nntot))
call wann_mmnk_symm(
call wann_mmnk_symm(input,kpts,
> fullnkpts,nntot,bpt,gb,wann%l_bzsym,
> irreduc,mapkoper,l_p0,film,nop,invtab,mrot,odi%d1,
> tau,
......@@ -452,7 +451,7 @@ c********************************************************
if(l_gwf)then
allocate(maptopair_q(3,fullnqpts,nntot_q))
allocate(pair_to_do_q(fullnqpts,nntot_q))
call wann_mmnk_symm(
call wann_mmnk_symm(input,kpts,
> fullnqpts,nntot_q,bpt_q,gb_q,wann%l_bzsym,
> irreduc_q,mapqoper,l_p0,.false.,1,invtab(1),mrot(:,:,1),
> .false.,tau,
......
......@@ -19,8 +19,8 @@ c*******************************************c
USE m_juDFT
CONTAINS
SUBROUTINE wann_uHu_dmi(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos,
> oneD,noco,cell,vTot,wann,
> DIMENSION,stars,vacuum,atoms,sphhar,input,kpts,sym,mpi,
> banddos,oneD,noco,cell,vTot,wann,
> eig_idList,l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype,
> omtil,nlo,llo,lapw_l,invtab,mrot,ngopr,neq,lmax,
......@@ -77,6 +77,7 @@ c*******************************************c
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_banddos),INTENT(IN) :: banddos
......@@ -287,9 +288,7 @@ c ..initializations..
c-----read the input file to determine what to do
call wann_read_inp(
> l_p0,
< wann)
call wann_read_inp(input,l_p0,wann)
if(wann%l_byenergy.and.wann%l_byindex) CALL juDFT_error
+ ("byenergy.and.byindex",calledby ="wannier")
......@@ -442,7 +441,7 @@ c find symmetry-related elements in mmkb
c********************************************************
allocate(maptopair(3,fullnkpts,nntot))
allocate(pair_to_do(fullnkpts,nntot))
call wann_mmnk_symm(
call wann_mmnk_symm(input,kpts,
> fullnkpts,nntot,bpt,gb,wann%l_bzsym,
> irreduc,mapkoper,l_p0,film,nop,invtab,mrot,odi%d1,
> tau,
......@@ -452,7 +451,7 @@ c********************************************************
if(l_gwf)then
allocate(maptopair_q(3,fullnqpts,nntot_q))
allocate(pair_to_do_q(fullnqpts,nntot_q))
call wann_mmnk_symm(
call wann_mmnk_symm(input,kpts,
> fullnqpts,nntot_q,bpt_q,gb_q,wann%l_bzsym,
> irreduc_q,mapqoper,l_p0,.false.,1,invtab(1),mrot(:,:,1),
> .false.,tau,
......
......@@ -6,8 +6,9 @@
module m_wann_get_kpts
use m_juDFT
USE m_types
contains
subroutine wann_get_kpts(
subroutine wann_get_kpts(input,kpts,
> l_bzsym,film,l_onedimens,l_readkpts,
< nkpts,kpoints)
c********************************************************
......@@ -16,6 +17,8 @@ c
c Frank Freimuth
c********************************************************
implicit none
TYPE(t_input), INTENT(IN) :: input
TYPE(t_kpts), INTENT(IN) :: kpts
logical,intent(in) :: l_bzsym,film
logical,intent(in) :: l_onedimens,l_readkpts
integer,intent(out) :: nkpts
......@@ -41,28 +44,39 @@ c********************************************************
do iter=1,nkpts
read(987,*)kpoints(:,iter)
enddo
endif
endif
close(987)
else
inquire(file='kpts',exist=l_file)
IF(.NOT.l_file) CALL juDFT_error("where is kpts?",calledby
+ ="wann_get_kpts")
open(987,file='kpts',status='old',form='formatted')
read(987,*)nkpts,scale
write(6,*)"wann_get_kpts: nkpts=",nkpts
if(l_readkpts)then
IF(SIZE(kpoints,1)/=3) CALL juDFT_error("wann_get_kpts: 1"
+ ,calledby ="wann_get_kpts")
IF(SIZE(kpoints,2)/=nkpts)CALL juDFT_error("wann_get_kpts:2"
+ ,calledby ="wann_get_kpts")
do iter=1,nkpts
read(987,*)kpoints(:,iter)
enddo
endif
IF(.NOT.input%l_inpXML) THEN
inquire(file='kpts',exist=l_file)
IF(.NOT.l_file) CALL juDFT_error("where is kpts?",calledby
+ ="wann_get_kpts")
open(987,file='kpts',status='old',form='formatted')
read(987,*)nkpts,scale
write(6,*)"wann_get_kpts: nkpts=",nkpts
if(l_readkpts)then
IF(SIZE(kpoints,1)/=3)
+ CALL juDFT_error("wann_get_kpts: 1",
+ calledby ="wann_get_kpts")
IF(SIZE(kpoints,2)/=nkpts)
+ CALL juDFT_error("wann_get_kpts:2",
+ calledby ="wann_get_kpts")
do iter=1,nkpts
read(987,*)kpoints(:,iter)
enddo
endif
close(987)
ELSE
nkpts = kpts%nkpt
if(l_readkpts)then
do iter=1,nkpts
kpoints(:,iter) = kpts%bk(:,iter)
enddo
endif
END IF
endif
close(987)
if(l_readkpts)then
if(l_readkpts.AND..NOT.input%l_inpXML)then
kpoints=kpoints/scale
if(film.and..not.l_onedimens)then
kpoints(3,:)=0.0
......
......@@ -6,6 +6,7 @@
module m_wann_mmnk_symm
use m_juDFT
USE m_types
private
public:: wann_mmnk_symm
contains
......@@ -15,13 +16,16 @@ c calculated; map symmetry-related k-point-pairs to this
c minimal set.
c Frank Freimuth
c******************************************************************
subroutine wann_mmnk_symm(
subroutine wann_mmnk_symm(input,kpts,
> fullnkpts,nntot,bpt,gb,l_bzsym,
> irreduc,mapkoper,l_p0,film,nop,
> invtab,mrot,l_onedimens,tau,
< pair_to_do,maptopair,kdiff,l_q,param_file)
implicit none
TYPE(t_input),INTENT(IN) :: input
TYPE(t_kpts),INTENT(IN) :: kpts
integer,intent(in) :: nop
integer,intent(in) :: mrot(3,3,nop)
integer,intent(in) :: invtab(nop)
......@@ -240,16 +244,28 @@ c*****************************************************************
close(412)
else
IF(.not.l_q)THEN
open(412,file='kpts',form='formatted')
read(412,*)fullnkpts_tmp,scale
IF(.NOT.input%l_inpXML) THEN
open(412,file='kpts',form='formatted')
read(412,*)fullnkpts_tmp,scale
do k=1,fullnkpts
read(412,*)kpoints(:,k)
enddo
kpoints(:,:)=kpoints/scale
ELSE
fullnkpts_tmp = kpts%nkpt
do k=1,fullnkpts
kpoints(:,k) = kpts%bk(:,k)
enddo
END IF
ELSE
open(412,file=param_file,form='formatted')
read(412,*)fullnkpts_tmp,scale
do k=1,fullnkpts
read(412,*)kpoints(:,k)
enddo
kpoints(:,:)=kpoints/scale
ENDIF
do k=1,fullnkpts
read(412,*)kpoints(:,k)
enddo
kpoints(:,:)=kpoints/scale
if (film.and..not.l_onedimens) kpoints(3,:)=0.0
close(412)
endif
......
......@@ -7,7 +7,7 @@
module m_wann_optional
use m_juDFT
contains
subroutine wann_optional(input,atoms,sym,cell,oneD,noco,wann)
subroutine wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
c**************************************************
c Make preparations for the calculation of
c Wannier functions.
......@@ -27,6 +27,7 @@ c**************************************************
implicit none
TYPE(t_input), INTENT(IN) :: input
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_cell), INTENT(IN) :: cell
......@@ -40,8 +41,7 @@ c**************************************************
l_nocosoc=noco%l_noco.or.noco%l_soc
c-----read the input file to determine what to do
call wann_read_inp(
> .true.,wann)
call wann_read_inp(input,.true.,wann)
c-----generate projection-definition-file
if(wann%l_projgen) then
......@@ -79,7 +79,7 @@ c-----find Wannier-irreducible part of BZ
c-----generate WF1.win and bkpts
if(wann%l_prepwan90)then
call wann_wan90prep(
call wann_wan90prep(input,kpts,
> input%jspins,cell%amat,cell%bmat,
> atoms%nat,atoms%taual,atoms%zatom,atoms%ntype,
> atoms%ntype,atoms%neq,wann%l_bzsym,input%film,
......
......@@ -7,7 +7,7 @@
module m_wann_postproc
contains
subroutine wann_postproc(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,
> DIMENSION,stars,vacuum,atoms,sphhar,input,kpts,sym,mpi,
> lapw,oneD,noco,cell,vTot,eig_id,l_real,
> mpi_comm,wann,l_p0,film,jspins,n2d,
> natd,pos,amat,bmat,ntype,neq,zatom,
......@@ -72,6 +72,7 @@ c***********************************************
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_lapw),INTENT(IN) :: lapw
......@@ -135,7 +136,7 @@ c***********************************************
c real,intent(inout) :: fermi_weights(:,:,:) !(neigd,nkptd,jspd)
character(len=12) :: fending
integer :: i,kpts,ikpt,nkqpts,iqpt
integer :: i,nkpts,ikpt,nkqpts,iqpt
real(4) :: delta3,time_lapw_expand,delta2,time_lapw_plot
logical :: l_need_fft,l_file
integer :: hopmin_z,hopmax_z
......@@ -156,16 +157,16 @@ c real,intent(inout) :: fermi_weights(:,:,:) !(neigd,nkptd,jspd)
c***************************************************
c Read in the kpoints from w90kpts or kpts.
c***************************************************
call wann_get_kpts(
call wann_get_kpts(input,kpts,
> wann%l_bzsym,film,odi%d1,.false.,
< kpts,kpoints)
if (kpts /= fullnkpts)
< nkpts,kpoints)
if (nkpts /= fullnkpts)
+ CALL juDFT_error ('mismatch in number of kpoints',
+ calledby="wann_postproc")
call wann_get_kpts(
call wann_get_kpts(input,kpts,
> wann%l_bzsym,film,odi%d1,.true.,
< kpts,kpoints)
< nkpts,kpoints)
c*********************************************************
c Find out the structure of k-point set.
c*********************************************************
......
......@@ -292,9 +292,7 @@ c-----initializations
nkpts = nkpt
c-----read the input file to determine what to do
call wann_read_inp(
> l_p0,
< wann)
call wann_read_inp(input,l_p0,wann)
IF(wann%l_byenergy.AND.wann%l_byindex) CALL juDFT_error
+ ("byenergy.and.byindex",calledby ="wann_updown")
......
......@@ -6,13 +6,14 @@
MODULE m_wann_wan90prep
use m_juDFT
USE m_types
c**********************************************************
c prepares WF//spin12(jspin)//.win for
c input to wannier90 and creates bkpts file
c FF, September 2006
c**********************************************************
CONTAINS
SUBROUTINE wann_wan90prep(
SUBROUTINE wann_wan90prep(input,kpts,
> jspins,amat,bmat,natd,taual_inp,zatom,ntype,
> ntypd,neq,l_bzsym,film,l_onedimens,l_ms,l_sgwf,l_socgwf,
> aux_latt_const,param_file,l_dim,wan90version)
......@@ -29,6 +30,9 @@ c**********************************************************
IMPLICIT NONE
TYPE(t_input), INTENT(IN) :: input
TYPE(t_kpts), INTENT(IN) :: kpts
integer,intent(in) :: jspins
integer,intent(in) :: ntype
integer,intent(in) :: ntypd
......@@ -101,11 +105,11 @@ c**********************************************************
c**********************************************************
c Read in kpoints from kpts/w90kpts file.
c**********************************************************
call wann_get_kpts(
call wann_get_kpts(input,kpts,
> l_bzsym,film,l_onedimens,.false.,
< nkpts,kpoints)
allocate(kpoints(3,nkpts))
call wann_get_kpts(
call wann_get_kpts(input,kpts,
> l_bzsym,film,l_onedimens,.true.,
< nkpts,kpoints)
......
......@@ -8,7 +8,7 @@
use m_juDFT
CONTAINS
SUBROUTINE wannier(
> DIMENSION,mpi,input,sym,atoms,stars,vacuum,sphhar,oneD,
> DIMENSION,mpi,input,kpts,sym,atoms,stars,vacuum,sphhar,oneD,
> wann,noco,cell,enpara,banddos,sliceplot,vTot,results,
> eig_idList,l_real,nkpt)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
......@@ -118,6 +118,7 @@ ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
TYPE(t_dimension), INTENT(IN) :: DIMENSION
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_input), INTENT(IN) :: input
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_stars), INTENT(IN) :: stars
......@@ -374,9 +375,8 @@ c-----initializations
c-----read the input file to determine what to do
wann%atomlist_num=atoms%nat
wann%oc_num_orbs=atoms%nat
call wann_read_inp(
> l_p0,
< wann)
CALL wann_read_inp(input,l_p0,wann)
c-----input file for orbital decomposition
......@@ -442,8 +442,8 @@ cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if(wann%l_matrixuHu)then
wannTemp = wann
call wann_uHu(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos,
> oneD,noco,cell,vTot,wannTemp,eig_idList,
> DIMENSION,stars,vacuum,atoms,sphhar,input,kpts,sym,mpi,
> banddos,oneD,noco,cell,vTot,wannTemp,eig_idList,
> l_real,atoms%l_dulo,noco%l_noco,noco%l_ss,atoms%lmaxd,
> atoms%ntype,DIMENSION%neigd,atoms%nat,sym%nop,DIMENSION%nvd,
> DIMENSION%jspd,DIMENSION%nbasfcn,atoms%llod,atoms%nlod,
......@@ -485,8 +485,8 @@ cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if(wann%l_matrixuHu_dmi)then