Commit 03e9fa09 authored by ccavazzoni's avatar ccavazzoni

- removing redundant code


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13742 c92efa57-630b-4861-b058-cf58834340f0
parent 89c9c4d3
......@@ -235,7 +235,7 @@
!
!
!-----------------------------------------------------------------------
subroutine vofrho_meta ( vs)
subroutine vofrho_meta ( )
!-----------------------------------------------------------------------
! computes: the one-particle potential v in real space,
! the total energy etot,
......@@ -270,17 +270,17 @@
USE fft_base, ONLY: dffts, dfftp
!
implicit none
!
complex(dp) vs(dffts%nnr)
!
integer iss, isup, isdw, ig, ir,i,j,k,is, ia
real(dp) dkedxc(3,3) !metagga
complex(dp) fp, fm, ci
COMPLEX(DP), ALLOCATABLE :: v(:)
COMPLEX(DP), ALLOCATABLE :: vs(:)
!
ci=(0.d0,1.d0)
ALLOCATE( v(dfftp%nnr) )
ALLOCATE( vs(dffts%nnr) )
v(:)=(0.d0,0.d0)
!
! ===================================================================
......@@ -371,6 +371,7 @@
end do
end if
DEALLOCATE( v )
DEALLOCATE( vs )
return
end subroutine vofrho_meta
!-----------------------------------------------------------------------
......@@ -84,7 +84,6 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
COMPLEX(DP) fp, fm, ci, drhop, zpseu, zh
COMPLEX(DP), ALLOCATABLE :: rhotmp(:), vtemp(:)
COMPLEX(DP), ALLOCATABLE :: drhot(:,:)
COMPLEX(DP), ALLOCATABLE :: vs(:)
REAL(DP), ALLOCATABLE :: gagb(:,:), rhosave(:,:), rhocsave(:)
!
REAL(DP), ALLOCATABLE :: fion1( :, : )
......@@ -462,6 +461,7 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
END IF
DEALLOCATE (vtemp)
IF( ttsic ) DEALLOCATE( self_vloc )
!
! rhog contains now the total (local+Hartree+xc) potential in g-space
!
......@@ -491,7 +491,6 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
DEALLOCATE( fion1 )
!
IF( ttsic ) DEALLOCATE( self_vloc )
!
! ===================================================================
! fourier transform of total potential to r-space (dense grid)
......@@ -512,48 +511,9 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
!
! fourier transform of total potential to r-space (smooth grid)
!
ALLOCATE( vs( dffts%nnr ) )
vs (:) = (0.d0, 0.d0)
!
IF(nspin.EQ.1)THEN
!
iss=1
!$omp parallel do
DO ig=1,ngms
vs(nlsm(ig))=CONJG(rhog(ig,iss))
vs(nls(ig))=rhog(ig,iss)
END DO
!
CALL invfft('Smooth',vs, dffts )
!
!$omp parallel do
DO ir=1,dffts%nnr
rhos(ir,iss)=DBLE(vs(ir))
END DO
!
ELSE
!
isup=1
isdw=2
!$omp parallel do
DO ig=1,ngms
vs(nls(ig))=rhog(ig,isup)+ci*rhog(ig,isdw)
vs(nlsm(ig))=CONJG(rhog(ig,isup)) +ci*CONJG(rhog(ig,isdw))
END DO
!
CALL invfft('Smooth',vs, dffts )
!
!$omp parallel do
DO ir=1,dffts%nnr
rhos(ir,isup)= DBLE(vs(ir))
rhos(ir,isdw)=AIMAG(vs(ir))
END DO
!
ENDIF
IF( dft_is_meta() ) CALL vofrho_meta( vs )
CALL smooth_rho_g2r ( rhog, rhos )
DEALLOCATE( vs )
IF( dft_is_meta() ) CALL vofrho_meta( )
ebac = 0.0d0
!
......
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