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 ! automatic arrays
13 complex(8) zfmt(npmtmax),grhomt(npmtmax,3)
14 ! add gradient contribution from rigid shift of muffin-tin
15 nr=nrmt(isph)
16 nri=nrmti(isph)
17 np=npmt(isph)
18 ! convert the density to complex spherical harmonic expansion
19 call rtozfmt(nr,nri,rhomt(:,iasph),zfmt)
20 ! compute the gradient
21 call gradzfmt(nr,nri,rlmt(:,-1,isph),wcrmt(:,:,isph),zfmt,npmtmax,grhomt)
22 ! store density derivative for displaced atom
23 if (tlast) drhomt(1:np,natmtot+1)=drhomt(1:np,iasph)
24 ! subtract from the density derivative
25 drhomt(1:np,iasph)=drhomt(1:np,iasph)-grhomt(1:np,ipph)
26 end subroutine
27 
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:1047
integer ipph
Definition: modphonon.f90:15
integer isph
Definition: modphonon.f90:15
subroutine gradrhomt
Definition: gradrhomt.f90:7
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