The Elk Code
rhocoreu.f90
Go to the documentation of this file.
1
2
! Copyright (C) 2019 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3
! This file is distributed under the terms of the GNU General Public License.
4
! See the file COPYING for license details.
5
6
subroutine
rhocoreu
7
use
modmain
8
use
modulr
9
use
modomp
10
implicit none
11
! local variables
12
integer
is,ias,ir,i,nthd
13
integer
nrc,nrci,irc,npc
14
real(8)
t1
15
! allocatable arrays
16
real(8)
,
allocatable
:: rfmt(:,:)
17
! generate the core density in spherical coordinates
18
allocate
(rfmt(
npcmtmax
,
natmtot
))
19
do
ias=1,
natmtot
20
is=
idxis
(ias)
21
nrc=
nrcmt
(is)
22
nrci=
nrcmti
(is)
23
ir=1
24
i=1
25
do
irc=1,nrci
26
t1=
rhocr
(ir,ias,1)*
y00
27
rfmt(i:i+
lmmaxi
-1,ias)=t1
28
ir=ir+
lradstp
29
i=i+
lmmaxi
30
end do
31
do
irc=nrci+1,nrc
32
t1=
rhocr
(ir,ias,1)*
y00
33
rfmt(i:i+
lmmaxo
-1,ias)=t1
34
ir=ir+
lradstp
35
i=i+
lmmaxo
36
end do
37
end do
38
! add to the ultra long-range density
39
call
holdthd
(
nqpt
,nthd)
40
!$OMP PARALLEL DO DEFAULT(SHARED) &
41
!$OMP PRIVATE(ias,is,npc) &
42
!$OMP SCHEDULE(DYNAMIC) &
43
!$OMP NUM_THREADS(nthd)
44
do
ir=1,
nqpt
45
do
ias=1,
natmtot
46
is=
idxis
(ias)
47
npc=
npcmt
(is)
48
rhormt
(1:npc,ias,ir)=
rhormt
(1:npc,ias,ir)+rfmt(1:npc,ias)
49
end do
50
end do
51
!$OMP END PARALLEL DO
52
call
freethd
(nthd)
53
deallocate
(rfmt)
54
end subroutine
55
modmain::npcmt
integer, dimension(maxspecies) npcmt
Definition:
modmain.f90:216
modmain::npcmtmax
integer npcmtmax
Definition:
modmain.f90:218
modmain::lmmaxo
integer lmmaxo
Definition:
modmain.f90:205
modmain::nqpt
integer nqpt
Definition:
modmain.f90:528
modomp
Definition:
modomp.f90:6
modmain::rhocr
real(8), dimension(:,:,:), allocatable rhocr
Definition:
modmain.f90:935
modmain
Definition:
modmain.f90:6
rhocoreu
subroutine rhocoreu
Definition:
rhocoreu.f90:7
modulr::rhormt
real(8), dimension(:,:,:), allocatable rhormt
Definition:
modulr.f90:52
modmain::lradstp
integer lradstp
Definition:
modmain.f90:173
modmain::idxis
integer, dimension(maxatoms *maxspecies) idxis
Definition:
modmain.f90:44
modmain::lmmaxi
integer lmmaxi
Definition:
modmain.f90:209
modomp::freethd
subroutine freethd(nthd)
Definition:
modomp.f90:112
modomp::holdthd
subroutine holdthd(nloop, nthd)
Definition:
modomp.f90:78
modmain::natmtot
integer natmtot
Definition:
modmain.f90:40
modmain::nrcmt
integer, dimension(maxspecies) nrcmt
Definition:
modmain.f90:175
modmain::nrcmti
integer, dimension(maxspecies) nrcmti
Definition:
modmain.f90:213
modulr
Definition:
modulr.f90:6
modmain::y00
real(8), parameter y00
Definition:
modmain.f90:1236
rhocoreu.f90
Generated by
1.8.14