17complex(8) a(4,4),b(4,4),z1
20integer(omp_lock_kind),
allocatable :: lock(:)
21real(8),
allocatable :: vgqc(:,:),gqc(:),gclgq(:),jlgqr(:,:,:)
22complex(8),
allocatable :: ylmgq(:,:),sfacgq(:,:)
23complex(8),
allocatable :: chi(:,:,:,:,:),chit(:),fxc(:,:,:,:)
24complex(8),
allocatable :: c(:,:),d(:,:,:,:)
27 write(*,
'("Error(tddftsplr): spin-unpolarised calculation")')
38v(1:3)=abs(v(1:3)-nint(v(1:3)))
41 write(*,
'("Error(tddftsplr): q-vector incommensurate with k-point grid")')
42 write(*,
'(" ngridk : ",3I6)')
ngridk
43 write(*,
'(" vecql : ",3G18.10)')
vecql
70 call omp_init_lock(lock(iw))
83 write(*,
'("Info(tddftsplr): ",I6," of ",I6," k-points")') ik,
nkptnr
91 call omp_destroy_lock(lock(iw))
97 call mpi_allreduce(mpi_in_place,chi,n,mpi_double_complex,mpi_sum,
mpicom, &
104 a(1:4,1:4)=chi(ig,1:4,jg,1:4,iw)
106 chi(ig,1:4,jg,1:4,iw)=b(1:4,1:4)
114 a(1:4,1:4)=chi(1,1:4,1,1:4,iw)
124 write(fname,
'("CHI0_",2I1,".OUT")') i-1,j-1
125 open(50,file=trim(fname),form=
'FORMATTED',action=
'WRITE')
127 write(50,
'(2G18.10)') dble(
wrf(iw)),dble(chi(1,i,1,j,iw))
131 write(50,
'(2G18.10)') dble(
wrf(iw)),aimag(chi(1,i,1,j,iw))
138 open(50,file=
'CHI0_T.OUT',form=
'FORMATTED',action=
'WRITE')
140 write(50,
'(2G18.10)') dble(
wrf(iw)),dble(chit(iw))
144 write(50,
'(2G18.10)') dble(
wrf(iw)),aimag(chit(iw))
157 fxc(ig,1,ig,1)=fxc(ig,1,ig,1)+gclgq(ig)
167 call zgemm(
'N',
'N',n,n,n,z1,chi(:,:,:,:,iw),n,fxc,n,
zzero,c,n)
175 call zgemm(
'N',
'N',n,n,n,
zone,c,n,chi(:,:,:,:,iw),n,
zzero,d,n)
176 chi(:,:,:,:,iw)=d(:,:,:,:)
182 a(1:4,1:4)=chi(1,1:4,1,1:4,iw)
189 if (
task == 331)
then
190 open(120,file=
'CHI.OUT',form=
'UNFORMATTED',action=
'WRITE')
197 write(fname,
'("CHI_",2I1,".OUT")') i-1,j-1
198 open(50,file=trim(fname),form=
'FORMATTED',action=
'WRITE')
200 write(50,
'(2G18.10)') dble(
wrf(iw)),dble(chi(1,i,1,j,iw))
204 write(50,
'(2G18.10)') dble(
wrf(iw)),aimag(chi(1,i,1,j,iw))
211 open(50,file=
'CHI_T.OUT',form=
'FORMATTED',action=
'WRITE')
213 write(50,
'(2G18.10)') dble(
wrf(iw)),dble(chit(iw))
217 write(50,
'(2G18.10)') dble(
wrf(iw)),aimag(chit(iw))
222 write(*,
'("Info(tddftsplr):")')
223 write(*,χ
'(" Spin-dependent response function _ij(G,G'',q,w) written to &
225 write(*,
'(" for i,j = 0-3; G = G'' = 0; and all wplot frequencies")')
226 write(*,
'(" q-vector (lattice coordinates) : ")')
227 write(*,
'(3G18.10)')
vecql
228 write(*,
'(" q-vector length : ",G18.10)') gqc(1)
230 write(*,χ
'(" The elements of labeled by (i,j) form the 4x4 matrix :")')
232 write(*,⎛⎞
'(" _|_ _ _")')
233 write(*,χ
'(" (G,G'⎜⎟
',q,w) = | ")')
237 write(*,ρ
'(" (0,0) is the charge-charge response d/dv")')
238 write(*,ρ
'(" (0,1-3) is the charge-magnetisation response d/dB")')
239 write(*,
'(" (1-3,0) is the magnetisation-charge response dm/v")')
240 write(*,
'(" (1-3,1-3) is the magnetisation-magnetisation response dm/dB")')
242 write(*,
'(" Non-interacting Kohn-Sham response function written to &
246 write(*,±±
'(" Transverse components corresponding to m_ = m_x im_y")')
247 write(*,
'(" written to CHI_T.OUT and CHI0_T.OUT")')
249 if (
task == 331)
then
251 write(*,
'(" Complete response function for all G, G'' written to binary &
253 write(*,
'(" (array index ordering changed from version 4.5.16 onwards)")')
257call writetest(330,
'transverse response function',nv=
nwrf,tol=1.d-2,zva=chit)
258deallocate(gqc,ylmgq,sfacgq,chi,fxc)
259if (.not.
ncmag)
deallocate(chit)
267complex(8),
intent(in) :: a(4,4)
268complex(8),
intent(out) :: b(4,4)
275 c(i,3)=
zmi*(a(i,2)-a(i,3))
281 b(3,j)=
zi*(c(2,j)-c(3,j))
289complex(8),
intent(in) :: a(4,4)
290complex(8),
intent(out) :: b(4,4)
complex(8), parameter zzero
complex(8), parameter zmi
real(8), dimension(3) vecql
real(8), dimension(3) vecqc
complex(8), parameter zone
integer, dimension(3) ngridk
complex(8), dimension(:), allocatable wrf
real(8), dimension(:,:), allocatable vkl
real(8), dimension(:,:), allocatable occsv
real(8), dimension(:,:), allocatable evalsv