Commit c87d1aa3 authored by Henning Janssen's avatar Henning Janssen

Only allocate arrays for tetrahedron weights if needed (this time with the right dimension)

parent bfce7caa
......@@ -84,7 +84,7 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
TYPE(t_slab), OPTIONAL, INTENT(INOUT) :: slab
TYPE(t_orbcomp), OPTIONAL, INTENT(INOUT) :: orbcomp
TYPE(t_greensfCoeffs), OPTIONAL, INTENT(INOUT) :: greensfCoeffs
REAL, OPTIONAL, INTENT(IN) :: angle(sym%nop)
REAL, OPTIONAL, INTENT(IN) :: angle(:)
! Scalar Arguments
INTEGER, INTENT(IN) :: eig_id, jspin
......@@ -134,13 +134,10 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
jsp_start = jspin
jsp_end = jspin
END IF
ALLOCATE (f(atoms%jmtd,2,0:atoms%lmaxd,jsp_start:jsp_end)) ! Deallocation before mpi_col_den
ALLOCATE (g(atoms%jmtd,2,0:atoms%lmaxd,jsp_start:jsp_end))
ALLOCATE (flo(atoms%jmtd,2,atoms%nlod,input%jspins))
ALLOCATE(dosWeights(greensfCoeffs%ne,dimension%neigd))
ALLOCATE(dosBound(dimension%neigd,2))
ALLOCATE(resWeights(greensfCoeffs%ne,dimension%neigd))
! Initializations
CALL usdus%init(atoms,input%jspins)
......@@ -233,6 +230,9 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
CALL eigVecCoeffs%init(input,DIMENSION,atoms,noco,jspin,noccbd)
IF (atoms%n_gf.GT.0.AND.(input%tria.OR.input%gfTet)) THEN
CALL timestart("TetrahedronWeights")
ALLOCATE(dosWeights(greensfCoeffs%ne,noccbd))
ALLOCATE(dosBound(noccbd,2))
ALLOCATE(resWeights(greensfCoeffs%ne,noccbd))
CALL tetrahedronInit(ikpt,kpts,input,noccbd,results%eig(ev_list,:,jsp),&
greensfCoeffs,results%ef,resWeights,dosWeights,dosBound)
CALL timestop("TetrahedronWeights")
......@@ -274,6 +274,7 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
IF(l_coreSpec) CALL corespec_dos(atoms,usdus,ispin,dimension%lmd,kpts%nkpt,ikpt,dimension%neigd,&
noccbd,results%ef,banddos%sig_dos,eig,we,eigVecCoeffs)
END DO ! end loop over ispin
IF (atoms%n_gf.GT.0.AND.(input%tria.OR.input%gfTet)) DEALLOCATE(dosWeights,resWeights,dosBound)
IF (noco%l_mperp) CALL denCoeffsOffdiag%calcCoefficients(atoms,sphhar,sym,eigVecCoeffs,we,noccbd)
IF ((banddos%dos.OR.banddos%vacdos.OR.input%cdinf).AND.(banddos%ndir.GT.0)) THEN
......
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