17 complex(8) a(4,4),b(4,4),z1
20 integer(omp_lock_kind),
allocatable :: lock(:)
21 real(8),
allocatable :: vgqc(:,:),gqc(:),gclgq(:),jlgqr(:,:,:)
22 complex(8),
allocatable :: ylmgq(:,:),sfacgq(:,:)
23 complex(8),
allocatable :: chi(:,:,:,:,:),chit(:),fxc(:,:,:,:)
24 complex(8),
allocatable :: c(:,:),d(:,:,:,:)
27 write(*,
'("Error(tddftsplr): spin-unpolarised calculation")')
38 v(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))
153 allocate(gclgq(
ngrf))
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) = ⎜ | ⎟")')
234 write(*,
'(" ⎜ | ⎟")')
235 write(*,
'(" ⎝ | ⎠")')
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)")')
257 call writetest(330,
'transverse response function',nv=
nwrf,tol=1.d-2,zva=chit)
258 deallocate(gqc,ylmgq,sfacgq,chi,fxc)
259 if (.not.
ncmag)
deallocate(chit)
266 complex(8),
intent(in) :: a(4,4)
267 complex(8),
intent(out) :: b(4,4)
275 c(i,3)=cmplx(z1%im,-z1%re,8)
282 b(3,j)=cmplx(-z1%im,z1%re,8)
287 pure subroutine tfm13t(a,b)
290 complex(8),
intent(in) :: a(4,4)
291 complex(8),
intent(out) :: b(4,4)
298 z1=cmplx(-z1%im,z1%re,8)
306 z1=cmplx(-z1%im,z1%re,8)
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)
real(8), dimension(:,:), allocatable evalsv
subroutine gengqf(ng, vqpc, vgqc, gqc, jlgqr, ylmgq, sfacgq)
subroutine getevalsv(fext, ikp, vpl, evalsv_)
complex(8), dimension(:), allocatable wrf
complex(8), parameter zone
subroutine genspchi0(ik, lock, vqpl, jlgqr, ylmgq, sfacgq, chi0)
real(8), dimension(3) vecql
pure subroutine gengclgq(treg, iq, ngq, gqc, gclgq)
subroutine findqpt(vpl, isym, iq)
integer, dimension(3) ngridk
real(8), dimension(:,:), allocatable occsv
complex(8), parameter zzero
real(8), dimension(:,:), allocatable vkl
subroutine getoccsv(fext, ikp, vpl, occsvp)
subroutine holdthd(nloop, nthd)
pure subroutine tfm13t(a, b)
real(8), dimension(3) vecqc
pure subroutine tfm2213(n, fxcuu, fxcud, fxcdd, magu, magm, bxcp, ld, fxc)
subroutine genspfxcg(fxc)