The Elk Code
rhomag.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2010 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 rhomag
7 use modmain
8 use modmpi
9 use modomp
10 implicit none
11 ! local variables
12 integer nthd
13 ! calculate the valence density and magnetisation
14 call rhomagv
15 ! add the core density and magnetisation to the total
16 call rhocore
17 call holdthd(2,nthd)
18 !$OMP PARALLEL SECTIONS DEFAULT(SHARED) &
19 !$OMP NUM_THREADS(nthd)
20 !$OMP SECTION
21 ! calculate the charges
22 call charge
23 ! normalise the density
24 call rhonorm
25 !$OMP SECTION
26 ! calculate the moments
27 if (spinpol) call moment
28 !$OMP END PARALLEL SECTIONS
29 call freethd(nthd)
30 ! synchronise MPI processes
31 call mpi_barrier(mpicom,ierror)
32 end subroutine
33 
subroutine charge
Definition: charge.f90:10
logical spinpol
Definition: modmain.f90:228
subroutine rhocore
Definition: rhocore.f90:10
Definition: modomp.f90:6
subroutine rhomag
Definition: rhomag.f90:7
subroutine rhomagv
Definition: rhomagv.f90:7
subroutine rhonorm
Definition: rhonorm.f90:10
subroutine moment
Definition: moment.f90:10
Definition: modmpi.f90:6
subroutine freethd(nthd)
Definition: modomp.f90:106
subroutine holdthd(nloop, nthd)
Definition: modomp.f90:78
integer mpicom
Definition: modmpi.f90:11
integer ierror
Definition: modmpi.f90:19