Commit ecd05260 authored by Daniel Wortmann's avatar Daniel Wortmann

Reactivating Wannier code

parent d15365d0
Subproject commit 3cb2231abf1d47fbd8b3e21c8478e9f26a73ce5f Subproject commit ca6f7114b9fffe0964ca9e8d24e09ef15b300316
...@@ -103,7 +103,7 @@ CONTAINS ...@@ -103,7 +103,7 @@ CONTAINS
! local scalars ! local scalars
INTEGER :: eig_id,archiveType INTEGER :: eig_id,archiveType
INTEGER :: n,iter,iterHF INTEGER :: n,iter,iterHF
LOGICAL :: l_opti,l_cont,l_qfix,l_wann_inp,l_real LOGICAL :: l_opti,l_cont,l_qfix,l_real
REAL :: fix REAL :: fix
#ifdef CPP_MPI #ifdef CPP_MPI
INCLUDE 'mpif.h' INCLUDE 'mpif.h'
...@@ -124,15 +124,10 @@ CONTAINS ...@@ -124,15 +124,10 @@ CONTAINS
IF (l_opti) CALL optional(mpi,atoms,sphhar,vacuum,dimension,& IF (l_opti) CALL optional(mpi,atoms,sphhar,vacuum,dimension,&
stars,input,sym,cell,sliceplot,obsolete,xcpot,noco,oneD) stars,input,sym,cell,sliceplot,obsolete,xcpot,noco,oneD)
!+Wannier (start)
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 (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') IF(mpi%isize.NE.1) CALL juDFT_error('No Wannier+MPI at the moment',calledby = 'fleur')
CALL wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann) CALL wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
END IF END IF
IF (wann%l_gwf) input%itmax = 1
!-Wannier (end)
iter = 0 iter = 0
iterHF = 0 iterHF = 0
...@@ -335,14 +330,13 @@ CONTAINS ...@@ -335,14 +330,13 @@ CONTAINS
ENDIF ENDIF
!!$ !+Wannier functions !+Wannier functions
!!$ IF ((input%l_wann).AND.(.NOT.wann%l_bs_comf)) THEN IF ((input%l_wann).AND.(.NOT.wann%l_bs_comf)) THEN
!!$ CALL wannier(DIMENSION,mpi,input,kpts,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,& wann,noco,cell,enpara,banddos,sliceplot,vTot,results,&
!!$ eig_idList,(sym%invs).AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco),kpts%nkpt) (/eig_id/),(sym%invs).AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco),kpts%nkpt)
!!$ END IF END IF
!!$ IF (wann%l_gwf) CALL juDFT_error("provide wann_inp if l_gwf=T", calledby = "fleur") !-Wannier
!!$ !-Wannier
! charge density generation ! charge density generation
CALL timestart("generation of new charge density (total)") CALL timestart("generation of new charge density (total)")
......
...@@ -52,7 +52,6 @@ wannier/wann_mmnk_symm.f ...@@ -52,7 +52,6 @@ wannier/wann_mmnk_symm.f
wannier/wann_nabla_pauli_rs.f wannier/wann_nabla_pauli_rs.f
wannier/wann_nabla_rs.f wannier/wann_nabla_rs.f
wannier/wann_nocoplot.F wannier/wann_nocoplot.F
wannier/wann_optional.f
wannier/wann_orbcomp.f wannier/wann_orbcomp.f
#wannier/wann_orbmag.F #wannier/wann_orbmag.F
wannier/wann_pauli_rs.F wannier/wann_pauli_rs.F
...@@ -99,4 +98,5 @@ wannier/bs_comfort.F ...@@ -99,4 +98,5 @@ wannier/bs_comfort.F
set(fleur_F90 ${fleur_F90} set(fleur_F90 ${fleur_F90}
wannier/init_wannier_defaults.f90 wannier/init_wannier_defaults.f90
wannier/wann_read_inp.f90 wannier/wann_read_inp.f90
wannier/wann_optional.f90
) )
...@@ -23,7 +23,7 @@ SUBROUTINE initWannierDefaults(wann) ...@@ -23,7 +23,7 @@ SUBROUTINE initWannierDefaults(wann)
TYPE(t_wann), INTENT(INOUT) :: wann TYPE(t_wann), INTENT(INOUT) :: wann
wann%wan90version = 2 ! Set the standard to Wannier90-1.2 wann%wan90version = 3 ! Set the standard to Wannier90-1.2
wann%oc_num_orbs = 0 wann%oc_num_orbs = 0
! integer,allocatable :: oc_orbs(:) ! integer,allocatable :: oc_orbs(:)
......
!--------------------------------------------------------------------------------
! Copyright (c) 2016 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_wann_optional
use m_juDFT
contains
subroutine wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
c**************************************************
c Make preparations for the calculation of
c Wannier functions.
c Frank Freimuth
c**************************************************
use m_types
use m_wann_read_inp
use m_wann_projgen
use m_wann_kpointgen
use m_wann_w90kpointgen
use m_wann_kptsreduc
use m_wann_kptsreduc2
use m_wann_wan90prep
use m_wann_dipole3
use m_wann_dipole
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
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_wann), INTENT(INOUT) :: wann
integer :: num_wann(2)
logical :: l_nocosoc
l_nocosoc=noco%l_noco.or.noco%l_soc
c-----read the input file to determine what to do
call wann_read_inp(input,.true.,wann)
c-----generate projection-definition-file
if(wann%l_projgen) then
call wann_projgen(
> atoms%ntype,atoms%neq,atoms%nat,atoms%zatom,l_nocosoc,wann)
wann%l_stopopt=.true.
endif
c-----generate k-point-files
if(wann%l_kpointgen) then
call wann_kpointgen()
wann%l_stopopt=.true.
endif
if(wann%l_w90kpointgen) then
call wann_w90kpointgen()
wann%l_stopopt=.true.
endif
c-----find Wannier-irreducible part of BZ
if(wann%l_kptsreduc)then
call wann_kptsreduc(
> sym%nop,sym%mrot,cell%bmat,sym%tau,input%film,
> oneD%odi%d1,l_nocosoc)
wann%l_stopopt=.true.
endif
c-----find Wannier-irreducible part of BZ
if(wann%l_kptsreduc2)then
call wann_kptsreduc2(
> wann%mhp,
> sym%nop,sym%mrot,cell%bmat,sym%tau,input%film,
> oneD%odi%d1,l_nocosoc)
wann%l_stopopt=.true.
endif
c-----generate WF1.win and bkpts
if(wann%l_prepwan90)then
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,
> oneD%odi%d1,wann%l_ms,wann%l_sgwf,wann%l_socgwf,
> wann%aux_latt_const,wann%param_file,wann%l_dim,
> wann%wan90version)
endif
c-----calculate polarization, if not wannierize
c-----if wannierize, then calculate polarization later (after wannierize)
if(wann%l_dipole3.and..not.wann%l_wannierize)then
num_wann(1)=wann%band_max(1)-wann%band_min(1)+1
num_wann(2)=wann%band_max(2)-wann%band_min(2)+1
call wann_dipole3(
> input%jspins,cell%omtil,atoms%nat,atoms%pos,
> cell%amat,cell%bmat,atoms%taual,num_wann,
> atoms%ntype,atoms%neq,atoms%zatom,l_nocosoc)
wann%l_stopopt=.true.
endif
c-----calculate polarization, if not wannierize
c-----if wannierize, then calculate polarization later (after wannierize)
if(wann%l_dipole.and..not.wann%l_wannierize)then
call wann_dipole(
> input%jspins,cell%omtil,atoms%nat,atoms%pos,
> cell%amat,atoms%ntype,atoms%neq,atoms%zatom)
wann%l_stopopt=.true.
endif
IF(wann%l_stopopt) CALL juDFT_end("wann_optional done",1) ! The 1 is temporarily. Should be mpi%irank.
end subroutine wann_optional
end module m_wann_optional
!--------------------------------------------------------------------------------
! Copyright (c) 2016 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_wann_optional
USE m_juDFT
CONTAINS
SUBROUTINE wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
!**************************************************
! Make preparations for the calculation of
! Wannier functions.
! Frank Freimuth
!**************************************************
USE m_types
USE m_wann_read_inp
USE m_wann_projgen
USE m_wann_kpointgen
USE m_wann_w90kpointgen
USE m_wann_kptsreduc
USE m_wann_kptsreduc2
USE m_wann_wan90prep
USE m_wann_dipole3
USE m_wann_dipole
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
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_wann), INTENT(INOUT) :: wann
INTEGER :: num_wann(2)
LOGICAL :: l_nocosoc
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)
!-----generate projection-definition-file
IF(wann%l_projgen) THEN
CALL wann_projgen(atoms%ntype,atoms%neq,atoms%nat,atoms%zatom,l_nocosoc,wann)
wann%l_stopopt=.TRUE.
ENDIF
!-----generate k-point-files
IF(wann%l_kpointgen) THEN
CALL wann_kpointgen()
wann%l_stopopt=.TRUE.
ENDIF
IF(wann%l_w90kpointgen) THEN
CALL wann_w90kpointgen()
wann%l_stopopt=.TRUE.
ENDIF
!-----find Wannier-irreducible part of BZ
IF(wann%l_kptsreduc)THEN
CALL wann_kptsreduc(sym%nop,sym%mrot,cell%bmat,sym%tau,input%film, oneD%odi%d1,l_nocosoc)
wann%l_stopopt=.TRUE.
ENDIF
!-----find Wannier-irreducible part of BZ
IF(wann%l_kptsreduc2)THEN
CALL wann_kptsreduc2(wann%mhp, sym%nop,sym%mrot,cell%bmat,sym%tau,input%film, oneD%odi%d1,l_nocosoc)
wann%l_stopopt=.TRUE.
ENDIF
!-----generate WF1.win and bkpts
IF(wann%l_prepwan90)THEN
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, oneD%odi%d1,&
wann%l_ms,wann%l_sgwf,wann%l_socgwf, wann%aux_latt_const,wann%param_file,wann%l_dim, &
wann%wan90version)
ENDIF
!-----calculate polarization, if not wannierize
!-----if wannierize, then calculate polarization later (after wannierize)
IF(wann%l_dipole3.AND..NOT.wann%l_wannierize)THEN
num_wann(1)=wann%band_max(1)-wann%band_min(1)+1
num_wann(2)=wann%band_max(2)-wann%band_min(2)+1
CALL wann_dipole3(input%jspins,cell%omtil,atoms%nat,atoms%pos, cell%amat,cell%bmat,atoms%taual,&
num_wann, atoms%ntype,atoms%neq,atoms%zatom,l_nocosoc)
wann%l_stopopt=.TRUE.
ENDIF
!-----calculate polarization, if not wannierize
!-----if wannierize, then calculate polarization later (after wannierize)
IF(wann%l_dipole.AND..NOT.wann%l_wannierize)THEN
CALL wann_dipole(input%jspins,cell%omtil,atoms%nat,atoms%pos, cell%amat,atoms%ntype,&
atoms%neq,atoms%zatom)
wann%l_stopopt=.TRUE.
ENDIF
IF(wann%l_stopopt) CALL juDFT_end("wann_optional done",1) ! The 1 is temporarily. Should be mpi%irank.
END SUBROUTINE wann_optional
END MODULE m_wann_optional
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