The Elk Code
 
Loading...
Searching...
No Matches
potxc.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2005 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
6!BOP
7! !ROUTINE: potxc
8! !INTERFACE:
9subroutine potxc(tsh,xctype_,rhomt_,rhoir_,magmt_,magir_,taumt_,tauir_,exmt_, &
10 exir_,ecmt_,ecir_,vxcmt_,vxcir_,bxcmt_,bxcir_,wxcmt_,wxcir_)
11! !USES:
12use modmain
13use modomp
14! !DESCRIPTION:
15! Computes the exchange-correlation potential and energy density. In the
16! muffin-tin, the density is transformed from spherical harmonic coefficients
17! $\rho_{lm}$ to spherical coordinates $(\theta,\phi)$ with a backward
18! spherical harmonic transformation (SHT). Once calculated, the
19! exchange-correlation potential and energy density are transformed with a
20! forward SHT.
21!
22! !REVISION HISTORY:
23! Created April 2003 (JKD)
24!EOP
25!BOC
26implicit none
27! arguments
28logical, intent(in) :: tsh
29integer, intent(in) :: xctype_(3)
30real(8), intent(in) :: rhomt_(npmtmax,natmtot),rhoir_(ngtot)
31real(8), intent(in) :: magmt_(npmtmax,natmtot,ndmag),magir_(ngtot,ndmag)
32real(8), intent(in) :: taumt_(npmtmax,natmtot,nspinor),tauir_(ngtot,nspinor)
33real(8), intent(out) :: exmt_(npmtmax,natmtot),exir_(ngtot)
34real(8), intent(out) :: ecmt_(npmtmax,natmtot),ecir_(ngtot)
35real(8), intent(out) :: vxcmt_(npmtmax,natmtot),vxcir_(ngtot)
36real(8), intent(out) :: bxcmt_(npmtmax,natmtot,ndmag),bxcir_(ngtot,ndmag)
37real(8), intent(out) :: wxcmt_(npmtmax,natmtot),wxcir_(ngtot)
38! local variables
39integer ias,nthd
40call holdthd(natmtot+1,nthd)
41!$OMP PARALLEL DEFAULT(SHARED) &
42!$OMP NUM_THREADS(nthd)
43! muffin-tin exchange-correlation potential, field and energy density
44!$OMP DO SCHEDULE(DYNAMIC)
45do ias=1,natmtot
46 call potxcmt(tsh,ias,xctype_,rhomt_,magmt_,taumt_,exmt_,ecmt_,vxcmt_,bxcmt_, &
47 wxcmt_)
48end do
49!$OMP END DO NOWAIT
50! interstitial exchange-correlation potential, field and energy density
51!$OMP SINGLE
52call potxcir(xctype_,rhoir_,magir_,tauir_,exir_,ecir_,vxcir_,bxcir_,wxcir_)
53!$OMP END SINGLE
54! symmetrise the muffin-tin exchange-correlation potentials and magnetic fields
55if (tsh) then
56!$OMP SECTIONS
57!$OMP SECTION
58 call symrfmt(nrmt,nrmti,npmt,npmtmax,vxcmt_)
59!$OMP SECTION
60 if (spinpol) call symrvfmt(.true.,ncmag,nrmt,nrmti,npmt,npmtmax,bxcmt_)
61!$OMP END SECTIONS
62end if
63!$OMP END PARALLEL
64call freethd(nthd)
65end subroutine
66!EOC
67
integer, dimension(maxspecies) nrmti
Definition modmain.f90:211
logical ncmag
Definition modmain.f90:240
integer, dimension(maxspecies) nrmt
Definition modmain.f90:150
logical spinpol
Definition modmain.f90:228
integer, dimension(maxspecies) npmt
Definition modmain.f90:213
subroutine holdthd(nloop, nthd)
Definition modomp.f90:78
subroutine freethd(nthd)
Definition modomp.f90:106
subroutine potxc(tsh, xctype_, rhomt_, rhoir_, magmt_, magir_, taumt_, tauir_, exmt_, exir_, ecmt_, ecir_, vxcmt_, vxcir_, bxcmt_, bxcir_, wxcmt_, wxcir_)
Definition potxc.f90:11
subroutine potxcir(xctype_, rhoir_, magir_, tauir_, exir_, ecir_, vxcir_, bxcir_, wxcir_)
Definition potxcir.f90:8
subroutine potxcmt(tsh, ias, xctype_, rhomt_, magmt_, taumt_, exmt_, ecmt_, vxcmt_, bxcmt_, wxcmt_)
Definition potxcmt.f90:8
subroutine symrfmt(nrmt_, nrmti_, npmt_, ld, rfmt)
Definition symrfmt.f90:7
subroutine symrvfmt(tspin, tnc, nrmt_, nrmti_, npmt_, ld, rvfmt)
Definition symrvfmt.f90:7