Commit 729088f4 authored by Gregor Michalicek's avatar Gregor Michalicek

Some more preparations for the Wannier code integration

In this commit there mainly are some adaptions to the new eigenvector I/O.
parent cab605d0
...@@ -162,51 +162,51 @@ MODULE m_fleur ...@@ -162,51 +162,51 @@ MODULE m_fleur
! r.pentcheva,kfa,Feb'96 ! r.pentcheva,kfa,Feb'96
! Types, these variables contain a lot of data! ! Types, these variables contain a lot of data!
TYPE(t_input) :: input TYPE(t_input) :: input
TYPE(t_dimension) :: dimension TYPE(t_dimension) :: dimension
TYPE(t_atoms) :: atoms TYPE(t_atoms) :: atoms
TYPE(t_sphhar) :: sphhar TYPE(t_sphhar) :: sphhar
TYPE(t_cell) :: cell TYPE(t_cell) :: cell
TYPE(t_stars) :: stars TYPE(t_stars) :: stars
TYPE(t_sym) :: sym TYPE(t_sym) :: sym
TYPE(t_noco) :: noco TYPE(t_noco) :: noco
TYPE(t_vacuum) :: vacuum TYPE(t_vacuum) :: vacuum
TYPE(t_sliceplot) :: sliceplot TYPE(t_sliceplot) :: sliceplot
TYPE(t_banddos) :: banddos TYPE(t_banddos) :: banddos
TYPE(t_obsolete) :: obsolete TYPE(t_obsolete) :: obsolete
TYPE(t_enpara) :: enpara TYPE(t_enpara) :: enpara
TYPE(t_xcpot) :: xcpot TYPE(t_xcpot) :: xcpot
TYPE(t_results) :: results TYPE(t_results) :: results
TYPE(t_jij) :: jij TYPE(t_jij) :: jij
TYPE(t_kpts) :: kpts TYPE(t_kpts) :: kpts
TYPE(t_hybrid) :: hybrid TYPE(t_hybrid) :: hybrid
TYPE(t_oneD) :: oneD TYPE(t_oneD) :: oneD
TYPE(t_mpi) :: mpi TYPE(t_mpi) :: mpi
TYPE(t_wann) :: wann TYPE(t_wann) :: wann
! .. Local Scalars .. ! .. Local Scalars ..
INTEGER :: eig_id INTEGER :: eig_id
INTEGER :: i,it,ithf,jspin,n,pc INTEGER :: i,it,ithf,jspin,n,pc
LOGICAL :: stop80,reap,l_endit,l_opti,l_cont LOGICAL :: stop80,reap,l_endit,l_opti,l_cont
CHARACTER(len=12) :: fname(3)
!--- J< !--- J<
INTEGER :: phn INTEGER :: phn
REAL, PARAMETER :: tol = 1.e-8 REAL, PARAMETER :: tol = 1.e-8
INTEGER :: qcount ,imt,i_J,j_J INTEGER :: qcount ,imt,i_J,j_J
!--- J> !--- J>
! .. Local Arrays .. ! .. Local Arrays ..
CHARACTER(8) :: name(10) CHARACTER(8) :: name(10)
! HF/hybrid-functionals/EXX ! HF/hybrid-functionals/EXX
INTEGER :: l,j,m1,m2,isym,iisym INTEGER :: l,j,m1,m2,isym,iisym
INTEGER :: ok INTEGER :: ok
LOGICAL :: l_restart LOGICAL :: l_restart
COMPLEX :: cdum COMPLEX :: cdum
#ifdef CPP_MPI #ifdef CPP_MPI
include 'mpif.h' include 'mpif.h'
integer :: ierr(2) integer :: ierr(2)
#endif #endif
INTEGER, ALLOCATABLE :: eig_idList(:)
mpi%mpi_comm = mpi_comm mpi%mpi_comm = mpi_comm
CALL timestart("Initialization") CALL timestart("Initialization")
...@@ -244,6 +244,7 @@ MODULE m_fleur ...@@ -244,6 +244,7 @@ MODULE m_fleur
END IF END IF
IF (wann%l_gwf) input%itmax = 1 IF (wann%l_gwf) input%itmax = 1
#endif #endif
ALLOCATE (eig_idList(wann%nparampts))
l_restart = .TRUE. l_restart = .TRUE.
...@@ -304,7 +305,8 @@ MODULE m_fleur ...@@ -304,7 +305,8 @@ MODULE m_fleur
jij%alph1(:)=noco%alph(:) jij%alph1(:)=noco%alph(:)
stop80= .FALSE. stop80= .FALSE.
IF ((noco%l_soc.AND.noco%l_ss)) THEN IF ((noco%l_soc.AND.noco%l_ss)) THEN
IF ((jij%l_J).OR.(jij%nqpt/=1).OR.(jij%nmagn/=1).OR.(jij%phnd/=1)) THEN IF ((.NOT.wann%l_gwf).AND.&
((jij%l_J).OR.(jij%nqpt/=1).OR.(jij%nmagn/=1).OR.(jij%phnd/=1))) THEN
CALL juDFT_error("fleur: J-loop with ss+soc", calledby ="fleur") CALL juDFT_error("fleur: J-loop with ss+soc", calledby ="fleur")
END IF END IF
END IF END IF
...@@ -315,7 +317,7 @@ MODULE m_fleur ...@@ -315,7 +317,7 @@ MODULE m_fleur
noco%qss(:)=jij%qj(:,qcount) noco%qss(:)=jij%qj(:,qcount)
jij%qn = ( noco%qss(1)**2 + noco%qss(2)**2 + noco%qss(3)**2 ) jij%qn = ( noco%qss(1)**2 + noco%qss(2)**2 + noco%qss(3)**2 )
END IF END IF
IF (jij%l_J.AND.(mpi%irank.EQ.0)) THEN IF ((input%l_wann.OR.jij%l_J).AND.(mpi%irank.EQ.0)) THEN
WRITE(6,*) 'qss=(',noco%qss(1),',',noco%qss(2),',',noco%qss(3),')' WRITE(6,*) 'qss=(',noco%qss(1),',',noco%qss(2),',',noco%qss(3),')'
CALL timestart("Q-point for J_ij(total)") CALL timestart("Q-point for J_ij(total)")
END IF END IF
...@@ -348,8 +350,8 @@ MODULE m_fleur ...@@ -348,8 +350,8 @@ MODULE m_fleur
IF (it==1) THEN IF (it==1) THEN
eig_id=open_eig(mpi%mpi_comm,dimension%nbasfcn,dimension%neigd,kpts%nkpt(1),& eig_id=open_eig(mpi%mpi_comm,dimension%nbasfcn,dimension%neigd,kpts%nkpt(1),&
dimension%jspd,atoms%lmaxd,atoms%nlod,atoms%ntype,atoms%nlotot,& dimension%jspd,atoms%lmaxd,atoms%nlod,atoms%ntype,atoms%nlotot,&
noco%l_noco,.FALSE.,.FALSE.) noco%l_noco,.FALSE.,.FALSE.)
! CALL open_eig(mpi_comm, ! CALL open_eig(mpi_comm,
! > nbasfcn,neigd,nkpt(1),jspd,lmaxd,nlod,ntypd,nlotot, ! > nbasfcn,neigd,nkpt(1),jspd,lmaxd,nlod,ntypd,nlotot,
! > l_noco,.false.,.true.) ! > l_noco,.false.,.true.)
...@@ -420,8 +422,8 @@ MODULE m_fleur ...@@ -420,8 +422,8 @@ MODULE m_fleur
jij%qn = (noco%qss(1)**2 + noco%qss(2)**2 + noco%qss(3)**2) jij%qn = (noco%qss(1)**2 + noco%qss(2)**2 + noco%qss(3)**2)
noco%alph(:) = wann%param_alpha(:,pc) noco%alph(:) = wann%param_alpha(:,pc)
ELSE IF (wann%l_socgwf) THEN ELSE IF (wann%l_socgwf) THEN
IF(wann%l_dim(2)) noco%phi = tpi_const*wann%param_vec(2,pc) IF(wann%l_dim(2)) noco%phi = tpi_const * wann%param_vec(2,pc)
IF(wann%l_dim(3)) noco%theta = tpi_const*wann%param_vec(3,pc) IF(wann%l_dim(3)) noco%theta = tpi_const * wann%param_vec(3,pc)
END IF END IF
!---< gwf !---< gwf
...@@ -506,6 +508,7 @@ MODULE m_fleur ...@@ -506,6 +508,7 @@ MODULE m_fleur
CALL eigen(mpi,stars,sphhar,atoms,obsolete,xcpot,& CALL eigen(mpi,stars,sphhar,atoms,obsolete,xcpot,&
sym,kpts,dimension,vacuum,input,cell,enpara,banddos,noco,jij,oneD,hybrid,& sym,kpts,dimension,vacuum,input,cell,enpara,banddos,noco,jij,oneD,hybrid,&
it,eig_id, results) it,eig_id, results)
eig_idList(pc) = eig_id
CALL timestop("eigen") CALL timestop("eigen")
! !
! add all contributions to total energy ! add all contributions to total energy
...@@ -660,7 +663,7 @@ MODULE m_fleur ...@@ -660,7 +663,7 @@ MODULE m_fleur
END DO !imt END DO !imt
IF ((mpi%irank.EQ.0).AND.(jij%l_J)) THEN IF ((input%l_wann.OR.jij%l_J).AND.(mpi%irank.EQ.0)) THEN
CALL timestop("Q-point for J_ij(total)") CALL timestop("Q-point for J_ij(total)")
END IF END IF
...@@ -804,7 +807,9 @@ MODULE m_fleur ...@@ -804,7 +807,9 @@ MODULE m_fleur
IF (xcpot%icorr /= icorr_pbe0.AND.xcpot%icorr /= icorr_hse .AND. & IF (xcpot%icorr /= icorr_pbe0.AND.xcpot%icorr /= icorr_hse .AND. &
xcpot%icorr /= icorr_hf .AND.xcpot%icorr /= icorr_exx .AND. & xcpot%icorr /= icorr_hf .AND.xcpot%icorr /= icorr_exx .AND. &
xcpot%icorr /= icorr_vhse) THEN xcpot%icorr /= icorr_vhse) THEN
CALL close_eig(eig_id) DO pc = 1, wann%nparampts
CALL close_eig(eig_idList(pc))
END DO
END IF END IF
END IF !(if not jij%l_J) END IF !(if not jij%l_J)
......
...@@ -20,8 +20,8 @@ c*******************************************c ...@@ -20,8 +20,8 @@ c*******************************************c
CONTAINS CONTAINS
SUBROUTINE wann_uHu( SUBROUTINE wann_uHu(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos, > DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos,
> lapw,oneD,noco,cell, > lapw,oneD,noco,cell,wann,
> l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd, > eig_idList,l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype, > neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype,
> omtil,nlo,llo,lapw_l,invtab,mrot,ngopr,neq,lmax, > omtil,nlo,llo,lapw_l,invtab,mrot,ngopr,neq,lmax,
> invsat,invsatnr,nkpt,taual,rmt,amat,bmat,bbmat,alph, > invsat,invsatnr,nkpt,taual,rmt,amat,bmat,bbmat,alph,
...@@ -84,11 +84,13 @@ c*******************************************c ...@@ -84,11 +84,13 @@ c*******************************************c
TYPE(t_oneD),INTENT(IN) :: oneD TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_noco),INTENT(IN) :: noco TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_wann),INTENT(INOUT) :: wann
c ..scalar arguments.. c ..scalar arguments..
character(len=20),intent(in) :: param_file character(len=20),intent(in) :: param_file
type (od_inp), intent (in) :: odi type (od_inp), intent (in) :: odi
type (od_sym), intent (in) :: ods type (od_sym), intent (in) :: ods
INTEGER, INTENT (IN) :: eig_idList(wann%nparampts)
logical, intent (in) :: invs,invs2,film,slice,symor,zrfs logical, intent (in) :: invs,invs2,film,slice,symor,zrfs
logical, intent (in) :: l_real,l_noco,l_ss,l_soc logical, intent (in) :: l_real,l_noco,l_ss,l_soc
logical, intent (in) :: l_ms,l_sgwf,l_socgwf logical, intent (in) :: l_ms,l_sgwf,l_socgwf
...@@ -143,7 +145,7 @@ c ..allocatable arrays.. ...@@ -143,7 +145,7 @@ c ..allocatable arrays..
integer, allocatable :: counts(:),displs(:) integer, allocatable :: counts(:),displs(:)
integer, allocatable :: gb(:,:,:),bpt(:,:) integer, allocatable :: gb(:,:,:),bpt(:,:)
integer, allocatable :: gb_q(:,:,:),bpt_q(:,:) integer, allocatable :: gb_q(:,:,:),bpt_q(:,:)
INTEGER, ALLOCATABLE :: eig_idList(:) INTEGER, ALLOCATABLE :: innerEig_idList(:)
real, allocatable :: we(:),we_b(:),we_b2(:) real, allocatable :: we(:),we_b(:),we_b2(:)
real, allocatable :: eigg(:) real, allocatable :: eigg(:)
real, allocatable :: vr(:,:,:),vz(:,:,:),vrf(:,:,:,:) real, allocatable :: vr(:,:,:),vz(:,:,:),vrf(:,:,:,:)
...@@ -196,7 +198,6 @@ c ..local scalars.. ...@@ -196,7 +198,6 @@ c ..local scalars..
character(len=8) :: dop,iop character(len=8) :: dop,iop
character(len=12) fending character(len=12) fending
character(len=30) fstart character(len=30) fstart
type(t_wann) :: wann
logical :: l_p0,l_bkpts,l_proj,l_file logical :: l_p0,l_bkpts,l_proj,l_file
logical :: l_bqpts,l_gwf,l_exist,l_nocosoc,l_symcheck logical :: l_bqpts,l_gwf,l_exist,l_nocosoc,l_symcheck
logical :: l_skip_sph,l_skip_non,l_skip_soc logical :: l_skip_sph,l_skip_non,l_skip_soc
...@@ -646,7 +647,7 @@ c START Q LOOP c ...@@ -646,7 +647,7 @@ c START Q LOOP c
c*****************************************************************c c*****************************************************************c
do 314 iqpt = 1,fullnqpts ! loop by q-points starts do 314 iqpt = 1,fullnqpts ! loop by q-points starts
ALLOCATE(eig_idList(nntot_q)) ALLOCATE(innerEig_idList(nntot_q))
qptibz=iqpt qptibz=iqpt
if(wann%l_bzsym .AND. l_gwf) qptibz=irreduc_q(iqpt) if(wann%l_bzsym .AND. l_gwf) qptibz=irreduc_q(iqpt)
...@@ -676,46 +677,52 @@ c*****************************************************************c ...@@ -676,46 +677,52 @@ c*****************************************************************c
IF (l_gwf) THEN IF (l_gwf) THEN
do iqpt_b=1,nntot_q do iqpt_b=1,nntot_q
WRITE(fending,'("_",i4.4)')bpt_q(iqpt_b,iqpt)
innerEig_idList(iqpt_b) = eig_idList(bpt_q(iqpt_b,iqpt))
eig_idList(iqpt_b)=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,
+ DIMENSION%neigd, ! WRITE(fending,'("_",i4.4)')bpt_q(iqpt_b,iqpt)
+ nkpts,wannierspin,atoms%lmaxd, ! innerEig_idList(iqpt_b)=open_eig(mpi%mpi_comm,
+ atoms%nlod,atoms%ntype,atoms%nlotot, ! + DIMENSION%nbasfcn,DIMENSION%neigd,
+ l_noco,.FALSE.,l_real,l_soc,.FALSE., ! + nkpts,wannierspin,atoms%lmaxd,
+ mpi%n_size,filename=trim(fstart)//fending, ! + atoms%nlod,atoms%ntype,atoms%nlotot,
+ layers=vacuum%layers,nstars=vacuum%nstars, ! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
+ ncored=DIMENSION%nstd,nsld=atoms%nat, ! + mpi%n_size,filename=trim(fstart)//fending,
+ nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf, ! + layers=vacuum%layers,nstars=vacuum%nstars,
+ l_mcd=banddos%l_mcd,l_orb=banddos%l_orb) ! + ncored=DIMENSION%nstd,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
! + l_mcd=banddos%l_mcd,l_orb=banddos%l_orb)
enddo enddo
WRITE(fending,'("_",i4.4)')qptibz
eig_id = eig_idList(qptibz)
eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,
+ nkpts,wannierspin,atoms%lmaxd, ! WRITE(fending,'("_",i4.4)')qptibz
+ atoms%nlod,atoms%ntype,atoms%nlotot, ! eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,
+ l_noco,.FALSE.,l_real,l_soc,.FALSE., ! + nkpts,wannierspin,atoms%lmaxd,
+ mpi%n_size,filename=trim(fstart)//fending, ! + atoms%nlod,atoms%ntype,atoms%nlotot,
+ layers=vacuum%layers,nstars=vacuum%nstars, ! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
+ ncored=DIMENSION%nstd,nsld=atoms%nat, ! + mpi%n_size,filename=trim(fstart)//fending,
+ nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf, ! + layers=vacuum%layers,nstars=vacuum%nstars,
+ l_mcd=banddos%l_mcd,l_orb=banddos%l_orb) ! + ncored=DIMENSION%nstd,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
! + l_mcd=banddos%l_mcd,l_orb=banddos%l_orb)
! OPEN(66,file=trim(fstart)//fending,access='direct', ! OPEN(66,file=trim(fstart)//fending,access='direct',
! > form='unformatted',recl=irecl,status='old') ! > form='unformatted',recl=irecl,status='old')
ELSEIF(l_ms) THEN ELSEIF(l_ms) THEN
WRITE(fending,'("_",i4.4)')qptibz
eig_id = eig_idList(qptibz)
eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,
+ nkpts,wannierspin,atoms%lmaxd, ! WRITE(fending,'("_",i4.4)')qptibz
+ atoms%nlod,atoms%ntype,atoms%nlotot, ! eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,
+ l_noco,.FALSE.,l_real,l_soc,.FALSE., ! + nkpts,wannierspin,atoms%lmaxd,
+ mpi%n_size,filename=trim(fstart)//fending, ! + atoms%nlod,atoms%ntype,atoms%nlotot,
+ layers=vacuum%layers,nstars=vacuum%nstars, ! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
+ ncored=DIMENSION%nstd,nsld=atoms%nat, ! + mpi%n_size,filename=trim(fstart)//fending,
+ nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf, ! + layers=vacuum%layers,nstars=vacuum%nstars,
+ l_mcd=banddos%l_mcd,l_orb=banddos%l_orb) ! + ncored=DIMENSION%nstd,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
! + l_mcd=banddos%l_mcd,l_orb=banddos%l_orb)
! OPEN(66,file=trim(fstart)//fending,access='direct', ! OPEN(66,file=trim(fstart)//fending,access='direct',
! > form='unformatted',recl=irecl,status='old') ! > form='unformatted',recl=irecl,status='old')
...@@ -1407,11 +1414,11 @@ c endif ...@@ -1407,11 +1414,11 @@ c endif
! close eig files ! close eig files
IF (l_gwf) THEN IF (l_gwf) THEN
CALL close_eig(eig_id) ! CALL close_eig(eig_id)
! CLOSE(66) ! CLOSE(66)
DO iqpt_b=1,nntot_q DO iqpt_b=1,nntot_q
CALL close_eig(eig_idList(iqpt_b)) ! CALL close_eig(innerEig_idList(iqpt_b))
ENDDO ENDDO
ENDIF ENDIF
...@@ -1425,7 +1432,7 @@ c > wann%l_unformatted,.true.) ...@@ -1425,7 +1432,7 @@ c > wann%l_unformatted,.true.)
if(allocated(uHu)) deallocate(uHu) if(allocated(uHu)) deallocate(uHu)
c if(allocated(uHuold)) deallocate(uHuold) c if(allocated(uHuold)) deallocate(uHuold)
DEALLOCATE(eig_idList) DEALLOCATE(innerEig_idList)
314 continue ! iqpt, q-points 314 continue ! iqpt, q-points
c************************************************c c************************************************c
......
...@@ -20,8 +20,8 @@ c*******************************************c ...@@ -20,8 +20,8 @@ c*******************************************c
CONTAINS CONTAINS
SUBROUTINE wann_uHu_dmi( SUBROUTINE wann_uHu_dmi(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos, > DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,banddos,
> lapw,oneD,noco,cell, > lapw,oneD,noco,cell,wann,
> l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd, > eig_idList,l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype, > neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype,
> omtil,nlo,llo,lapw_l,invtab,mrot,ngopr,neq,lmax, > omtil,nlo,llo,lapw_l,invtab,mrot,ngopr,neq,lmax,
> invsat,invsatnr,nkpt,taual,rmt,amat,bmat,bbmat,alph, > invsat,invsatnr,nkpt,taual,rmt,amat,bmat,bbmat,alph,
...@@ -85,11 +85,13 @@ c*******************************************c ...@@ -85,11 +85,13 @@ c*******************************************c
TYPE(t_oneD),INTENT(IN) :: oneD TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_noco),INTENT(IN) :: noco TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_wann),INTENT(INOUT) :: wann
c ..scalar arguments.. c ..scalar arguments..
character(len=20),intent(in) :: param_file character(len=20),intent(in) :: param_file
type (od_inp), intent (in) :: odi type (od_inp), intent (in) :: odi
type (od_sym), intent (in) :: ods type (od_sym), intent (in) :: ods
INTEGER, INTENT (IN) :: eig_idList(wann%nparampts)
logical, intent (in) :: invs,invs2,film,slice,symor,zrfs logical, intent (in) :: invs,invs2,film,slice,symor,zrfs
logical, intent (in) :: l_real,l_noco,l_ss,l_soc,l_nochi logical, intent (in) :: l_real,l_noco,l_ss,l_soc,l_nochi
logical, intent (in) :: l_ms,l_sgwf,l_socgwf logical, intent (in) :: l_ms,l_sgwf,l_socgwf
...@@ -144,7 +146,7 @@ c ..allocatable arrays.. ...@@ -144,7 +146,7 @@ c ..allocatable arrays..
integer, allocatable :: counts(:),displs(:) integer, allocatable :: counts(:),displs(:)
integer, allocatable :: gb(:,:,:),bpt(:,:) integer, allocatable :: gb(:,:,:),bpt(:,:)
integer, allocatable :: gb_q(:,:,:),bpt_q(:,:) integer, allocatable :: gb_q(:,:,:),bpt_q(:,:)
INTEGER, ALLOCATABLE :: eig_idList(:) INTEGER, ALLOCATABLE :: innerEig_idList(:)
real, allocatable :: we(:),we_b(:),we_b2(:) real, allocatable :: we(:),we_b(:),we_b2(:)
real, allocatable :: eigg(:) real, allocatable :: eigg(:)
real, allocatable :: vr(:,:,:),vz(:,:,:),vrf(:,:,:,:) real, allocatable :: vr(:,:,:),vz(:,:,:),vrf(:,:,:,:)
...@@ -197,7 +199,6 @@ c ..local scalars.. ...@@ -197,7 +199,6 @@ c ..local scalars..
character(len=8) :: dop,iop character(len=8) :: dop,iop
character(len=12) fending character(len=12) fending
character(len=30) fstart character(len=30) fstart
type(t_wann) :: wann
logical :: l_p0,l_bkpts,l_proj,l_file logical :: l_p0,l_bkpts,l_proj,l_file
logical :: l_bqpts,l_gwf,l_exist logical :: l_bqpts,l_gwf,l_exist
logical :: l_skip_sph,l_skip_non,l_skip_soc logical :: l_skip_sph,l_skip_non,l_skip_soc
...@@ -644,7 +645,7 @@ c START Q LOOP c ...@@ -644,7 +645,7 @@ c START Q LOOP c
c*****************************************************************c c*****************************************************************c
do 314 iqpt = 1,fullnqpts ! loop by q-points starts do 314 iqpt = 1,fullnqpts ! loop by q-points starts
ALLOCATE(eig_idList(nntot_q)) ALLOCATE(innerEig_idList(nntot_q))
qptibz=iqpt qptibz=iqpt
if(wann%l_bzsym .AND. l_gwf) qptibz=irreduc_q(iqpt) if(wann%l_bzsym .AND. l_gwf) qptibz=irreduc_q(iqpt)
...@@ -665,39 +666,48 @@ c*****************************************************************c ...@@ -665,39 +666,48 @@ c*****************************************************************c
IF (l_gwf) THEN IF (l_gwf) THEN
do iqpt_b=1,nntot_q do iqpt_b=1,nntot_q
WRITE(fending,'("_",i4.4)')bpt_q(iqpt_b,iqpt)
eig_idList(iqpt_b)=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn, innerEig_idList(iqpt_b) = eig_idList(bpt_q(iqpt_b,iqpt))
+ DIMENSION%neigd,
+ nkpts,wannierspin,atoms%lmaxd, ! WRITE(fending,'("_",i4.4)')bpt_q(iqpt_b,iqpt)
+ atoms%nlod,atoms%ntype,atoms%nlotot, ! innerEig_idList(iqpt_b)=open_eig(mpi%mpi_comm,
+ l_noco,.FALSE.,l_real,l_soc,.FALSE., ! + DIMENSION%nbasfcn,DIMENSION%neigd,
+ mpi%n_size,filename=trim(fstart)//fending, ! + nkpts,wannierspin,atoms%lmaxd,
+ layers=vacuum%layers,nstars=vacuum%nstars, ! + atoms%nlod,atoms%ntype,atoms%nlotot,
+ ncored=DIMENSION%nstd,nsld=atoms%nat, ! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
+ nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf, ! + mpi%n_size,filename=trim(fstart)//fending,
+ l_mcd=banddos%l_mcd,l_orb=banddos%l_orb) ! + layers=vacuum%layers,nstars=vacuum%nstars,
! + ncored=DIMENSION%nstd,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
! + l_mcd=banddos%l_mcd,l_orb=banddos%l_orb)
enddo enddo
WRITE(fending,'("_",i4.4)')qptibz
eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd, eig_id = eig_idList(qptibz)
+ nkpts,wannierspin,atoms%lmaxd,
+ atoms%nlod,atoms%ntype,atoms%nlotot, ! WRITE(fending,'("_",i4.4)')qptibz
+ l_noco,.FALSE.,l_real,l_soc,.FALSE., ! eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,
+ mpi%n_size,filename=trim(fstart)//fending, ! + nkpts,wannierspin,atoms%lmaxd,
+ layers=vacuum%layers,nstars=vacuum%nstars, ! + atoms%nlod,atoms%ntype,atoms%nlotot,
+ ncored=DIMENSION%nstd,nsld=atoms%nat, ! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
+ nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf, ! + mpi%n_size,filename=trim(fstart)//fending,
+ l_mcd=banddos%l_mcd,l_orb=banddos%l_orb) ! + layers=vacuum%layers,nstars=vacuum%nstars,
! + ncored=DIMENSION%nstd,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
! + l_mcd=banddos%l_mcd,l_orb=banddos%l_orb)
ELSEIF(l_ms) THEN ELSEIF(l_ms) THEN
WRITE(fending,'("_",i4.4)')qptibz
eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd, eig_id = eig_idList(qptibz)
+ nkpts,wannierspin,atoms%lmaxd,
+ atoms%nlod,atoms%ntype,atoms%nlotot, ! WRITE(fending,'("_",i4.4)')qptibz
+ l_noco,.FALSE.,l_real,l_soc,.FALSE., ! eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,
+ mpi%n_size,filename=trim(fstart)//fending, ! + nkpts,wannierspin,atoms%lmaxd,
+ layers=vacuum%layers,nstars=vacuum%nstars, ! + atoms%nlod,atoms%ntype,atoms%nlotot,
+ ncored=DIMENSION%nstd,nsld=atoms%nat, ! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
+ nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf, ! + mpi%n_size,filename=trim(fstart)//fending,
+ l_mcd=banddos%l_mcd,l_orb=banddos%l_orb) ! + layers=vacuum%layers,nstars=vacuum%nstars,
! + ncored=DIMENSION%nstd,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
! + l_mcd=banddos%l_mcd,l_orb=banddos%l_orb)
ELSE ELSE
fending='' fending=''
ENDIF ! l_gwf.or.l_ms ENDIF ! l_gwf.or.l_ms
...@@ -1082,7 +1092,7 @@ c*********************************************************** ...@@ -1082,7 +1092,7 @@ c***********************************************************
WRITE(*,*) 'Do I read out the right record here? (wann_uHu_dmi)' WRITE(*,*) 'Do I read out the right record here? (wann_uHu_dmi)'
CALL cdn_read( CALL cdn_read(
> eig_idList(iqpt_b), > innerEig_idList(iqpt_b),
> nvd,jspd,irank,isize,kptibz,jspin_b,nbasfcn, !wannierspin instead of jspd? !kptibz_b2? > nvd,jspd,irank,isize,kptibz,jspin_b,nbasfcn, !wannierspin instead of jspd? !kptibz_b2?
> l_ss,l_noco,neigd,n_start,n_end, > l_ss,l_noco,neigd,n_start,n_end,
< nmat_b2,nv_b2,ello,evdu,epar,kveclo_b2, < nmat_b2,nv_b2,ello,evdu,epar,kveclo_b2,
...@@ -1382,9 +1392,9 @@ c**************************************c ...@@ -1382,9 +1392,9 @@ c**************************************c
! close eig files ! close eig files
IF (l_gwf) THEN IF (l_gwf) THEN
CALL close_eig(eig_id) ! CALL close_eig(eig_id)
DO iqpt_b=1,nntot_q DO iqpt_b=1,nntot_q
CALL close_eig(eig_idList(iqpt_b)) ! CALL close_eig(innerEig_idList(iqpt_b))
ENDDO ENDDO
ENDIF ENDIF
...@@ -1396,7 +1406,7 @@ c**************************************c ...@@ -1396,7 +1406,7 @@ c**************************************c
> wann%l_unformatted,.false.,.false.) > wann%l_unformatted,.false.,.false.)
if(allocated(uHu)) deallocate(uHu) if(allocated(uHu)) deallocate(uHu)
DEALLOCATE(eig_idList) DEALLOCATE(innerEig_idList)
314 continue ! iqpt, q-points 314 continue ! iqpt, q-points
c************************************************c c************************************************c
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
SUBROUTINE wannier( SUBROUTINE wannier(
> DIMENSION,mpi,input,sym,atoms,stars,vacuum,sphhar,lapw,oneD, > DIMENSION,mpi,input,sym,atoms,stars,vacuum,sphhar,lapw,oneD,
> wann,noco,cell,enpara,banddos,sliceplot,odi,ods,results, > wann,noco,cell,enpara,banddos,sliceplot,odi,ods,results,
> l_real,nkpt,nkptd,k1d,k2d,k3d, > eig_idList,l_real,nkpt,nkptd,k1d,k2d,k3d,
> l_ms,l_sgwf,l_socgwf,aux_latt_const, > l_ms,l_sgwf,l_socgwf,aux_latt_const,
> param_file,param_vec,nparampts,param_alpha,l_dim) > param_file,param_vec,nparampts,param_alpha,l_dim)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
...@@ -142,6 +142,7 @@ ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ...@@ -142,6 +142,7 @@ ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
integer, intent (in) :: nkptd integer, intent (in) :: nkptd
integer, intent (in) :: k1d,k2d,k3d integer, intent (in) :: k1d,k2d,k3d
integer, intent (in) :: nkpt integer, intent (in) :: nkpt
INTEGER, INTENT (IN) :: eig_idList(wann%nparampts)
! NEW INPUT PARAMETERS (for gwf) ! NEW INPUT PARAMETERS (for gwf)
real, intent(in) :: aux_latt_const real, intent(in) :: aux_latt_const
...@@ -170,7 +171,7 @@ cccccccccccccccccc local variables cccccccccccccccccccc ...@@ -170,7 +171,7 @@ cccccccccccccccccc local variables cccccccccccccccccccc
integer, allocatable :: kveclo_b(:),nv_b(:) integer, allocatable :: kveclo_b(:),nv_b(:)
integer, allocatable :: k1(:,:),k2(:,:),k3(:,:) integer, allocatable :: k1(:,:),k2(:,:),k3(:,:)
integer, allocatable :: k1_b(:,:),k2_b(:,:),k3_b(:,:) integer, allocatable :: k1_b(:,:),k2_b(:,:),k3_b(:,:)
INTEGER, ALLOCATABLE :: eig_idList(:) INTEGER, ALLOCATABLE :: innerEig_idList(:)
real, allocatable :: we(:),we_b(:) real, allocatable :: we(:),we_b(:)
real, allocatable :: eigg(:) real, allocatable :: eigg(:)
...