Commit aca28d06 authored by Gustav Bihlmayer's avatar Gustav Bihlmayer

Introduced logical l_st in cdnovlp.F90 to discriminate between calls

from stden (t) and cdngen (f) to allow calculating starting densities
for atoms without core states.
parent 06ef693a
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
SUBROUTINE cdnovlp(mpi,& SUBROUTINE cdnovlp(mpi,&
& sphhar,stars,atoms,sym,& & sphhar,stars,atoms,sym,&
& DIMENSION,vacuum,cell,& & DIMENSION,vacuum,cell,&
& input,oneD,& & input,oneD,l_st,&
& jspin,rh,& & jspin,rh,&
& qpw,rhtxy,rho,rht) & qpw,rhtxy,rho,rht)
!***************************************************************** !*****************************************************************
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
! .. Scalar Arguments .. ! .. Scalar Arguments ..
INTEGER,INTENT (IN) :: jspin INTEGER,INTENT (IN) :: jspin
LOGICAL,INTENT (IN) :: l_st
! .. ! ..
! .. Array Arguments .. ! .. Array Arguments ..
COMPLEX,INTENT (INOUT) :: qpw(stars%n3d,DIMENSION%jspd) COMPLEX,INTENT (INOUT) :: qpw(stars%n3d,DIMENSION%jspd)
...@@ -170,7 +171,7 @@ ...@@ -170,7 +171,7 @@
! (2) cut_off core tails from noise ! (2) cut_off core tails from noise
! !
nloop: DO n = 1 , atoms%ntype nloop: DO n = 1 , atoms%ntype
IF (atoms%ncst(n).GT.0) THEN IF ((atoms%ncst(n).GT.0).OR.l_st) THEN
DO j = 1 , atoms%jri(n) DO j = 1 , atoms%jri(n)
rat(j,n) = atoms%rmsh(j,n) rat(j,n) = atoms%rmsh(j,n)
ENDDO ENDDO
...@@ -198,7 +199,7 @@ ...@@ -198,7 +199,7 @@
! IF mshc = jri either core tail too small or no core (i.e. H) ! IF mshc = jri either core tail too small or no core (i.e. H)
! !
DO n = 1,atoms%ntype DO n = 1,atoms%ntype
IF ((mshc(n).GT.atoms%jri(n)).AND.(atoms%ncst(n).GT.0)) THEN IF ((mshc(n).GT.atoms%jri(n)).AND.((atoms%ncst(n).GT.0).OR.l_st)) THEN
j1 = atoms%jri(n) - 1 j1 = atoms%jri(n) - 1
IF ( method1 .EQ. 1) THEN IF ( method1 .EQ. 1) THEN
...@@ -600,7 +601,7 @@ ...@@ -600,7 +601,7 @@
! they are contained in the plane wave part ! they are contained in the plane wave part
! !
DO n = 1,atoms%ntype DO n = 1,atoms%ntype
IF ((mshc(n).GT.atoms%jri(n)).AND.(atoms%ncst(n).GT.0)) THEN IF ((mshc(n).GT.atoms%jri(n)).AND.((atoms%ncst(n).GT.0).OR.l_st)) THEN
DO j = 1,atoms%jri(n) DO j = 1,atoms%jri(n)
rho(j,0,n,jspin) = rho(j,0,n,jspin)& rho(j,0,n,jspin) = rho(j,0,n,jspin)&
& - sfp_const*rat(j,n)*rat(j,n)*rh(j,n) & - sfp_const*rat(j,n)*rat(j,n)*rh(j,n)
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
REAL slmom,slxmom,slymom,sum,thetai,phii REAL slmom,slxmom,slymom,sum,thetai,phii
INTEGER iter,ivac,j,jspin,jspmax,k,n,nt,ieig,ikpt INTEGER iter,ivac,j,jspin,jspmax,k,n,nt,ieig,ikpt
INTEGER ityp,ilayer,urec,itype,iatom INTEGER ityp,ilayer,urec,itype,iatom
LOGICAL l_relax_any,exst,n_exist LOGICAL l_relax_any,exst,n_exist,l_st
TYPE(t_noco)::noco_new TYPE(t_noco)::noco_new
! .. ! ..
! .. Local Arrays .. ! .. Local Arrays ..
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
!---> pk non-collinear !---> pk non-collinear
LOGICAL l_enpara LOGICAL l_enpara
PARAMETER (l_st=.false.)
IF (mpi%irank.EQ.0) WRITE (2,8005) IF (mpi%irank.EQ.0) WRITE (2,8005)
8005 FORMAT ('CHARGE DENSITY PART (cdngen):') 8005 FORMAT ('CHARGE DENSITY PART (cdngen):')
...@@ -235,7 +236,7 @@ enddo ...@@ -235,7 +236,7 @@ enddo
!---> pk non-collinear !---> pk non-collinear
ELSEIF (input%ctail) THEN ELSEIF (input%ctail) THEN
CALL cdnovlp(mpi,& CALL cdnovlp(mpi,&
sphhar,stars,atoms,sym, dimension,vacuum, cell, input,oneD, jspin,rh, qpw,rhtxy,rho,rht) sphhar,stars,atoms,sym, dimension,vacuum, cell, input,oneD,l_st, jspin,rh, qpw,rhtxy,rho,rht)
ELSEIF (mpi%irank.EQ.0) THEN ELSEIF (mpi%irank.EQ.0) THEN
DO ityp = 1,atoms%ntype DO ityp = 1,atoms%ntype
qpw(1,jspin) = qpw(1,jspin) + qint(ityp,jspin)/input%jspins/cell%volint qpw(1,jspin) = qpw(1,jspin) + qint(ityp,jspin)/input%jspins/cell%volint
...@@ -295,7 +296,7 @@ enddo ...@@ -295,7 +296,7 @@ enddo
IF (input%ctail) THEN IF (input%ctail) THEN
!+gu hope this works as well !+gu hope this works as well
CALL cdnovlp(mpi, sphhar,stars,atoms,sym,& CALL cdnovlp(mpi, sphhar,stars,atoms,sym,&
dimension,vacuum, cell, input,oneD, jspin,rh(1,1,jspin), qpw,rhtxy,rho,rht) dimension,vacuum, cell, input,oneD,l_st, jspin,rh(1,1,jspin), qpw,rhtxy,rho,rht)
ELSEIF (mpi%irank.EQ.0) THEN ELSEIF (mpi%irank.EQ.0) THEN
DO ityp = 1,atoms%ntype DO ityp = 1,atoms%ntype
qpw(1,jspin) = qpw(1,jspin) + qint(ityp,jspin)/input%jspins/cell%volint qpw(1,jspin) = qpw(1,jspin) + qint(ityp,jspin)/input%jspins/cell%volint
......
...@@ -66,8 +66,8 @@ ...@@ -66,8 +66,8 @@
REAL, ALLOCATABLE :: rh(:,:,:),rh1(:,:,:),rhoss(:,:) REAL, ALLOCATABLE :: rh(:,:,:),rh1(:,:,:),rhoss(:,:)
REAL, ALLOCATABLE :: vacpar(:) REAL, ALLOCATABLE :: vacpar(:)
INTEGER lnum(DIMENSION%nstd,atoms%ntypd),nst(atoms%ntypd) INTEGER lnum(DIMENSION%nstd,atoms%ntypd),nst(atoms%ntypd)
INTEGER dummy(atoms%ntypd),jrc(atoms%ntypd) INTEGER jrc(atoms%ntypd)
LOGICAL l_found(0:3),llo_found(atoms%nlod),l_enpara LOGICAL l_found(0:3),llo_found(atoms%nlod),l_enpara,l_st
CHARACTER*8 name_l(10) CHARACTER*8 name_l(10)
! .. ! ..
! .. Intrinsic Functions .. ! .. Intrinsic Functions ..
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
! .. ! ..
! .. Data statements .. ! .. Data statements ..
DATA del/1.e-6/ DATA del/1.e-6/
PARAMETER (czero=(0.0,0.0)) PARAMETER (czero=(0.0,0.0),l_st=.true.)
! .. ! ..
! !
IF (input%jspins > DIMENSION%jspd) CALL juDFT_error("input%jspins > dimension%jspd",calledby& IF (input%jspins > DIMENSION%jspd) CALL juDFT_error("input%jspins > dimension%jspd",calledby&
...@@ -127,7 +127,6 @@ ...@@ -127,7 +127,6 @@
rat(jrc(n),n) = r rat(jrc(n),n) = r
r = r*d r = r*d
ENDDO ENDDO
dummy(n) = 1
ENDDO ENDDO
! !
! Generate the atomic charge densities ! Generate the atomic charge densities
...@@ -223,7 +222,7 @@ ...@@ -223,7 +222,7 @@
& sphhar,stars,atoms,sym,& & sphhar,stars,atoms,sym,&
& DIMENSION,vacuum,& & DIMENSION,vacuum,&
& cell,& & cell,&
& input,oneD,& & input,oneD,l_st,&
& ispin,rh1(:,:,ispin),& & ispin,rh1(:,:,ispin),&
& qpw,rhtxy,rho,rht) & qpw,rhtxy,rho,rht)
!roa- !roa-
......
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