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
|
|
|
!-----------------------------------------------------------------------
|
2004-06-26 01:25:37 +08:00
|
|
|
#include "f_defs.h"
|
2003-11-10 02:30:08 +08:00
|
|
|
USE io_global, ONLY: stdout
|
|
|
|
USE io_files, ONLY: output_drho
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, ONLY: DP
|
2004-01-16 17:18:28 +08:00
|
|
|
USE gvect, ONLY: nrxx
|
|
|
|
USE lsda_mod, ONLY: lsda, nspin
|
|
|
|
USE scf, ONLY: rho
|
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
|
|
|
|
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP), allocatable :: work (:)
|
|
|
|
real(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-04-23 00:03:45 +08:00
|
|
|
work(:) = 0.d0
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-02-21 22:57:00 +08:00
|
|
|
if (lsda) call errore ('rmv_at_rho', 'lsda not allowed', 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '(/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
|
|
|
|
|