File: potxc.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (77 lines) | stat: -rw-r--r-- 2,623 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
! This file is distributed under the terms of the GNU General Public License.
! See the file COPYING for license details.

!BOP
! !ROUTINE: potxc
! !INTERFACE:
subroutine potxc(tsh,xctype_,rhomt_,rhoir_,magmt_,magir_,taumt_,tauir_,exmt_, &
 exir_,ecmt_,ecir_,vxcmt_,vxcir_,bxcmt_,bxcir_,wxcmt_,wxcir_)
! !USES:
use modmain
use modomp
! !DESCRIPTION:
!   Computes the exchange-correlation potential and energy density. In the
!   muffin-tin, the density is transformed from spherical harmonic coefficients
!   $\rho_{lm}$ to spherical coordinates $(\theta,\phi)$ with a backward
!   spherical harmonic transformation (SHT). Once calculated, the
!   exchange-correlation potential and energy density are transformed with a
!   forward SHT.
!
! !REVISION HISTORY:
!   Created April 2003 (JKD)
!EOP
!BOC
implicit none
! arguments
logical, intent(in) :: tsh
integer, intent(in) :: xctype_(3)
real(8), intent(in) :: rhomt_(npmtmax,natmtot),rhoir_(ngtot)
real(8), intent(in) :: magmt_(npmtmax,natmtot,ndmag),magir_(ngtot,ndmag)
real(8), intent(in) :: taumt_(npmtmax,natmtot,nspinor),tauir_(ngtot,nspinor)
real(8), intent(out) :: exmt_(npmtmax,natmtot),exir_(ngtot)
real(8), intent(out) :: ecmt_(npmtmax,natmtot),ecir_(ngtot)
real(8), intent(out) :: vxcmt_(npmtmax,natmtot),vxcir_(ngtot)
real(8), intent(out) :: bxcmt_(npmtmax,natmtot,ndmag),bxcir_(ngtot,ndmag)
real(8), intent(out) :: wxcmt_(npmtmax,natmtot),wxcir_(ngtot)
! local variables
integer ias,nthd1,nthd2
call omp_hold(2,nthd1)
!$OMP PARALLEL SECTIONS DEFAULT(SHARED) &
!$OMP PRIVATE(ias) &
!$OMP NUM_THREADS(nthd1)
!$OMP SECTION
! muffin-tin exchange-correlation potential, field and energy density
call omp_hold(natmtot,nthd2)
!$OMP PARALLEL DEFAULT(SHARED) &
!$OMP NUM_THREADS(nthd2)
!$OMP DO
do ias=1,natmtot
  call potxcmt(tsh,ias,xctype_,rhomt_,magmt_,taumt_,exmt_,ecmt_,vxcmt_,bxcmt_, &
   wxcmt_)
end do
!$OMP END DO
!$OMP END PARALLEL
call omp_free(nthd2)
!$OMP SECTION
! interstitial exchange-correlation potential, field and energy density
call potxcir(xctype_,rhoir_,magir_,tauir_,exir_,ecir_,vxcir_,bxcir_,wxcir_)
!$OMP END PARALLEL SECTIONS
call omp_free(nthd1)
! symmetrise the exchange-correlation potential and magnetic field
if (tsh) then
  call omp_hold(2,nthd1)
!$OMP PARALLEL SECTIONS DEFAULT(SHARED) &
!$OMP NUM_THREADS(nthd1)
!$OMP SECTION
  call symrf(nrmt,nrmti,npmt,npmtmax,vxcmt_,vxcir_)
!$OMP SECTION
  if (spinpol) call symrvf(.true.,ncmag,nrmt,nrmti,npmt,npmtmax,bxcmt_,bxcir_)
!$OMP END PARALLEL SECTIONS
  call omp_free(nthd1)
end if
return
end subroutine
!EOC