The Elk Code
 
Loading...
Searching...
No Matches
writetdlsj.f90
Go to the documentation of this file.
1
2! Copyright (C) 2019 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
6subroutine writetdlsj
7use modmain
8use modtddft
9use modmpi
10implicit none
11! local variables
12integer is,ia,ias
13real(8) xl(3),xs(3)
14character(256) fext
15! allocatable arrays
16complex(8), allocatable :: dmat(:,:,:,:,:)
17allocate(dmat(lmmaxo,nspinor,lmmaxo,nspinor,natmtot))
18! generate the density matrix in each muffin-tin
19call gendmat(.false.,.false.,0,lmaxo,lmmaxo,dmat)
20if (mp_mpi) then
21 write(fext,'("_TS",I8.8,".OUT")') itimes
22 open(50,file='LSJ'//trim(fext),form='FORMATTED')
23 do is=1,nspecies
24 write(50,*)
25 write(50,'("Species : ",I4," (",A,")")') is,trim(spsymb(is))
26 do ia=1,natoms(is)
27 ias=idxas(ia,is)
28! calculate the expectation value of L and S
29 call dmatls(dmat(:,:,:,:,ias),xl,xs)
30 write(50,'(" atom : ",I4)') ia
31 write(50,'(" L : ",3G18.10)') xl(:)
32 write(50,'(" S : ",3G18.10)') xs(:)
33 write(50,'(" J : ",3G18.10)') xl(:)+xs(:)
34 end do
35 end do
36 close(50)
37end if
38end subroutine
39
subroutine dmatls(dmat, xl, xs)
Definition dmatls.f90:7
subroutine gendmat(tspndg, tlmdg, lmin, lmax, ld, dmat)
Definition gendmat.f90:7
integer nspinor
Definition modmain.f90:267
integer, dimension(maxspecies) natoms
Definition modmain.f90:36
integer, dimension(maxatoms, maxspecies) idxas
Definition modmain.f90:42
integer natmtot
Definition modmain.f90:40
character(64), dimension(maxspecies) spsymb
Definition modmain.f90:78
integer lmaxo
Definition modmain.f90:201
integer lmmaxo
Definition modmain.f90:203
integer nspecies
Definition modmain.f90:34
logical mp_mpi
Definition modmpi.f90:17
integer itimes
Definition modtddft.f90:46
subroutine writetdlsj
Definition writetdlsj.f90:7