The Elk Code
rhomagsh.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2009 J. K. Dewhurst, S. Sharma and E. K. U. Gross
3 ! This file is distributed under the terms of the GNU Lesser General Public
4 ! License. See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: rhomagsh
8 ! !INTERFACE:
9 subroutine rhomagsh
10 ! !USES:
11 use modmain
12 use modomp
13 ! !DESCRIPTION:
14 ! Converts the muffin-tin density and magnetisation from spherical coordinates
15 ! to a spherical harmonic expansion. See {\tt rhomagk}.
16 !
17 ! !REVISION HISTORY:
18 ! Created January 2009 (JKD)
19 !EOP
20 !BOC
21 implicit none
22 ! local variables
23 integer idm,is,ias,nthd
24 call holdthd(2*natmtot,nthd)
25 !$OMP PARALLEL DEFAULT(SHARED) &
26 !$OMP PRIVATE(ias,is,idm) &
27 !$OMP NUM_THREADS(nthd)
28 !$OMP DO SCHEDULE(DYNAMIC)
29 do ias=1,natmtot
30  is=idxis(ias)
31 ! convert the density to spherical harmonics
32  call rfshtip(nrcmt(is),nrcmti(is),rhomt(:,ias))
33 end do
34 !$OMP END DO NOWAIT
35 do idm=1,ndmag
36 !$OMP DO SCHEDULE(DYNAMIC)
37  do ias=1,natmtot
38  is=idxis(ias)
39 ! convert the magnetisation to spherical harmonics
40  call rfshtip(nrcmt(is),nrcmti(is),magmt(:,ias,idm))
41  end do
42 !$OMP END DO NOWAIT
43 end do
44 !$OMP END PARALLEL
45 call freethd(nthd)
46 end subroutine
47 !EOC
48 
subroutine rhomagsh
Definition: rhomagsh.f90:10
integer ndmag
Definition: modmain.f90:238
Definition: modomp.f90:6
real(8), dimension(:,:), pointer, contiguous rhomt
Definition: modmain.f90:614
real(8), dimension(:,:,:), pointer, contiguous magmt
Definition: modmain.f90:616
subroutine rfshtip(nr, nri, rfmt)
Definition: rfshtip.f90:7
integer, dimension(maxatoms *maxspecies) idxis
Definition: modmain.f90:44
subroutine freethd(nthd)
Definition: modomp.f90:106
subroutine holdthd(nloop, nthd)
Definition: modomp.f90:78
integer natmtot
Definition: modmain.f90:40
integer, dimension(maxspecies) nrcmt
Definition: modmain.f90:173
integer, dimension(maxspecies) nrcmti
Definition: modmain.f90:211