Commit 2a7ca66d authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' of iffgit.fz-juelich.de:fleur/fleur into develop

parents 22cf05b1 cc081f38
......@@ -318,7 +318,7 @@ CONTAINS
DO i=1,SIZE(list)
CALL io_read_real3(d%evsetid,(/1,1,list(i),nk,jspin/),&
& (/2,nmat,1,1,1/),z1)
z(:,i) = CMPLX( z1(1,:,i) ,z1(2,:,i) )
z(:,i) = CMPLX( z1(1,:,1) ,z1(2,:,1) )
ENDDO
END IF
END SUBROUTINE priv_r_vecc
......
......@@ -36,7 +36,7 @@
USE m_fleur_init_old
USE m_types_xcpot_inbuild
USE m_mpi_bc_xcpot
USE m_wann_read_inp
#ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all
......@@ -90,7 +90,8 @@
REAL :: a1(3),a2(3),a3(3)
REAL :: dtild, phi_add
LOGICAL :: l_found, l_kpts, l_exist
LOGICAL :: l_wann_inp
#ifdef CPP_MPI
INCLUDE 'mpif.h'
INTEGER ierr(3)
......@@ -534,5 +535,12 @@
!new check mode will only run the init-part of FLEUR
IF (judft_was_argument("-check")) CALL judft_end("Check-mode done",mpi%irank)
INQUIRE (file='wann_inp',exist=l_wann_inp)
input%l_wann = input%l_wann.OR.l_wann_inp
IF(input%l_wann) THEN
CALL wann_read_inp(DIMENSION,input,noco,(mpi%irank.EQ.0),wann)
END IF
END SUBROUTINE fleur_init
END MODULE m_fleur_init
......@@ -47,7 +47,7 @@ c*******************************************c
use m_wann_projmethod
use m_wann_abinv
use m_wann_kptsrotate
use m_wann_read_inp
! use m_wann_read_inp !Call wann_read_inp in fleur_init
use m_matmul,only : matmul3,matmul3r
use m_wann_maxbnd
use m_wann_uHu_tlmplm
......@@ -290,7 +290,7 @@ c ..initializations..
c-----read the input file to determine what to do
call wann_read_inp(input,l_p0,wann)
! call wann_read_inp(input,l_p0,wann) !Call wann_read_inp in fleur_init
if(wann%l_byenergy.and.wann%l_byindex) CALL juDFT_error
+ ("byenergy.and.byindex",calledby ="wannier")
......@@ -1030,36 +1030,36 @@ c if (mod(i_rec-1,isize).eq.irank) then
& nbands,eigg,zzMat)
do i = 1,nbands
if((eigg(i).ge.e1s.and.nslibd.lt.numbands
& .and.wann%l_bynumber)
&.or.(eigg(i).ge.e1s.and.eigg(i).le.e2s.and.wann%l_byenergy)
&.or.(i.ge.wann%band_min(jspin)
& .and.
& (i.le.wann%band_max(jspin))
& .and.
& wann%l_byindex))then
nslibd = nslibd + 1
eig(nslibd) = eigg(i)
we(nslibd) = we(i)
if(l_noco)then
! funbas = nv(1) + nlotot
! funbas = funbas+nv(2) + nlotot
else
! funbas = nv(jspin) + nlotot
endif
IF (zzMat%l_real) THEN
! do j = 1,funbas
zMat%data_r(:,nslibd) = zzMat%data_r(:,i)
! enddo
ELSE
! do j = 1,funbas
zMat%data_c(:,nslibd) = zzMat%data_c(:,i)
! enddo
END IF
endif
enddo
c$$$ nslibd=0
! do i = 1,nbands
! if((eigg(i).ge.e1s.and.nslibd.lt.numbands
! & .and.wann%l_bynumber)
! &.or.(eigg(i).ge.e1s.and.eigg(i).le.e2s.and.wann%l_byenergy)
! &.or.(i.ge.wann%band_min(jspin)
! & .and.
! & (i.le.wann%band_max(jspin))
! & .and.
! & wann%l_byindex))then
! nslibd = nslibd + 1
! eig(nslibd) = eigg(i)
! we(nslibd) = we(i)
! if(l_noco)then
! ! funbas = nv(1) + nlotot
! ! funbas = funbas+nv(2) + nlotot
! else
! ! funbas = nv(jspin) + nlotot
! endif
! IF (zzMat%l_real) THEN
! ! do j = 1,funbas
! zMat%data_r(:,nslibd) = zzMat%data_r(:,i)
! ! enddo
! ELSE
! ! do j = 1,funbas
! zMat%data_c(:,nslibd) = zzMat%data_c(:,i)
! ! enddo
! END IF
! endif
! enddo
......
......@@ -48,7 +48,7 @@ c*******************************************c
use m_wann_projmethod
use m_wann_abinv
use m_wann_kptsrotate
use m_wann_read_inp
! use m_wann_read_inp !Call wann_read_inp in fleur_init
use m_matmul,only : matmul3,matmul3r
use m_wann_maxbnd
use m_wann_uHu_tlmplm2
......@@ -295,7 +295,7 @@ c ..initializations..
c-----read the input file to determine what to do
call wann_read_inp(input,l_p0,wann)
! call wann_read_inp(input,l_p0,wann) CAll wann_read_inp in fleur_init
if(wann%l_byenergy.and.wann%l_byindex) CALL juDFT_error
+ ("byenergy.and.byindex",calledby ="wannier")
......
......@@ -3,6 +3,7 @@
subroutine wann_convert_fleur_w90(jspins_in,l_nocosoc,wann)
use m_types
use m_juDFT
use m_constants
IMPLICIT NONE
integer,intent(in) :: jspins_in
logical,intent(in) :: l_nocosoc
......@@ -29,7 +30,7 @@
integer :: dummy1,dummy2,dummy3,dummy4,dummy5,dummy6
integer :: spin1,spin2,spinmat_dims,ikpt,dir,ii,jj
real :: conversionfactor
real,parameter :: hart=27.21138505
! real,parameter :: hart=27.21138505 !take from m_constants
integer :: jj_tmp,ii_tmp,j_tmp,i_tmp,dir_tmp,ikpt_tmp,test_tmp
integer :: write_bands,firstband
integer :: map3(3)
......@@ -184,7 +185,7 @@
filestoread=1
filenameread(1)='updown.perpmag_unf'
filenamewrite='WF1.tor'
conversionfactor=hart
conversionfactor=hartree_to_ev_const
map3(1)=2
map3(2)=1
......@@ -196,7 +197,7 @@
filestoread=1
filenameread(1)='updown.perpmag'
filenamewrite='WF1.tor'
conversionfactor=hart
conversionfactor=hartree_to_ev_const
map3(1)=2
map3(2)=1
......@@ -208,7 +209,7 @@
filestoread=1
filenameread(1)='updown.perpmag'
filenamewrite='WF1.tor'
conversionfactor=hart
conversionfactor=hartree_to_ev_const
map3(1)=2
map3(2)=1
......@@ -220,7 +221,7 @@
filestoread=1
filenameread(1)='updown.perpmag_unf'
filenamewrite='WF1.tor'
conversionfactor=hart
conversionfactor=hartree_to_ev_const
map3(1)=2
map3(2)=1
......@@ -235,7 +236,7 @@
l_spinmat=.true.
l_conjg=.true.
spinmat_dims=3
conversionfactor=hart
conversionfactor=hartree_to_ev_const
! write_bands=num_bands1
if(l_nocosoc) call juDFT_error('noco_or_soc and hsomtxvec')
......@@ -250,7 +251,7 @@
filenamewrite='WF1.lmpzsoc'
l_spinmat=.true.
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
! write_bands=num_bands1
if(l_nocosoc) call juDFT_error('noco_or_soc and hsomtxvec')
......@@ -265,7 +266,7 @@
l_spinmat=.true.
spinmat_dims=3
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
! write_bands=num_bands1
if(l_nocosoc) call juDFT_error('noco_or_soc and hsomtxvec')
......@@ -280,7 +281,7 @@
l_spinmat=.true.
spinmat_dims=3
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
! write_bands=num_bands1
if(l_nocosoc) call juDFT_error('noco_or_soc and hsomtxvec')
......@@ -296,7 +297,7 @@
num_compos=1
spinmat_dims=1
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
!
elseif(wann%l_hsomtx_to_hsoc_unf)then
......@@ -311,7 +312,7 @@
num_compos=1
spinmat_dims=1
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
!
elseif(wann%l_hsomtx_to_hsoc)then
l_readunf=.false.
......@@ -325,7 +326,7 @@
num_compos=1
spinmat_dims=1
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
!
elseif(wann%l_hsomtx_unf_to_hsoc)then
l_readunf=.true.
......@@ -339,7 +340,7 @@
l_spinmat=.true.
spinmat_dims=1
l_conjg=.true.
conversionfactor=hart
conversionfactor=hartree_to_ev_const
!
......
......@@ -14,7 +14,7 @@ CONTAINS
! Frank Freimuth
!**************************************************
USE m_types
USE m_wann_read_inp
! USE m_wann_read_inp !Call wann_read_inp now in fleur-init
USE m_wann_projgen
USE m_wann_kpointgen
USE m_wann_w90kpointgen
......@@ -42,7 +42,7 @@ CONTAINS
l_nocosoc=noco%l_noco.OR.noco%l_soc
!-----read the input file to determine what to do
CALL wann_read_inp(input,.TRUE.,wann)
! CALL wann_read_inp(input,.TRUE.,wann) !call wann_read_inp now in fleur_init
!-----generate projection-definition-file
IF(wann%l_projgen) THEN
......
......@@ -7,7 +7,7 @@
module m_wann_read_inp
contains
subroutine wann_read_inp(input,l_p0,wann)
subroutine wann_read_inp(DIMENSION,input,noco,l_p0,wann)
!********************************************
! Read the Wannier input file 'wann_inp'.
! Frank Freimuth
......@@ -17,12 +17,14 @@ subroutine wann_read_inp(input,l_p0,wann)
implicit none
TYPE(t_input), intent(in) :: input
TYPE(t_dimension), INTENT(INOUT) :: DIMENSION
TYPE(t_input),intent(inout) :: input
TYPE(t_noco), INTENT(INOUT) :: noco
TYPE(t_wann), intent(inout) :: wann
logical,intent(in) :: l_p0
logical :: l_file,l_orbcompinp
integer :: i,ios,n
integer :: i,ios,n,neigd_min
character(len=30) :: task
real :: version_real
......@@ -178,6 +180,8 @@ subroutine wann_read_inp(input,l_p0,wann)
wann%l_ndegen=.true.
elseif(trim(task).eq.'unformatted')then
wann%l_unformatted=.true.
elseif(trim(task).eq.'eig66')then
input%eig66(1)=.true.
elseif(trim(task).eq.'orbcomp')then
wann%l_orbcomp=.true.
elseif(trim(task).eq.'orbcomprs')then
......@@ -462,6 +466,8 @@ subroutine wann_read_inp(input,l_p0,wann)
wann%l_ndegen=.true.
elseif(trim(task).eq.'unformatted')then
wann%l_unformatted=.true.
elseif(trim(task).eq.'eig66')then
input%eig66(1)=.true.
elseif(trim(task).eq.'orbcomp')then
wann%l_orbcomp=.true.
elseif(trim(task).eq.'orbcomprs')then
......@@ -726,6 +732,34 @@ subroutine wann_read_inp(input,l_p0,wann)
enddo
endif
!---- check if we need to increase the neigd parameter
if(wann%l_byindex)then
if(noco%l_soc.OR.noco%l_noco)then
neigd_min=wann%band_max(1)
else
neigd_min=max(wann%band_max(1),wann%band_max(2))
endif !noco,soc?
if(l_p0)then
write(*,*)"In wann_read_inp: input-neigd=",DIMENSION%neigd
write(*,*)"In wann_read_inp: we require at least neigd_min=",neigd_min
if(neigd_min>DIMENSION%neigd)then
write(*,*)"we increase neigd..."
else
write(*,*)"we leave neigd unchanged"
endif
endif !l_p0?
if(neigd_min>DIMENSION%neigd)then
DIMENSION%neigd=neigd_min
endif
if(l_p0)then
write(*,*)"In wann_read_inp: output-neigd=",DIMENSION%neigd
endif
endif !l_byindex?
end subroutine wann_read_inp
end module m_wann_read_inp
......@@ -23,7 +23,7 @@ c****************************************************************
> irreduc,odi,band_min,band_max,numbands,
> e1s,e2s,ef,l_paulimag,nkpt,
< nbnd,kpoints,l_gwf,iqpt)
use m_constants
use m_cdnread, only:cdn_read
use m_types
......@@ -67,7 +67,7 @@ c****************************************************************
INTEGER, INTENT(IN) :: iqpt
CHARACTER(len=12) :: fname
! END QPOINTS
real,parameter :: hartree=27.21138505
! real,parameter :: hartree=27.21138505 !now in module constants
TYPE(t_mat) :: zMat !z(nbasfcn,noccbd) !can be real/complex
......@@ -150,7 +150,7 @@ c****************************************************************
nkbnd = nkbnd + 1
if(l_bynumber.or.l_byindex)then
write (306,'(2i12,f19.13)') nkbnd,ikpt,(eig(i)-ef)*
& hartree
& hartree_to_ev_const
endif
if(l_paulimag.and..false.)then
if(eig(i).le.ef)then
......@@ -193,7 +193,7 @@ c****************************************************************
if(eig(i).ge.e1s .and. nkbnd.lt.nbnd)then
nkbnd = nkbnd + 1
write (306,'(2i12,f19.13)')nkbnd,ikpt,(eig(i)-ef)*
& hartree
& hartree_to_ev_const
endif
enddo
enddo
......
......@@ -70,7 +70,7 @@ c***********************************************************************
complex, intent(in) :: bcof(:,0:,:,:) !bcof(noccbd,0:lmd,natd,jspd)
complex, intent(in) :: chelp(-llod:,:,:,:,:) !chelp(-llod:llod,neigd,nlod,natd,jspd)
complex, allocatable, intent(out):: hsomtx(:,:,:,:) !(neigd,neigd,2,2)
complex, intent(out):: hsomtx(:,:,:,:) !(neigd,neigd,2,2)
integer :: n,l,nwdd,nw,ispin,ie,na,ll1,m,lm,i,nsz(2)
real :: s(3),r2
......@@ -78,16 +78,16 @@ c***********************************************************************
CHARACTER*3 chntype
real :: theta,phi,pi
real,allocatable :: ddn(:,:,:) ! 0:lmaxd,ntypd,jspd
real,allocatable :: us(:,:,:) ! 0:lmaxd,ntypd,jspd
real,allocatable :: dus(:,:,:) ! 0:lmaxd,ntypd,jspd
real,allocatable :: uds(:,:,:) ! 0:lmaxd,ntypd,jspd
real,allocatable :: duds(:,:,:)! 0:lmaxd,ntypd,jspd
! real,allocatable :: ddn(:,:,:) ! 0:lmaxd,ntypd,jspd
! real,allocatable :: us(:,:,:) ! 0:lmaxd,ntypd,jspd
! real,allocatable :: dus(:,:,:) ! 0:lmaxd,ntypd,jspd
! real,allocatable :: uds(:,:,:) ! 0:lmaxd,ntypd,jspd
! real,allocatable :: duds(:,:,:)! 0:lmaxd,ntypd,jspd
real,allocatable :: ulos(:,:,:) ! nlod,ntypd,jspd
real,allocatable :: dulos(:,:,:) ! nlod,ntypd,jspd
real,allocatable :: uulon(:,:,:) ! nlod,ntypd,jspd
real,allocatable :: dulon(:,:,:) ! nlod,ntypd,jspd
! real,allocatable :: ulos(:,:,:) ! nlod,ntypd,jspd
! real,allocatable :: dulos(:,:,:) ! nlod,ntypd,jspd
! real,allocatable :: uulon(:,:,:) ! nlod,ntypd,jspd
! real,allocatable :: dulon(:,:,:) ! nlod,ntypd,jspd
COMPLEX,ALLOCATABLE :: ahelp(:,:,:,:)
complex,allocatable :: bhelp(:,:,:,:)
......@@ -138,11 +138,11 @@ c***********************************************************************
+ usdus%uulon(atoms%nlod,atoms%ntype,jspd),
+ usdus%dulon(atoms%nlod,atoms%ntype,jspd))
ALLOCATE( us(0:lmaxd,ntypd,jspd), dus(0:lmaxd,ntypd,jspd),
+ uds(0:lmaxd,ntypd,jspd),duds(0:lmaxd,ntypd,jspd),
+ ddn(0:lmaxd,ntypd,jspd),
+ ulos(nlod,ntypd,jspd),dulos(nlod,ntypd,jspd),
+ uulon(nlod,ntypd,jspd),dulon(nlod,ntypd,jspd))
! ALLOCATE( us(0:lmaxd,ntypd,jspd), dus(0:lmaxd,ntypd,jspd),
! + uds(0:lmaxd,ntypd,jspd),duds(0:lmaxd,ntypd,jspd),
! + ddn(0:lmaxd,ntypd,jspd),
! + ulos(nlod,ntypd,jspd),dulos(nlod,ntypd,jspd),
! + uulon(nlod,ntypd,jspd),dulon(nlod,ntypd,jspd))
CALL spnorb(
> atoms,noco,input,mpi, enpara,
......
......@@ -8,7 +8,7 @@
use m_juDFT
CONTAINS
SUBROUTINE wann_updown(
> DIMENSION,mpi,input,kpts,sym,atoms,stars,vacuum,
> DIMENSION,wann,mpi,input,kpts,sym,atoms,stars,vacuum,
> sphhar,oneD,noco,cell,vTot,
> enpara,
> eig_id,l_real,mpi_comm,l_dulo,l_noco,l_ss,lmaxd,ntypd,
......@@ -75,6 +75,7 @@ c****************************************************************************
#endif
TYPE(t_dimension), INTENT(IN) :: DIMENSION
TYPE(t_wann), INTENT(INOUT) :: wann
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_input),INTENT(IN) :: input
TYPE(t_kpts), INTENT(IN) :: kpts
......@@ -128,7 +129,7 @@ c****************************************************************************
real, intent(in) :: theta,phi
cccccccccccccccccc local variables cccccccccccccccccccc
type(t_wann) :: wann
! type(t_wann) :: wann !now input variable
integer :: lmd,nlotot,n,nmat,iter,ikpt,ikpt_b,nmat_b
integer :: addnoco,addnoco2,funbas,loplod
integer :: noccbd,noccbd_b,nn,nkpts,i,jspin,j,l,i_rec,m,nwf,nwfp
......@@ -293,7 +294,7 @@ c-----initializations
nkpts = nkpt
c-----read the input file to determine what to do
call wann_read_inp(input,l_p0,wann)
! call wann_read_inp(input,l_p0,wann) !call wann_read_inp now in fleur_init
IF(wann%l_byenergy.AND.wann%l_byindex) CALL juDFT_error
+ ("byenergy.and.byindex",calledby ="wann_updown")
......@@ -692,6 +693,7 @@ c****************************************************************
call wann_gabeffgagaunt(
> vTot,
> wann%l_perpmagatlres,wann%perpmagl,
> neq,mlh,nlhd,nlh,ntypsy,llh,lmax,
> nmem,ntype,ntypd,bbmat,bmat,
......
......@@ -77,7 +77,7 @@ CONTAINS
USE m_wann_abinv
USE m_wann_kptsrotate
USE m_wann_plot
USE m_wann_read_inp
! USE m_wann_read_inp !Call wann_read_inp in fleur_init
USE m_wann_plot_symm
USE m_wann_mmkb_int
USE m_wann_postproc
......@@ -334,7 +334,7 @@ CONTAINS
wann%atomlist_num=atoms%nat
wann%oc_num_orbs=atoms%nat
CALL wann_read_inp(input,l_p0,wann)
! CALL wann_read_inp(input,l_p0,wann) !Call wann_read_inp in fleur_init
!-----input file for orbital decomposition
......@@ -360,7 +360,7 @@ CONTAINS
IF(wann%l_updown)THEN
CALL wann_updown(&
DIMENSION,mpi,input,kpts,sym,atoms,stars,vacuum,sphhar, &
DIMENSION,wann,mpi,input,kpts,sym,atoms,stars,vacuum,sphhar, &
oneD,noco,cell,vTot,&
enpara,eig_idList(1),l_real,&
mpi%mpi_comm,atoms%l_dulo,noco%l_noco,noco%l_ss,&
......
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