Commit fe834ea8 authored by Gregor Michalicek's avatar Gregor Michalicek

Minor cleanup related with last commit

parent 09adadde
......@@ -2,7 +2,7 @@ MODULE m_cdnval
use m_juDFT
CONTAINS
SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,sliceplot,noco, input,banddos,cell,atoms,enpara,stars,&
vacuum,dimension,sphhar,sym,obsolete,vTot,oneD,coreSpecInput,den,regCharges,results,&
vacuum,dimension,sphhar,sym,obsolete,vTot,oneD,coreSpecInput,cdnvalKLoop,den,regCharges,results,&
moments)
!
! ***********************************************************
......@@ -105,6 +105,7 @@ CONTAINS
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_coreSpecInput), INTENT(IN) :: coreSpecInput
TYPE(t_potden), INTENT(IN) :: vTot
TYPE(t_cdnvalKLoop), INTENT(IN) :: cdnvalKLoop
TYPE(t_potden), INTENT(INOUT) :: den
TYPE(t_regionCharges), INTENT(INOUT) :: regCharges
TYPE(t_moments), INTENT(INOUT) :: moments
......@@ -144,7 +145,6 @@ CONTAINS
TYPE (t_usdus) :: usdus
TYPE (t_zMat) :: zMat
TYPE (t_orbcomp) :: orbcomp
TYPE (t_cdnvalKLoop) :: cdnvalKLoop
l_real = sym%invs.AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco)
......@@ -199,9 +199,6 @@ CONTAINS
END IF
8000 FORMAT (/,/,10x,'valence density: spin=',i2)
skip_tt = dot_product(enpara%skiplo(:atoms%ntype,jspin),atoms%neq(:atoms%ntype))
IF (noco%l_soc.OR.noco%l_noco) skip_tt = 2 * skip_tt
l_write = input%cdinf.AND.mpi%irank==0
DO n = 1,atoms%ntype
......@@ -227,10 +224,9 @@ CONTAINS
END DO
DEALLOCATE (f,g,flo)
ALLOCATE (we(dimension%neigd))
CALL cdnvalKLoop%init(mpi,input,kpts,banddos,noco,results,jspin,sliceplot)
skip_tt = dot_product(enpara%skiplo(:atoms%ntype,jspin),atoms%neq(:atoms%ntype))
IF (noco%l_soc.OR.noco%l_noco) skip_tt = 2 * skip_tt
ALLOCATE (we(MAXVAL(cdnvalKLoop%noccbd(:))))
jsp = MERGE(1,jspin,noco%l_noco)
DO ikpt = cdnvalKLoop%ikptStart, cdnvalKLoop%nkptExtended, cdnvalKLoop%ikptIncrement
......@@ -286,12 +282,6 @@ CONTAINS
IF (noccbd.EQ.0) GO TO 199
!---> in normal iterations the charge density of the unoccupied
!---> does not need to be calculated (in pwden, vacden and abcof)
IF (banddos%dos.AND. .NOT.(cdnvalKLoop%l_evp.AND.(mpi%isize.GT.1)) ) THEN
noccbd=nbands
END IF
! ----> add in spin-doubling factor
we(:noccbd) = 2.0 * we(:noccbd) / input%jspins
......
......@@ -254,13 +254,13 @@ CONTAINS
IF (zmat%l_real) THEN
IF (.NOT.ALLOCATED(d%eig_vecr)) THEN
IF (.NOT.ALLOCATED(d%eig_vecc)) CALL juDFT_error("BUG: can not read real/complex vectors from memory")
zmat%z_r=REAL(RESHAPE(d%eig_vecc(arrayStart:arrayStart+SIZE(zmat%z_r),nrec),SHAPE(zmat%z_r)))
zmat%z_r=REAL(RESHAPE(d%eig_vecc(arrayStart:arrayStart+SIZE(zmat%z_r)-1,nrec),SHAPE(zmat%z_r)))
ELSE
zmat%z_r=RESHAPE(d%eig_vecr(arrayStart:arrayStart+SIZE(zmat%z_r),nrec),SHAPE(zmat%z_r))
zmat%z_r=RESHAPE(d%eig_vecr(arrayStart:arrayStart+SIZE(zmat%z_r)-1,nrec),SHAPE(zmat%z_r))
ENDIF
ELSE !TYPE is (COMPLEX)
IF (.NOT.ALLOCATED(d%eig_vecc)) CALL juDFT_error("BUG: can not read complex vectors from memory", calledby = "eig66_mem")
zmat%z_c=RESHAPE(d%eig_vecc(arrayStart:arrayStart+SIZE(zmat%z_c),nrec),SHAPE(zmat%z_c))
zmat%z_c=RESHAPE(d%eig_vecc(arrayStart:arrayStart+SIZE(zmat%z_c)-1,nrec),SHAPE(zmat%z_c))
END IF
ENDIF
END SUBROUTINE read_eig
......
......@@ -69,6 +69,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
TYPE(t_noco) :: noco_new
TYPE(t_regionCharges) :: regCharges
TYPE(t_moments) :: moments
TYPE(t_cdnvalKLoop) :: cdnvalKLoop
!Local Scalars
REAL :: fix, qtot, dummy
......@@ -87,8 +88,9 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
IF (noco%l_mperp) jspmax = 1
DO jspin = 1,jspmax
CALL timestart("cdngen: cdnval")
CALL cdnvalKLoop%init(mpi,input,kpts,banddos,noco,results,jspin,sliceplot)
CALL cdnval(eig_id,mpi,kpts,jspin,sliceplot,noco,input,banddos,cell,atoms,enpara,stars,vacuum,dimension,&
sphhar,sym,obsolete,vTot,oneD,coreSpecInput,outDen,regCharges,results,moments)
sphhar,sym,obsolete,vTot,oneD,coreSpecInput,cdnvalKLoop,outDen,regCharges,results,moments)
CALL timestop("cdngen: cdnval")
END DO
......
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