Commit e7813772 authored by Gregor Michalicek's avatar Gregor Michalicek

Eliminate ncored in cdn/cdnval.F90, move qstars to t_regionCharges type

parent e82adc28
......@@ -120,7 +120,7 @@ CONTAINS
INTEGER :: llpd,ikpt,jsp_start,jsp_end,ispin
INTEGER :: i,ie,iv,ivac,j,k,l,n,ilo,isp,nbands,noccbd,nslibd,na
INTEGER :: skip_t,skip_tt, nkpt_extended
INTEGER :: n_size,i_rec,n_rank ,ncored,n_start,n_end,noccbd_l,nbasfcn
INTEGER :: n_size,i_rec,n_rank,n_start,n_end,noccbd_l,nbasfcn
LOGICAL :: l_fmpl,l_evp,l_orbcomprot,l_real, l_write
! ...Local Arrays ..
INTEGER :: n_bands(0:dimension%neigd)
......@@ -131,7 +131,6 @@ CONTAINS
INTEGER, ALLOCATABLE :: jsym(:),ksym(:)
REAL, ALLOCATABLE :: we(:)
REAL, ALLOCATABLE :: f(:,:,:,:),g(:,:,:,:),flo(:,:,:,:) ! radial functions
COMPLEX, ALLOCATABLE :: qstars(:,:,:,:)
TYPE (t_lapw) :: lapw
TYPE (t_orb) :: orb
......@@ -169,7 +168,6 @@ CONTAINS
ALLOCATE ( flo(atoms%jmtd,2,atoms%nlod,dimension%jspd) )
ALLOCATE ( jsym(dimension%neigd),ksym(dimension%neigd) )
ALLOCATE ( gvac1d(dimension%nv2d),gvac2d(dimension%nv2d) )
ALLOCATE ( qstars(vacuum%nstars,dimension%neigd,vacuum%layerd,2) )
! --> Initializations
......@@ -205,7 +203,6 @@ CONTAINS
IF (noco%l_soc.OR.noco%l_noco) skip_tt = 2 * skip_tt
na = 1
ncored = 0
l_write = input%cdinf.AND.mpi%irank==0
......@@ -224,10 +221,7 @@ CONTAINS
END DO
END IF
IF (banddos%l_mcd) THEN
CALL mcd_init(atoms,input,dimension,vTot%mt(:,0,:,:),g,f,mcd,n,jspin)
ncored = max(mcd%ncore(n),ncored)
END IF
IF (banddos%l_mcd) CALL mcd_init(atoms,input,dimension,vTot%mt(:,0,:,:),g,f,mcd,n,jspin)
IF(l_cs) CALL corespec_rme(atoms,input,n,dimension%nstd,&
input%jspins,jspin,results%ef,&
......@@ -443,7 +437,7 @@ CONTAINS
CALL timestart("cdnval: vacden")
CALL vacden(vacuum,dimension,stars,oneD, kpts,input, cell,atoms,noco,banddos,&
gvac1d,gvac2d, we,ikpt,jspin,vTot%vacz(:,:,jspin),noccbd,lapw,enpara%evac0,eig,&
den,regCharges%qvac,regCharges%qvlay,qstars,zMat)
den,regCharges%qvac,regCharges%qvlay,regCharges%qstars,zMat)
CALL timestop("cdnval: vacden")
END IF
!---> perform Brillouin zone integration and summation over the
......@@ -565,7 +559,7 @@ CONTAINS
!--dw now write k-point data to tmp_dos
CALL write_dos(eig_id,ikpt,jspin,regCharges%qal(:,:,:,jspin),regCharges%qvac(:,:,ikpt,jspin),regCharges%qis(:,ikpt,jspin),&
regCharges%qvlay(:,:,:,ikpt,jspin),qstars,ksym,jsym,mcd%mcd,slab%qintsl,&
regCharges%qvlay(:,:,:,ikpt,jspin),regCharges%qstars,ksym,jsym,mcd%mcd,slab%qintsl,&
slab%qmtsl(:,:),qmtp(:,:),orbcomp)
CALL timestop("cdnval: write_info")
......@@ -600,7 +594,7 @@ CONTAINS
CALL timestart("cdnval: dos")
IF (mpi%irank==0) THEN
CALL doswrite(eig_id,dimension,kpts,atoms,vacuum,input,banddos,&
sliceplot,noco,sym,cell,mcd,ncored,results,slab%nsld,oneD)
sliceplot,noco,sym,cell,mcd,results,slab%nsld,oneD)
IF (banddos%dos.AND.(banddos%ndir.EQ.-3)) THEN
CALL Ek_write_sl(eig_id,dimension,kpts,atoms,vacuum,input,jspin,sym,cell,slab)
END IF
......
......@@ -12,7 +12,7 @@ MODULE m_doswrite
!
CONTAINS
SUBROUTINE doswrite(eig_id,DIMENSION,kpts,atoms,vacuum,input,banddos,&
sliceplot,noco,sym,cell,mcd,ncored,results,nsld,oneD)
sliceplot,noco,sym,cell,mcd,results,nsld,oneD)
USE m_eig66_io,ONLY:read_dos,read_eig
USE m_evaldos
USE m_cdninf
......@@ -35,8 +35,7 @@ CONTAINS
! .. Scalar Arguments ..
INTEGER,PARAMETER :: n2max=13
INTEGER, INTENT (IN) :: nsld,eig_id
INTEGER, INTENT (IN) :: ncored
INTEGER, INTENT (IN) :: nsld,eig_id
! locals
INTEGER :: jsym(DIMENSION%neigd),ksym(DIMENSION%neigd)
......@@ -119,7 +118,7 @@ CONTAINS
IF (banddos%dos.AND.(banddos%ndir.LT.0)) THEN
CALL evaldos(eig_id,input,banddos,vacuum,kpts,atoms,sym,noco,oneD,cell,&
DIMENSION,results%ef,results%bandgap,&
banddos%l_mcd,ncored,mcd%ncore,mcd%e_mcd,nsld)
banddos%l_mcd,mcd%ncore,mcd%e_mcd,nsld)
ENDIF
!
! Now write to vacwave if nstm=3
......
MODULE m_evaldos
CONTAINS
SUBROUTINE evaldos(eig_id,input,banddos,vacuum,kpts,atoms,sym,noco,oneD,cell,&
dimension,efermiarg,bandgap,l_mcd,ncored,ncore,e_mcd,nsld)
dimension,efermiarg,bandgap,l_mcd,ncore,e_mcd,nsld)
!----------------------------------------------------------------------
!
! vk: k-vectors
......@@ -42,19 +42,18 @@
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_atoms),INTENT(IN) :: atoms
INTEGER, INTENT(IN) :: ncored
INTEGER, INTENT(IN) :: nsld
REAL, INTENT(IN) :: efermiarg, bandgap
LOGICAL, INTENT(IN) :: l_mcd
INTEGER, INTENT(IN) :: ncore(:)!(ntype)
REAL, INTENT(IN) :: e_mcd(atoms%ntype,input%jspins,ncored)
INTEGER, INTENT(IN) :: ncore(atoms%ntype)!(ntype)
REAL, INTENT(IN) :: e_mcd(atoms%ntype,input%jspins,dimension%nstd)
!-odim
!+odim
! locals
INTEGER, PARAMETER :: lmax= 4, ned = 1301
INTEGER i,s,v,index,jspin,k,l,l1,l2,ln,n,nl,ntb,ntria,ntetra
INTEGER icore,qdim,n_orb
INTEGER icore,qdim,n_orb,ncored
REAL as,de,efermi,emax,emin,qmt,sigma,totdos,efermiPrev
REAL e_up,e_lo,e_test1,e_test2,fac,sumwei,dk,eFermiCorrection
LOGICAL l_tria,l_orbcomp,l_error
......@@ -72,7 +71,8 @@
CHARACTER(len=8) :: chntype*2,chform*19
DATA spin12/'.1' , '.2'/
DATA ch_mcd/'.+' , '.-' , '.0'/
!
ncored = MAX(0,MAXVAL(ncore))
qdim = lmax*atoms%ntype+3
l_orbcomp = banddos%l_orb
IF (banddos%ndir.EQ.-3) THEN
......
......@@ -169,6 +169,7 @@ PRIVATE
REAL, ALLOCATABLE :: svac(:,:)
REAL, ALLOCATABLE :: pvac(:,:)
REAL, ALLOCATABLE :: qvlay(:,:,:,:,:)
COMPLEX, ALLOCATABLE :: qstars(:,:,:,:)
CONTAINS
PROCEDURE,PASS :: init => regionCharges_init
......@@ -638,6 +639,7 @@ SUBROUTINE regionCharges_init(thisRegCharges,input,atoms,dimension,kpts,vacuum)
ALLOCATE(thisRegCharges%svac(2,input%jspins))
ALLOCATE(thisRegCharges%pvac(2,input%jspins))
ALLOCATE(thisRegCharges%qvlay(dimension%neigd,vacuum%layerd,2,kpts%nkpt,input%jspins))
ALLOCATE(thisRegCharges%qstars(vacuum%nstars,dimension%neigd,vacuum%layerd,2))
thisRegCharges%qis = 0.0
......@@ -652,6 +654,7 @@ SUBROUTINE regionCharges_init(thisRegCharges,input,atoms,dimension,kpts,vacuum)
thisRegCharges%svac = 0.0
thisRegCharges%pvac = 0.0
thisRegCharges%qvlay = 0.0
thisRegCharges%qstars = CMPLX(0.0,0.0)
END SUBROUTINE regionCharges_init
......
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