Commit afeb068f authored by Gregor Michalicek's avatar Gregor Michalicek

Added missing initializations of t_zmat instances in the Wannier code

parent 8c19f98c
......@@ -801,7 +801,7 @@ c.. now we want to define the maximum number of the bands by all kpts
if(l_p0)then
call wann_maxbnd(
> eig_id,
> eig_id,l_real,
> lmaxd,ntypd,nlod,neigd,nvd,wannierspin,
> isize,jspin,nbasfcn,nlotot,
> l_ss,l_noco,nrec,fullnkpts,
......@@ -958,6 +958,15 @@ c if (mod(i_rec-1,isize).eq.irank) then
call cpu_time(t0)
! get current bkpt vector
zzMat%l_real = l_real
zzMat%nbasfcn = nbasfcn
zzMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zzMat%z_r(zzMat%nbasfcn,zzMat%nbands))
ELSE
ALLOCATE (zzMat%z_c(zzMat%nbasfcn,zzMat%nbands))
END IF
CALL cdn_read(
> eig_id,
> nvd,jspd,irank,isize,kptibz,jspin,nbasfcn, !wannierspin instead of jspd?
......
......@@ -780,7 +780,7 @@ c.. now we want to define the maximum number of the bands by all kpts
if(l_p0)then
call wann_maxbnd(
> eig_id,
> eig_id,l_real,
> lmaxd,ntypd,nlod,neigd,nvd,wannierspin,
> isize,jspin,nbasfcn,nlotot,
> l_ss,l_noco,nrec,fullnkpts,
......@@ -930,6 +930,16 @@ c if (mod(i_rec-1,isize).eq.irank) then
call cpu_time(t0)
! get current bkpt vector
zzMat%l_real = l_real
zzMat%nbasfcn = nbasfcn
zzMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zzMat%z_r(zzMat%nbasfcn,zzMat%nbands))
ELSE
ALLOCATE (zzMat%z_c(zzMat%nbasfcn,zzMat%nbands))
END IF
CALL cdn_read(
> eig_id,
> nvd,jspd,irank,isize,kptibz,jspin,nbasfcn, !wannierspin instead of jspd?
......
......@@ -5,7 +5,7 @@ c determine maximum of number of bands
c****************************************************************
CONTAINS
SUBROUTINE wann_maxbnd(
> eig_id,
> eig_id,l_real,
> lmaxd,ntypd,nlod,neigd,nvd,jspd,
> isize,jspin,nbasfcn,nlotot,
> l_ss,l_noco,nrec,fullnkpts,
......@@ -20,7 +20,7 @@ c****************************************************************
IMPLICIT NONE
integer,intent(in) :: lmaxd,ntypd,nlod,neigd,nvd,jspd,eig_id
integer,intent(in) :: isize,jspin,nbasfcn,nlotot,iqpt
logical,intent(in) :: l_ss,l_noco,l_gwf
logical,intent(in) :: l_ss,l_noco,l_gwf,l_real
integer,intent(in) :: nrec,fullnkpts
logical,intent(in) :: l_byindex,l_bynumber,l_byenergy
integer,intent(in) :: irreduc(fullnkpts)
......@@ -45,6 +45,15 @@ c****************************************************************
TYPE(t_zmat) :: zMat
zMat%l_real = l_real
zMat%nbasfcn = nbasfcn
zMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zMat%z_r(zMat%nbasfcn,zMat%nbands))
ELSE
ALLOCATE (zMat%z_c(zMat%nbasfcn,zMat%nbands))
END IF
n_start=1
n_end=neigd
......
......@@ -14,7 +14,7 @@ c******************************************************************
CONTAINS
SUBROUTINE wann_plot_um_dat(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,
> lapw,oneD,noco,cell,eig_id,
> lapw,oneD,noco,cell,eig_id,l_real,
> mpi_comm,sortrule,band_min,band_max,l_soc,
> l_dulo,l_noco,l_ss,lmaxd,
> ntypd,
......@@ -72,7 +72,7 @@ c******************************************************************
TYPE(t_cell),INTENT(IN) :: cell
integer, intent (in) :: band_min(2),band_max(2),mpi_comm,eig_id
logical, intent (in) :: l_soc
logical, intent (in) :: l_soc,l_real
logical, intent (in) :: invs,invs2,film,slice,symor
integer, intent (in) :: lmaxd,ntypd,neigd,nkptd,kk,nnne
integer, intent (in) :: natd,nop,nvd,jspd,nbasfcn,nq2,nop2
......@@ -538,7 +538,14 @@ c******************************************************************
allocate (we(neigd),eigg(neigd))
zzMat%l_real = l_real
zzMat%nbasfcn = nbasfcn
zzMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zzMat%z_r(zzMat%nbasfcn,zzMat%nbands))
ELSE
ALLOCATE (zzMat%z_c(zzMat%nbasfcn,zzMat%nbands))
END IF
call wann_read_eig(
> eig_id,
......
......@@ -16,7 +16,7 @@ c******************************************************************
CONTAINS
SUBROUTINE wann_plotw90(
> mpi,stars,vacuum,atoms,sphhar,input,sym,cell,lapw,noco,oneD,
> eig_id,
> eig_id,l_real,
> bandswitch,band_min,band_max,num_bands,
> num_wann,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype,
......@@ -59,7 +59,7 @@ c******************************************************************
integer,intent(in) :: band_min
integer,intent(in) :: band_max
integer, intent (in) :: num_wann
logical, intent (in) :: invs,invs2,film,slice,symor
logical, intent (in) :: invs,invs2,film,slice,symor,l_real
integer, intent (in) :: lmaxd,ntypd,neigd,nkptd,kk,nnne,eig_id
integer, intent (in) :: natd,nop,nvd,jspd,nbasfcn,nq2,nop2
integer, intent (in) :: llod,nlod,ntype,nwdd,n3d,n2d
......@@ -480,6 +480,15 @@ c na = na + neq(n)
n_start=1
n_end=neigd
zzMat%l_real = l_real
zzMat%nbasfcn = nbasfcn
zzMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zzMat%z_r(zzMat%nbasfcn,zzMat%nbands))
ELSE
ALLOCATE (zzMat%z_c(zzMat%nbasfcn,zzMat%nbands))
END IF
CALL cdn_read(
> eig_id,
> nvd,jspd,irank,isize,kptibz,jspin,nbasfcn,
......
......@@ -8,7 +8,7 @@
contains
subroutine wann_postproc(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,
> lapw,oneD,noco,cell,eig_id,
> lapw,oneD,noco,cell,eig_id,l_real,
> mpi_comm,wann,l_p0,film,jspins,n2d,
> natd,pos,amat,bmat,ntype,neq,zatom,
> omtil,l_soc,l_noco,neigd,fullnkpts,
......@@ -81,7 +81,7 @@ c***********************************************
type(t_wann), intent(in) :: wann
logical, intent(in) :: l_p0
logical, intent(in) :: film
logical, intent(in) :: film, l_real
integer, intent(in) :: jspins,n2d,mpi_comm, eig_id
integer, intent(in) :: natd
real, intent(in) :: pos(3,natd)
......@@ -445,7 +445,7 @@ c > volint,symor,pos,ef,wann%l_bzsym,irecl)
if(wann%l_plot_umdat)then
call wann_plot_um_dat(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,
> lapw,oneD,noco,cell,eig_id,
> lapw,oneD,noco,cell,eig_id,l_real,
> mpi_comm,i,wann%band_min,wann%band_max,l_soc,
> l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,nbasfcn,llod,nlod,ntype,
......@@ -464,7 +464,7 @@ c > volint,symor,pos,ef,wann%l_bzsym,irecl)
call cpu_time(delta2)
if(wann%l_lapw.and.l_p0)then
call wannier_to_lapw(
> mpi_comm,eig_id,
> mpi_comm,eig_id,l_real,
> input,lapw,oneD,noco,sym,cell,atoms,stars,vacuum,sphhar,
> l_soc,wann%unigrid,i,wann%band_min,wann%band_max,
> l_dulo,l_noco,l_ss,lmaxd,ntypd,
......
......@@ -15,7 +15,7 @@ c Frank Freimuth, October 2006
c****************************************************************
CONTAINS
SUBROUTINE wann_write_eig(
> eig_id,
> eig_id,l_real,
> lmaxd,ntypd,nlod,neigd,nvd,jspd,
> isize,jspin,nbasfcn,nlotot,
> l_ss,l_noco,nrec,fullnkpts,
......@@ -31,7 +31,7 @@ c****************************************************************
integer,intent(in) :: eig_id
integer,intent(in) :: lmaxd,ntypd,nlod,neigd,nvd,jspd
integer,intent(in) :: isize,jspin,nbasfcn,nlotot
logical,intent(in) :: l_ss,l_noco
logical,intent(in) :: l_ss,l_noco,l_real
integer,intent(in) :: nrec,fullnkpts
logical,intent(in) :: l_byindex,l_bynumber,l_byenergy
......@@ -70,7 +70,16 @@ c****************************************************************
! END QPOINTS
real,parameter :: hartree=27.21138505
TYPE(t_zmat) :: zmat !z(nbasfcn,noccbd) !can be real/complex
TYPE(t_zmat) :: zMat !z(nbasfcn,noccbd) !can be real/complex
zMat%l_real = l_real
zMat%nbasfcn = nbasfcn
zMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zMat%z_r(zMat%nbasfcn,zMat%nbands))
ELSE
ALLOCATE (zMat%z_c(zMat%nbasfcn,zMat%nbands))
END IF
! WRITE(*,*)'min',band_min,'max',band_max,'num',numbands
! WRITE(*,*)'wann_rw_eig: neigd',neigd
......@@ -225,7 +234,7 @@ c*****************************************************************
REAL, INTENT (OUT) :: ello(nlod,ntypd,jspd),evdu(2,jspd)
REAL, INTENT (OUT) :: epar(0:lmaxd,ntypd,jspd)
TYPE(t_zmat), INTENT (INOUT) :: zmat !z(nbasfcn,noccbd) !can be real/complex
TYPE(t_zMat), INTENT (INOUT) :: zMat !z(nbasfcn,noccbd) !can be real/complex
integer :: n_start,n_end
......
......@@ -10,7 +10,7 @@
SUBROUTINE wann_updown(
> mpi,input,sym,atoms,stars,vacuum,sphhar,oneD,noco,cell,
> enpara,
> eig_id,mpi_comm,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> eig_id,l_real,mpi_comm,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,
> invsat,invsatnr,nkpt,taual,rmt,amat,bmat,bbmat,alph,
......@@ -85,7 +85,7 @@ c****************************************************************************
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_enpara),INTENT(IN) :: enpara
logical, intent (in) :: invs,invs2,film,slice,symor
logical, intent (in) :: invs,invs2,film,slice,symor,l_real
integer, intent (in) :: lmaxd,ntypd,neigd,nkptd,kk,nnne,mpi_comm
integer, intent (in) :: natd,nop,nvd,jspd,nbasfcn,nq2,nop2,eig_id
integer, intent (in) :: llod,nlod,ntype,n3d,n2d
......@@ -463,7 +463,7 @@ c..writing down the eig.1 and/or eig.2 files
c*************************************************************
if(l_p0)then
call wann_write_eig(
> eig_id,
> eig_id,l_real,
> lmaxd,ntypd,nlod,neigd,nvd,wannierspin,
> isize,jspin,nbasfcn,nlotot,
> l_ss,l_noco,nrec,fullnkpts,
......@@ -725,6 +725,17 @@ c****************************************************************
n_start=1
n_end=neigd
zzMat(jspin)%l_real = l_real
zzMat(jspin)%nbasfcn = nbasfcn
zzMat(jspin)%nbands = neigd
IF(l_real) THEN
ALLOCATE (zzMat(jspin)%z_r(zzMat(jspin)%nbasfcn,
+ zzMat(jspin)%nbands))
ELSE
ALLOCATE (zzMat(jspin)%z_c(zzMat(jspin)%nbasfcn,
+ zzMat(jspin)%nbands))
END IF
CALL cdn_read(
> eig_id,
> nvd,jspd,irank,isize,kptibz,jspin,nbasfcn,
......
......@@ -403,7 +403,7 @@ c-----input file for orbital decomposition
if(wann%l_updown)then
call wann_updown(
> mpi,input,sym,atoms,stars,vacuum,sphhar,oneD,noco,cell,
> enpara,eig_idList(1),
> enpara,eig_idList(1),l_real,
> mpi%mpi_comm,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,
......@@ -984,7 +984,7 @@ c..write individual files if multi-spiral mode wann%l_ms=T
c*************************************************************
if(l_p0)then
call wann_write_eig(
> eig_id,
> eig_id,l_real,
> atoms%lmaxd,atoms%ntype,atoms%nlod,DIMENSION%neigd,
> DIMENSION%nvd,wannierspin,
> mpi%isize,jspin,DIMENSION%nbasfcn,nlotot,
......@@ -1260,6 +1260,15 @@ c****************************************************************
! stored in the eig file on unit 66. the lattice respectively
! plane-wave vectors G(k,q) are saved in (k1,k2,k3).
zzMat%l_real = l_real
zzMat%nbasfcn = DIMENSION%nbasfcn
zzMat%nbands = DIMENSION%neigd
IF(l_real) THEN
ALLOCATE (zzMat%z_r(zzMat%nbasfcn,zzMat%nbands))
ELSE
ALLOCATE (zzMat%z_c(zzMat%nbasfcn,zzMat%nbands))
END IF
CALL cdn_read(
> eig_id,
> DIMENSION%nvd,DIMENSION%jspd,mpi%irank,mpi%isize, !wannierspin instead of DIMENSION%jspd?
......@@ -2835,7 +2844,7 @@ c************************************************c
call wann_postproc(
> DIMENSION,stars,vacuum,atoms,sphhar,input,sym,mpi,
> lapw,oneD,noco,cell,eig_id, !eig_id is used here after closing the files?!
> lapw,oneD,noco,cell,eig_id,l_real, !eig_id is used here after closing the files?!
> mpi%mpi_comm,wann,l_p0,input%film,input%jspins,stars%ng2,
> atoms%nat,atoms%pos,cell%amat,cell%bmat,atoms%ntype,
> atoms%neq,atoms%zatom,cell%omtil,noco%l_soc,noco%l_noco,
......
......@@ -16,7 +16,7 @@ c******************************************************************
use m_juDFT
contains
subroutine wannier_to_lapw(
> mpi_comm,eig_id,
> mpi_comm,eig_id,l_real,
> input,lapw,oneD,noco,sym,cell,atoms,stars,vacuum,sphhar,
> l_soc,unigrid,sortrule,band_min,band_max,
> l_dulo,l_noco,l_ss,lmaxd,ntypd,
......@@ -64,7 +64,7 @@ c******************************************************************
integer cpu_index
integer stt(MPI_STATUS_SIZE)
#endif
logical,intent(in):: l_soc
logical,intent(in):: l_soc, l_real
integer,intent(in)::unigrid(4),mpi_comm,eig_id
integer,intent(in)::band_min(2),band_max(2)
logical, intent (in) :: invs,invs2,film,slice,symor
......@@ -463,7 +463,14 @@ c******************************************************************
allocate (we(neigd),eigg(neigd))
zzMat%l_real = l_real
zzMat%nbasfcn = nbasfcn
zzMat%nbands = neigd
IF(l_real) THEN
ALLOCATE (zzMat%z_r(zzMat%nbasfcn,zzMat%nbands))
ELSE
ALLOCATE (zzMat%z_c(zzMat%nbasfcn,zzMat%nbands))
END IF
call wann_read_eig(
> eig_id,
......
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