The Elk Code
 
Loading...
Searching...
No Matches
addbfsmu.f90
Go to the documentation of this file.
1
2! Copyright (C) 2019 T. Mueller, 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 addbfsmu
7use modmain
8use modulr
9implicit none
10! local variables
11integer idm,is,ias,npc
12real(8) t1
13! add the global fixed spin moment B-field to the Kohn-Sham field
14if (any(abs(fsmtype) == [1,3,4,6])) then
15 do idm=1,ndmag
16 t1=bfsmc(idm)
17 do ias=1,natmtot
18 is=idxis(ias)
19 npc=npcmt(is)
20 bsqmt(1:npc,ias,idm,1)=bsqmt(1:npc,ias,idm,1)+t1
21 end do
22 bsqir(1:ngtot,idm,1)=bsqir(1:ngtot,idm,1)+t1
23 end do
24end if
25! add the muffin-tin fields
26if (any(abs(fsmtype) == [2,3,5,6])) then
27 do idm=1,ndmag
28 do ias=1,natmtot
29 is=idxis(ias)
30 npc=npcmt(is)
31 t1=bfsmcmt(idm,ias)
32 bsqmt(1:npc,ias,idm,1)=bsqmt(1:npc,ias,idm,1)+t1
33 end do
34 end do
35end if
36end subroutine
37
subroutine addbfsmu
Definition addbfsmu.f90:7
integer ngtot
Definition modmain.f90:390
integer fsmtype
Definition modmain.f90:251
real(8), dimension(:,:), allocatable bfsmcmt
Definition modmain.f90:263
integer, dimension(maxatoms *maxspecies) idxis
Definition modmain.f90:44
real(8), dimension(3) bfsmc
Definition modmain.f90:257
integer natmtot
Definition modmain.f90:40
integer, dimension(maxspecies) npcmt
Definition modmain.f90:214
integer ndmag
Definition modmain.f90:238
complex(8), dimension(:,:,:,:), pointer, contiguous bsqmt
Definition modulr.f90:84
complex(8), dimension(:,:,:), pointer, contiguous bsqir
Definition modulr.f90:84