The Elk Code
 
Loading...
Searching...
No Matches
energytd.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 energytd
7use modmain
8use modtddft
9implicit none
10! local variables
11integer is,ias
12real(8) ca,engya,t1,t2
13! external functions
14real(8), external :: rfinp
15! Coulomb potential energy
17! Madelung term
18engymad=0.d0
19do ias=1,natmtot
20 is=idxis(ias)
21 engymad=engymad+0.5d0*spzn(is)*(vclmt(1,ias)-vcln(1,is))*y00
22end do
23! exchange and correlation energy
26! vector potential contributions to energy
27ca=-1.d0/solsc
28! coupling term -1/c A(t)⋅J(t)
29engya=ca*dot_product(afieldt(1:3,itimes),jtot(1:3))
30! constant term 1/2c² A²(t)Q where Q is the 'dynamic' charge
31ca=0.5d0/solsc**2
32t1=sum(afieldt(1:3,itimes)**2)
33t2=sum(chgstot(1:3))/3.d0
34engya=engya+ca*t1*(chgtot-t2)
35! total energy
37end subroutine
38
subroutine energytd
Definition energytd.f90:7
real(8), parameter y00
Definition modmain.f90:1233
real(8), dimension(3) jtot
Definition modmain.f90:748
real(8), dimension(:), pointer, contiguous rhoir
Definition modmain.f90:614
real(8), dimension(:,:), allocatable exmt
Definition modmain.f90:630
real(8) engykn
Definition modmain.f90:950
real(8), dimension(:,:), allocatable ecmt
Definition modmain.f90:632
real(8) engyvcl
Definition modmain.f90:962
integer, dimension(maxatoms *maxspecies) idxis
Definition modmain.f90:44
real(8) chgtot
Definition modmain.f90:726
integer natmtot
Definition modmain.f90:40
real(8), dimension(:), allocatable vclir
Definition modmain.f90:624
real(8) engyx
Definition modmain.f90:972
real(8) engymad
Definition modmain.f90:964
real(8) solsc
Definition modmain.f90:1252
real(8), dimension(:,:), allocatable vclmt
Definition modmain.f90:624
real(8) engytot
Definition modmain.f90:980
real(8), dimension(:,:), allocatable vcln
Definition modmain.f90:97
real(8) engyc
Definition modmain.f90:974
real(8), dimension(:), allocatable exir
Definition modmain.f90:630
real(8), dimension(:,:), pointer, contiguous rhomt
Definition modmain.f90:614
real(8), dimension(:), allocatable ecir
Definition modmain.f90:632
real(8), dimension(maxspecies) spzn
Definition modmain.f90:80
real(8), dimension(:,:), allocatable afieldt
Definition modtddft.f90:58
integer itimes
Definition modtddft.f90:46
real(8), dimension(3) chgstot
Definition modtddft.f90:84
real(8) function rfinp(rfmt1, rfir1, rfmt2, rfir2)
Definition rfinp.f90:10