The Elk Code
gradzvcln.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2020 J. K. Dewhurst and S. Sharma.
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 gradzvcln(is,gzfmt)
7 use modmain
8 implicit none
9 ! arguments
10 integer, intent(in) :: is
11 complex(8), intent(out) :: gzfmt(npmtmax,3)
12 ! local variables
13 integer nr,nri,iro,i0,i1
14 ! allocatable arrays
15 complex(8), allocatable :: zvclmt(:)
16 allocate(zvclmt(npmtmax))
17 nr=nrmt(is)
18 nri=nrmti(is)
19 iro=nri+1
20 ! convert nuclear Coulomb potential to complex spherical harmonics expansion
21 zvclmt(1:npmt(is))=0.d0
22 i1=lmmaxi*(nri-1)+1
23 zvclmt(1:i1:lmmaxi)=vcln(1:nri,is)
24 i0=i1+lmmaxi
25 i1=lmmaxo*(nr-iro)+i0
26 zvclmt(i0:i1:lmmaxo)=vcln(iro:nr,is)
27 ! compute the gradient of the potential
28 call gradzfmt(nr,nri,rlmt(:,-1,is),wcrmt(:,:,is),zvclmt,npmtmax,gzfmt)
29 deallocate(zvclmt)
30 end subroutine
31 
integer lmmaxo
Definition: modmain.f90:203
real(8), dimension(:,:), allocatable vcln
Definition: modmain.f90:97
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
subroutine gradzvcln(is, gzfmt)
Definition: gradzvcln.f90:7
integer lmmaxi
Definition: modmain.f90:207
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