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