!--------------------------------------------------------------------------------! 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.!--------------------------------------------------------------------------------

MODULEm_eparas!***********************************************************************! Calculates qlo, enerlo and sqlo, which are needed to determine the ! new energy parameters.! Philipp Kurz 99/04!***********************************************************************! also the 'normal' energy parameters are now included...!! if (l_mcd) then mcd contains mcd spectrum: first index = polarization! second = core level ; third = band index gb.2001! corrected to work also for multiple LO's of same l at the same atom! gb.2005!*************** ABBREVIATIONS *****************************************! qlo : charge density of one local orbital at the current k-point! sqlo : qlo integrated over the Brillouin zone! enerlo : qlo*energy integrated over the Brillouin zone!***********************************************************************!CONTAINS

!---> l-decomposed density for each occupied state!! DO 140 i = (skip_t+1),ne ! this I need for all statesDOi=1,ne! skip in next loopnt1=1DOn=1,atoms%ntypefac=1./atoms%neq(n)nt2=nt1+atoms%neq(n)-1DOl=0,3suma=CMPLX(0.,0.)sumb=CMPLX(0.,0.)ll1=l*(l+1)DOm=-l,llm=ll1+mIF(.NOT.l_mcd)THENDOnatom=nt1,nt2

ENDDOnt1=nt1+atoms%neq(n)ENDDOENDDO!!---> perform Brillouin zone integration and summation over the!---> bands in order to determine the energy parameters for each!---> atom and angular momentum!DOl=0,3DOn=1,atoms%ntypeDOi=(skip_t+1),noccbd

ENDDOENDDOENDDO!---> initialize qloqlo(:,:,:,:)=0.0qaclo(:,:,:)=0.0qbclo(:,:,:)=0.0!---> density for each local orbital and occupied statenatom=0DOntyp=1,atoms%ntypeDOnn=1,atoms%neq(ntyp)natom=natom+1DOlo=1,atoms%nlo(ntyp)l=atoms%llo(lo,ntyp)ll1=l*(l+1)DOm=-l,llm=ll1+mDOi=1,neqbclo(i,lo,ntyp)=qbclo(i,lo,ntyp)+REAL(&