The Elk Code
 
Loading...
Searching...
No Matches
gencfrm.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2010 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine gencfrm(wfmt11,wfmt12,wfir11,wfir12,wfmt21,wfmt22,wfir21,wfir22, &
7 crhomt,crhoir,cmagmt,cmagir)
8use modmain
9use modomp
10implicit none
11! arguments
12complex(4), intent(in) :: wfmt11(npcmtmax,natmtot),wfmt12(npcmtmax,natmtot)
13complex(4), intent(in) :: wfir11(ngtot),wfir12(ngtot)
14complex(4), intent(in) :: wfmt21(npcmtmax,natmtot),wfmt22(npcmtmax,natmtot)
15complex(4), intent(in) :: wfir21(ngtot),wfir22(ngtot)
16complex(4), intent(out) :: crhomt(npcmtmax,natmtot),crhoir(ngtot)
17complex(4), intent(out) :: cmagmt(npcmtmax,natmtot,ndmag),cmagir(ngtot,ndmag)
18! local variables
19integer ld,is,ias,nthd
20ld=npcmtmax*natmtot
21call holdthd(natmtot+1,nthd)
22!$OMP PARALLEL DEFAULT(SHARED) &
23!$OMP PRIVATE(ias,is) &
24!$OMP NUM_THREADS(nthd)
25!-------------------------!
26! muffin-tin part !
27!-------------------------!
28!$OMP DO SCHEDULE(DYNAMIC)
29do ias=1,natmtot
30 is=idxis(ias)
31 call gencrm(npcmt(is),wfmt11(:,ias),wfmt12(:,ias),wfmt21(:,ias), &
32 wfmt22(:,ias),crhomt(:,ias),ld,cmagmt(:,ias,1))
33end do
34!$OMP END DO NOWAIT
35!---------------------------!
36! interstitial part !
37!---------------------------!
38!$OMP SINGLE
39call gencrm(ngtot,wfir11,wfir12,wfir21,wfir22,crhoir,ngtot,cmagir)
40!$OMP END SINGLE
41!$OMP END PARALLEL
42call freethd(nthd)
43end subroutine
44
subroutine gencfrm(wfmt11, wfmt12, wfir11, wfir12, wfmt21, wfmt22, wfir21, wfir22, crhomt, crhoir, cmagmt, cmagir)
Definition gencfrm.f90:8
pure subroutine gencrm(n, wf11, wf12, wf21, wf22, crho, ld, cmag)
Definition gencrm.f90:7
integer, dimension(maxatoms *maxspecies) idxis
Definition modmain.f90:44
integer, dimension(maxspecies) npcmt
Definition modmain.f90:214
subroutine holdthd(nloop, nthd)
Definition modomp.f90:78
subroutine freethd(nthd)
Definition modomp.f90:106