The Elk Code
Loading...
Searching...
No Matches
torque.f90
Go to the documentation of this file.
1
2
! Copyright (C) 2017 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
torque
7
use
modmain
8
implicit none
9
! local variables
10
integer
idm
11
real
(8) torq(3)
12
! allocatable arrays
13
real
(8),
allocatable
:: rvfmt(:,:,:),rvfir(:,:)
14
! external functions
15
real
(8),
external
:: rfint
16
! initialise universal variables
17
call
init0
18
if
(.not.
ncmag
)
then
19
torq(:)=0.d0
20
goto
10
21
end if
22
! read magnetisation and exchange-correlation magnetic field from file
23
call
readstate
24
! compute m(r) x B_xc(r)
25
allocate
(rvfmt(
npmtmax
,
natmtot
,3),rvfir(
ngtot
,3))
26
call
rvfcross
(
magmt
,
magir
,
bxcmt
,
bxcir
,rvfmt,rvfir)
27
! integrate to find the total torque
28
do
idm=1,
ndmag
29
torq(idm)=
rfint
(rvfmt(:,:,idm),rvfir(:,idm))
30
end do
31
10
continue
32
write
(*,*)
33
write
(*,
'("Info(torque):")'
)
34
write
(*,
'(" Total torque exerted by B_xc on the magnetisation :")'
)
35
write
(*,
'(3G18.10)'
) torq
36
end subroutine
37
init0
subroutine init0
Definition
init0.f90:10
modmain
Definition
modmain.f90:6
modmain::bxcmt
real(8), dimension(:,:,:), allocatable bxcmt
Definition
modmain.f90:636
modmain::ngtot
integer ngtot
Definition
modmain.f90:390
modmain::ncmag
logical ncmag
Definition
modmain.f90:240
modmain::magmt
real(8), dimension(:,:,:), pointer, contiguous magmt
Definition
modmain.f90:616
modmain::bxcir
real(8), dimension(:,:), allocatable bxcir
Definition
modmain.f90:636
modmain::natmtot
integer natmtot
Definition
modmain.f90:40
modmain::magir
real(8), dimension(:,:), pointer, contiguous magir
Definition
modmain.f90:616
modmain::npmtmax
integer npmtmax
Definition
modmain.f90:216
modmain::ndmag
integer ndmag
Definition
modmain.f90:238
readstate
subroutine readstate
Definition
readstate.f90:10
rfint
real(8) function rfint(rfmt, rfir)
Definition
rfint.f90:7
rvfcross
subroutine rvfcross(rvfmt1, rvfir1, rvfmt2, rvfir2, rvfmt3, rvfir3)
Definition
rvfcross.f90:10
torque
subroutine torque
Definition
torque.f90:7
torque.f90
Generated by
1.9.8