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