The Elk Code
 
Loading...
Searching...
No Matches
jtotk.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
6subroutine jtotk(ik,pmat,evecsv,evecsvt)
7use modmain
8implicit none
9! arguments
10integer, intent(in) :: ik
11complex(8), intent(in) :: pmat(nstsv,nstsv,3)
12complex(8), intent(in) :: evecsv(nstsv,nstsv),evecsvt(nstsv,nstsv)
13! local variables
14integer ist,l
15real(8) wo,t1
16! allocatable arrays
17complex(8), allocatable :: a(:,:),b(:,:)
18! external functions
19real(8), external :: ddot
20allocate(a(nstsv,nstsv),b(nstsv,nstsv))
21do l=1,3
22! form the momentum operator matrix elements in the first-variational basis
23 call zgemm('N','C',nstsv,nstsv,nstsv,zone,pmat(:,:,l),nstsv,evecsv,nstsv, &
24 zzero,a,nstsv)
25 call zgemm('N','N',nstsv,nstsv,nstsv,zone,evecsv,nstsv,a,nstsv,zzero,b,nstsv)
26! add to the total current
27 call zgemm('N','N',nstsv,nstsv,nstsv,zone,b,nstsv,evecsvt,nstsv,zzero,a,nstsv)
28 do ist=1,nstsv
29 wo=occsv(ist,ik)
30 if (abs(wo) < epsocc) cycle
31 wo=wo*wkpt(ik)
32 t1=ddot(2*nstsv,evecsvt(:,ist),1,a(:,ist),1)
33!$OMP ATOMIC
34 jtot(l)=jtot(l)+wo*t1
35 end do
36end do
37deallocate(a,b)
38end subroutine
39
subroutine jtotk(ik, pmat, evecsv, evecsvt)
Definition jtotk.f90:7
real(8), dimension(:), allocatable wkpt
Definition modmain.f90:475
real(8), dimension(3) jtot
Definition modmain.f90:748
complex(8), parameter zzero
Definition modmain.f90:1238
complex(8), parameter zone
Definition modmain.f90:1238
real(8) epsocc
Definition modmain.f90:900
real(8), dimension(:,:), allocatable occsv
Definition modmain.f90:902