Commit 57b086ad authored by Gregor Michalicek's avatar Gregor Michalicek

Eliminate l_fmpl variable in cdn/cdnval.F90

parent 4588f100
......@@ -44,8 +44,7 @@ CONTAINS
! and bands
!***********************************************************************
USE m_constants
USE m_eig66_io,ONLY: write_dos
USE m_eig66_io
USE m_genMTBasis
USE m_calcDenCoeffs
USE m_mcdinit
......@@ -70,7 +69,6 @@ CONTAINS
USE m_qintsl ! (slabs) and intergate the DOS in these vacuum%layers
USE m_orbcomp ! calculate orbital composition (like p_x,p_y,p_z)
USE m_abcrot2
USE m_eig66_io, ONLY : read_eig
USE m_corespec, only : l_cs ! calculation of core spectra (EELS)
USE m_corespec_io, only : corespec_init
USE m_corespec_eval, only : corespec_gaunt,corespec_rme,corespec_dos,corespec_ddscs
......@@ -118,7 +116,7 @@ CONTAINS
INTEGER :: i,ie,ivac,j,k,l,n,ilo,nbands,noccbd
INTEGER :: skip_t,skip_tt
INTEGER :: nStart,nEnd,nbasfcn
LOGICAL :: l_fmpl,l_evp,l_orbcomprot,l_real, l_write
LOGICAL :: l_evp,l_orbcomprot,l_real, l_write
! ...Local Arrays ..
INTEGER, ALLOCATABLE :: jsym(:),ksym(:)
......@@ -139,10 +137,6 @@ CONTAINS
l_real = sym%invs.AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco)
!---> l_fmpl is meant as a switch to to a plot of the full magnet.
!---> density without the atomic sphere approximation for the magnet.
!---> density. It is not completely implemented (lo's missing).
l_fmpl = .false.
IF (noco%l_mperp) THEN
!---> when the off-diag. part of the desinsity matrix, i.e. m_x and
!---> m_y, is calculated inside the muffin-tins (l_mperp = T), cdnval
......@@ -165,14 +159,16 @@ CONTAINS
CALL usdus%init(atoms,input%jspins)
CALL denCoeffs%init(atoms,sphhar,jsp_start,jsp_end)
CALL denCoeffsOffdiag%init(atoms,noco,sphhar,l_fmpl)
!---> The last entry in denCoeffsOffdiag%init is l_fmpl. It is meant as a switch to a plot of the full magnet.
!---> density without the atomic sphere approximation for the magnet. density. It is not completely implemented (lo's missing).
CALL denCoeffsOffdiag%init(atoms,noco,sphhar,.FALSE.)
CALL force%init1(input,atoms)
CALL orb%init(atoms,noco,jsp_start,jsp_end)
CALL mcd%init1(banddos,dimension,input,atoms)
CALL slab%init(banddos,dimension,atoms,cell)
CALL orbcomp%init(banddos,dimension,atoms)
IF ((l_fmpl).AND.(.not.noco%l_mperp)) CALL juDFT_error("for fmpl set noco%l_mperp = T!" ,calledby ="cdnval")
IF ((denCoeffsOffdiag%l_fmpl).AND.(.not.noco%l_mperp)) CALL juDFT_error("for fmpl set noco%l_mperp = T!" ,calledby ="cdnval")
IF ((banddos%ndir.EQ.-3).AND.banddos%dos.AND.oneD%odi%d1) CALL juDFT_error("layer-resolved feature does not work with 1D",calledby ="cdnval")
! calculation of core spectra (EELS) initializations -start-
......@@ -357,7 +353,7 @@ CONTAINS
IF (noco%l_mperp) THEN
CALL rhomt21(atoms,we,noccbd,eigVecCoeffs,denCoeffsOffdiag)
IF (l_fmpl) CALL rhonmt21(atoms,sphhar,we,noccbd,sym,eigVecCoeffs,denCoeffsOffdiag)
IF (denCoeffsOffdiag%l_fmpl) CALL rhonmt21(atoms,sphhar,we,noccbd,sym,eigVecCoeffs,denCoeffsOffdiag)
END IF
199 CONTINUE
......@@ -379,14 +375,14 @@ CONTAINS
#ifdef CPP_MPI
CALL timestart("cdnval: mpi_col_den")
DO ispin = jsp_start,jsp_end
CALL mpi_col_den(mpi,sphhar,atoms,oneD,stars,vacuum,input,noco,l_fmpl,ispin,regCharges,&
CALL mpi_col_den(mpi,sphhar,atoms,oneD,stars,vacuum,input,noco,ispin,regCharges,&
results,denCoeffs,orb,denCoeffsOffdiag,den,den%mmpMat(:,:,:,jspin))
END DO
CALL timestop("cdnval: mpi_col_den")
#endif
IF (mpi%irank==0) THEN
CALL cdnmt(dimension%jspd,atoms,sphhar,noco,l_fmpl,jsp_start,jsp_end,&
CALL cdnmt(dimension%jspd,atoms,sphhar,noco,jsp_start,jsp_end,&
enpara,vTot%mt(:,0,:,:),denCoeffs,usdus,orb,denCoeffsOffdiag,moments,den%mt)
IF(l_cs) CALL corespec_ddscs(jspin,input%jspins)
......
......@@ -10,7 +10,7 @@ MODULE m_cdnmt
! Philipp Kurz 2000-02-03
!***********************************************************************
CONTAINS
SUBROUTINE cdnmt(jspd,atoms,sphhar,noco,l_fmpl,jsp_start,jsp_end,enpara,&
SUBROUTINE cdnmt(jspd,atoms,sphhar,noco,jsp_start,jsp_end,enpara,&
vr,denCoeffs,usdus,orb,denCoeffsOffdiag,moments,rho)
use m_constants,only: sfp_const
USE m_rhosphnlo
......@@ -28,8 +28,7 @@ CONTAINS
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: jsp_start,jsp_end,jspd
LOGICAL, INTENT (IN) :: l_fmpl
! ..
! .. Array Arguments ..
REAL, INTENT (IN) :: vr(atoms%jmtd,atoms%ntype,jspd)
REAL, INTENT (INOUT) :: rho(:,0:,:,:)!(toms%jmtd,0:sphhar%nlhd,atoms%ntype,jspd)
......@@ -56,7 +55,7 @@ CONTAINS
CALL timestart("cdnmt")
IF (noco%l_mperp) THEN
IF (l_fmpl) THEN
IF (denCoeffsOffdiag%l_fmpl) THEN
ALLOCATE ( rho21(atoms%jmtd,0:sphhar%nlhd,atoms%ntype) )
rho21(:,:,:) = cmplx(0.0,0.0)
ENDIF
......@@ -66,7 +65,7 @@ CONTAINS
!$OMP SHARED(usdus,rho,moments,rho21,qmtl) &
!$OMP SHARED(atoms,jsp_start,jsp_end,enpara,vr,denCoeffs,sphhar)&
!$OMP SHARED(orb,noco,l_fmpl,denCoeffsOffdiag,jspd)&
!$OMP SHARED(orb,noco,denCoeffsOffdiag,jspd)&
!$OMP PRIVATE(itype,na,ispin,l,f,g,nodeu,noded,wronk,i,j,s,qmtllo,qmtt,nd,lh,lp,llp,cs)
IF (noco%l_mperp) THEN
ALLOCATE ( f(atoms%jmtd,2,0:atoms%lmaxd,jspd),g(atoms%jmtd,2,0:atoms%lmaxd,jspd) )
......@@ -176,7 +175,7 @@ CONTAINS
ENDDO
ENDDO
IF (l_fmpl) THEN
IF (denCoeffsOffdiag%l_fmpl) THEN
!---> the following part can be used to calculate the full magnet.
!---> density without the atomic sphere approximation for the
!---> magnet. density, e.g. for plotting.
......@@ -210,7 +209,7 @@ CONTAINS
ENDDO
ENDDO
ENDIF ! l_fmpl
ENDIF ! denCoeffsOffdiag%l_fmpl
ENDIF ! noco%l_mperp
ENDDO ! end of loop over atom types
......@@ -244,7 +243,7 @@ CONTAINS
!---> for testing: to plot the offdiag. part of the density matrix it
!---> is written to the file rhomt21. This file can read in pldngen.
IF (l_fmpl) THEN
IF (denCoeffsOffdiag%l_fmpl) THEN
OPEN (26,file='rhomt21',form='unformatted',status='unknown')
WRITE (26) rho21
CLOSE (26)
......
......@@ -9,9 +9,8 @@ MODULE m_mpi_col_den
! collect all data calculated in cdnval on different pe's on pe 0
!
CONTAINS
SUBROUTINE mpi_col_den(mpi,sphhar,atoms,oneD,stars,vacuum,&
input, noco,l_fmpl,jspin,regCharges,&
results,denCoeffs,orb,denCoeffsOffdiag,den,n_mmp)
SUBROUTINE mpi_col_den(mpi,sphhar,atoms,oneD,stars,vacuum,input,noco,jspin,regCharges,&
results,denCoeffs,orb,denCoeffsOffdiag,den,n_mmp)
#include"cpp_double.h"
USE m_types
......@@ -32,7 +31,6 @@ CONTAINS
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: jspin
LOGICAL, INTENT (IN) :: l_fmpl
! ..
! .. Array Arguments ..
COMPLEX,INTENT(INOUT) :: n_mmp(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,atoms%n_u)
......@@ -402,7 +400,7 @@ CONTAINS
ENDIF
DEALLOCATE (c_b)
IF (l_fmpl) THEN
IF (denCoeffsOffdiag%l_fmpl) THEN
!
!--> Full magnetization plots: Collect uunmt21, etc.
!
......
......@@ -61,6 +61,8 @@ PRIVATE
END TYPE t_denCoeffs
TYPE t_denCoeffsOffdiag
LOGICAL :: l_fmpl
! spherical
COMPLEX, ALLOCATABLE :: uu21(:,:)
COMPLEX, ALLOCATABLE :: dd21(:,:)
......@@ -348,6 +350,8 @@ SUBROUTINE denCoeffsOffdiag_init(thisDenCoeffsOffdiag, atoms, noco, sphhar, l_fm
TYPE(t_sphhar), INTENT(IN) :: sphhar
LOGICAL, INTENT(IN) :: l_fmpl
thisDenCoeffsOffdiag%l_fmpl = l_fmpl
IF (noco%l_mperp) THEN
ALLOCATE (thisDenCoeffsOffdiag%uu21(0:atoms%lmaxd,atoms%ntype))
ALLOCATE (thisDenCoeffsOffdiag%ud21(0:atoms%lmaxd,atoms%ntype))
......
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