The Elk Code
zcfinp.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2023 J. K. Dewhurst and S. Sharma.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 complex(8) function zcfinp(cfmt1,cfir1,cfmt2,cfir2)
7 use modmain
8 use modomp
9 implicit none
10 ! arguments
11 complex(4), intent(in) :: cfmt1(npcmtmax,natmtot),cfir1(ngtc)
12 complex(4), intent(in) :: cfmt2(npcmtmax,natmtot),cfir2(ngtc)
13 ! local variables
14 integer is,ias,nthd
15 ! external functions
16 complex(4), external :: cdotc
17 complex(8), external :: zcfmtinp
18 zcfinp=0.d0
19 call holdthd(natmtot+1,nthd)
20 !$OMP PARALLEL DEFAULT(SHARED) &
21 !$OMP PRIVATE(is) REDUCTION(+:zcfinp) &
22 !$OMP NUM_THREADS(nthd)
23 !$OMP DO SCHEDULE(DYNAMIC)
24 do ias=1,natmtot
25  is=idxis(ias)
26 ! muffin-tin contribution
27  zcfinp=zcfinp+zcfmtinp(nrcmt(is),nrcmti(is),wr2cmt(:,is),cfmt1(:,ias), &
28  cfmt2(:,ias))
29 end do
30 !$OMP END DO NOWAIT
31 ! interstitial contribution (requires that one of the functions has been
32 ! multiplied by the characteristic function)
33 !$OMP SINGLE
34 zcfinp=zcfinp+(omega/ngtc)*cdotc(ngtc,cfir1,1,cfir2,1)
35 !$OMP END SINGLE
36 !$OMP END PARALLEL
37 call freethd(nthd)
38 end function
39 
integer ngtc
Definition: modmain.f90:392
real(8) omega
Definition: modmain.f90:20
pure complex(8) function zcfmtinp(nr, nri, wr, cfmt1, cfmt2)
Definition: zcfmtinp.f90:7
Definition: modomp.f90:6
real(8), dimension(:,:), allocatable wr2cmt
Definition: modmain.f90:189
integer, dimension(maxatoms *maxspecies) idxis
Definition: modmain.f90:44
integer natmtot
Definition: modmain.f90:40
integer, dimension(maxspecies) nrcmt
Definition: modmain.f90:173
integer, dimension(maxspecies) nrcmti
Definition: modmain.f90:211