The Elk Code
 
Loading...
Searching...
No Matches
writew90spn.f90
Go to the documentation of this file.
1
2! Copyright (C) 2015 Manh Duc Le, 2017-18 Arsenii Gerasimov, Yaroslav Kvashnin
3! and Lars Nordstrom. This file is distributed under the terms of the GNU
4! General Public License. See the file COPYING for license details.
5
6subroutine writew90spn
7use modmain
8use modw90
9implicit none
10! local variables
11integer ik,ist,jst,i,j
12complex(8) z1
13character(256) fname
14! allocatable arrays
15complex(8), allocatable :: evecsv(:,:),smat(:,:,:,:)
16if (.not.spinpol) return
17fname=trim(seedname)//'.spn'
18open(50,file=trim(fname),action='WRITE',form='FORMATTED')
19write(50,'("Generated by Elk version ",I0,".",I0,".",I0)') version
20write(50,'(3I8)') num_bands,nkptnr
21allocate(evecsv(nstsv,nstsv),smat(nstsv,nstsv,2,2))
22do ik=1,nkptnr
23! generate the spin operator matrix elements
24! (note that this is *not* a density matrix)
25 call getevecsv(filext,0,vkl(:,ik),evecsv)
26 call gensmatk(evecsv,smat)
27 do j=1,num_bands
28 jst=idxw90(j)
29 do i=1,j
30 ist=idxw90(i)
31 z1=smat(ist,jst,1,2)+smat(ist,jst,2,1)
32 write(50,'(2G18.10)') z1
33 z1=smat(ist,jst,1,2)-smat(ist,jst,2,1)
34 z1=zmi*z1
35 write(50,'(2G18.10)') z1
36 z1=smat(ist,jst,1,1)-smat(ist,jst,2,2)
37 write(50,'(2G18.10)') z1
38 end do
39 end do
40end do
41deallocate(evecsv,smat)
42close(50)
43write(*,*)
44write(*,'("Info(writew90spn): created file ",A)') trim(fname)
45end subroutine
46
subroutine gensmatk(evecsv, smat)
Definition gensmatk.f90:7
subroutine getevecsv(fext, ikp, vpl, evecsv)
Definition getevecsv.f90:7
integer nkptnr
Definition modmain.f90:463
complex(8), parameter zmi
Definition modmain.f90:1239
character(256) filext
Definition modmain.f90:1300
logical spinpol
Definition modmain.f90:228
integer, dimension(3), parameter version
Definition modmain.f90:1288
integer nstsv
Definition modmain.f90:886
real(8), dimension(:,:), allocatable vkl
Definition modmain.f90:471
integer, dimension(:), allocatable idxw90
Definition modw90.f90:22
integer num_bands
Definition modw90.f90:20
character(256) seedname
Definition modw90.f90:12
subroutine writew90spn