2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Copyright (C) 2001 PWSCF group
|
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2003-02-08 00:04:36 +08:00
|
|
|
subroutine remove_atomic_rho
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
#include "machine.h"
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
use pwcom
|
2003-01-20 05:58:50 +08:00
|
|
|
implicit none
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: ir
|
2003-01-20 05:58:50 +08:00
|
|
|
! do-loop variable on FFT grid
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
real(kind=DP), allocatable :: work (:)
|
|
|
|
real(kind=DP) :: charge
|
2003-01-20 05:58:50 +08:00
|
|
|
! workspace, is the difference between t
|
|
|
|
! charge density and the atomic one at t
|
|
|
|
! charge
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
allocate (work( nrxx))
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
call setv (nrxx, 0.d0, work, 1)
|
|
|
|
if (lsda) call error ('rmv_at_rho', 'lsda not allowed', 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
write (6, '(/5x,"remove atomic charge density from scf rho")')
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! subtract the old atomic charge density
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
call atomic_rho (work, nspin)
|
|
|
|
call DSCAL (nrxx, - 1.0d0, work, 1)
|
|
|
|
call DAXPY (nrxx, + 1.0d0, rho, 1, work, 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
call io_pot ( + 1, output_drho, work, nspin)
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
deallocate(work)
|
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
|
|
|
|
end subroutine remove_atomic_rho
|
|
|
|
|