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 complex(4) c1
16 ! external functions
17 complex(4), external :: cdotc
18 complex(8), external :: zcfmtinp
19 zcfinp=0.d0
20 call holdthd(natmtot+1,nthd)
21 !$OMP PARALLEL DEFAULT(SHARED) &
22 !$OMP PRIVATE(is,c1) REDUCTION(+:zcfinp) &
23 !$OMP NUM_THREADS(nthd)
24 !$OMP DO SCHEDULE(DYNAMIC)
25 do ias=1,natmtot
26  is=idxis(ias)
27 ! muffin-tin contribution
28  zcfinp=zcfinp+zcfmtinp(nrcmt(is),nrcmti(is),wr2cmt(:,is),cfmt1(:,ias), &
29  cfmt2(:,ias))
30 end do
31 !$OMP END DO NOWAIT
32 ! interstitial contribution (requires that one of the functions has been
33 ! multiplied by the characteristic function)
34 !$OMP SINGLE
35 c1=cdotc(ngtc,cfir1,1,cfir2,1)
36 zcfinp=zcfinp+c1*omega/dble(ngtc)
37 !$OMP END SINGLE
38 !$OMP END PARALLEL
39 call freethd(nthd)
40 end function
41 
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