30integer,
parameter :: lwork=10
34real(8) efg(3,3),a(3,3)
35real(8) w(3),work(lwork)
37real(8),
allocatable :: rfmt(:),grfmt1(:,:),grfmt2(:,:)
40 write(*,
'("Error(writeefg): lmaxi too small for calculating the EFG : ",&
42 write(*,
'(" Run the ground-state calculation again with lmaxi >= 2")')
52open(50,file=
'EFG.OUT',form=
'FORMATTED')
54write(50,
'("(electric field gradient tensor is in Cartesian coordinates)")')
63 write(50,
'("Species : ",I4," (",A,"), atom : ",I4)') is,trim(
spsymb(is)),ia
65 rfmt(1:np)=
vclmt(1:np,ias)
76 call gradrfmt(nr,nri,
rlmt(:,-1,is),
wcrmt(:,:,is),rfmt,
npmtmax,grfmt1)
79 call gradrfmt(nr,nri,
rlmt(:,-1,is),
wcrmt(:,:,is),grfmt1(:,i),
npmtmax, &
82 efg(i,j)=grfmt2(1,j)*
y00
88 efg(i,j)=0.5d0*(efg(i,j)+efg(j,i))
93 write(50,
'(" EFG tensor :")')
95 write(50,
'(3G18.10)') (efg(i,j),j=1,3)
97 write(50,
'(" trace : ",G18.10)') efg(1,1)+efg(2,2)+efg(3,3)
100 call dsyev(
'N',
'U',3,a,3,w,work,lwork,info)
101 write(50,
'(" eigenvalues :")')
102 write(50,
'(3G18.10)') w
107write(*,
'("Info(writeefg): electric field gradient written to EFG.OUT")')
108deallocate(rfmt,grfmt1,grfmt2)
110call writetest(115,
'electric field gradient',nv=9,tol=1.d-3,rva=efg)
subroutine gradrfmt(nr, nri, ri, wcr, rfmt, ld, grfmt)
integer, dimension(maxspecies) nrmti
real(8), dimension(:,:,:), allocatable wcrmt
integer, dimension(maxspecies) nrmt
integer, dimension(maxspecies) natoms
integer, dimension(maxatoms, maxspecies) idxas
character(64), dimension(maxspecies) spsymb
integer, dimension(maxspecies) npmt
real(8), dimension(:,:), allocatable vclmt
real(8), dimension(:,:,:), allocatable rlmt
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)