14 integer ioc,i,j,n,nthd
17 integer(omp_lock_kind),
allocatable :: lock(:)
18 complex(8),
allocatable :: evecu(:,:),pmat(:,:,:),vchi0(:,:,:)
19 complex(4),
allocatable :: vchi0_sp(:,:,:)
20 complex(8),
allocatable :: eps0(:,:,:),epsi(:,:,:),epsm(:,:,:)
52 call omp_init_lock(lock(iw))
55 allocate(vchi0_sp(nm,nm,
nwrf))
56 vchi0_sp(1:nm,1:nm,1:
nwrf)=0.e0
68 write(*,
'("Info(tddftlru): ",I0," of ",I0," k-points")') ik0,
nkpt0 79 call genvchi0u(ik0,lock,pmat,evecu,vchi0_sp)
82 deallocate(evecu,pmat)
87 call omp_destroy_lock(lock(iw))
93 call mpi_allreduce(mpi_in_place,vchi0_sp,n,mpi_complex,mpi_sum,
mpicom,
ierror)
96 allocate(vchi0(nm,nm,
nwrf))
97 vchi0(1:nm,1:nm,1:
nwrf)=vchi0_sp(1:nm,1:nm,1:
nwrf)
99 allocate(eps0(nm,nm,
nwrf),epsi(nm,nm,
nwrf))
101 eps0(1:nm,1:nm,1:
nwrf)=-vchi0(1:nm,1:nm,1:
nwrf)
103 eps0(i,i,1:
nwrf)=eps0(i,i,1:
nwrf)+1.d0
108 call zminv(nm,eps0(:,:,iw))
110 call zgemm(
'N',
'N',nm,nm,nm,
zone,vchi0(:,:,iw),nm,eps0(:,:,iw),nm,
zzero, &
114 epsi(i,i,iw)=1.d0+epsi(i,i,iw)
119 allocate(epsm(3,3,
nwrf))
121 epsm(1:3,1:3,iw)=epsi(1:3,1:3,iw)
122 call zminv(3,epsm(:,:,iw))
128 write(fname,
'("EPSM_ULR_",2I1,".OUT")') i,j
129 open(50,file=trim(fname),form=
'FORMATTED')
131 write(50,
'(2G18.10)')
wrf(iw)%re,epsm(i,j,iw)%re
135 write(50,
'(2G18.10)')
wrf(iw)%re,epsm(i,j,iw)%im
140 write(*,
'("Info(tddftlru):")')
141 write(*,
'(" Macroscopic dielectric tensor written to EPSM_ULR_ij.OUT")')
142 write(*,
'(" for components")')
144 write(*,
'(" i = ",I1,", j = ",I1)')
optcomp(1:2,ioc)
148 deallocate(vchi0,eps0,epsi)
complex(8), dimension(:), allocatable wrf
complex(8), parameter zone
subroutine getocculr(ik0)
integer, dimension(3, 27) optcomp
subroutine genvchi0u(ik0, lock, pmat, evecu, vchi0)
complex(8), parameter zzero
real(8), dimension(:), allocatable gclq
subroutine holdthd(nloop, nthd)
subroutine genpmatk(ik, pmat)
subroutine eveqnulr(ik0, evecu)