The Elk Code
gradrhomt.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2012 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine gradrhomt
7 use modmain
8 use modphonon
9 implicit none
10 ! local variables
11 integer nr,nri,np
12 ! allocatable arrays
13 complex(8), allocatable :: zfmt(:),grhomt(:,:)
14 allocate(zfmt(npmtmax),grhomt(npmtmax,3))
15 ! add gradient contribution from rigid shift of muffin-tin
16 nr=nrmt(isph)
17 nri=nrmti(isph)
18 np=npmt(isph)
19 ! convert the density to complex spherical harmonic expansion
20 call rtozfmt(nr,nri,rhomt(:,iasph),zfmt)
21 ! compute the gradient
22 call gradzfmt(nr,nri,rlmt(:,-1,isph),wcrmt(:,:,isph),zfmt,npmtmax,grhomt)
23 ! store density derivative for displaced atom
24 if (tlast) drhomt(1:np,natmtot+1)=drhomt(1:np,iasph)
25 ! subtract from the density derivative
26 drhomt(1:np,iasph)=drhomt(1:np,iasph)-grhomt(1:np,ipph)
27 deallocate(zfmt,grhomt)
28 end subroutine
29 
complex(8), dimension(:,:), pointer, contiguous drhomt
Definition: modphonon.f90:100
real(8), dimension(:,:,:), allocatable rlmt
Definition: modmain.f90:179
integer, dimension(maxspecies) npmt
Definition: modmain.f90:213
subroutine gradzfmt(nr, nri, ri, wcr, zfmt, ld, gzfmt)
Definition: gradzfmt.f90:10
real(8), dimension(:,:), pointer, contiguous rhomt
Definition: modmain.f90:614
integer iasph
Definition: modphonon.f90:15
pure subroutine rtozfmt(nr, nri, rfmt, zfmt)
Definition: rtozfmt.f90:7
logical tlast
Definition: modmain.f90:1053
integer ipph
Definition: modphonon.f90:15
integer isph
Definition: modphonon.f90:15
subroutine gradrhomt
Definition: gradrhomt.f90:7
integer npmtmax
Definition: modmain.f90:216
integer natmtot
Definition: modmain.f90:40
real(8), dimension(:,:,:), allocatable wcrmt
Definition: modmain.f90:187
integer, dimension(maxspecies) nrmti
Definition: modmain.f90:211
integer, dimension(maxspecies) nrmt
Definition: modmain.f90:150