Line data Source code
1 : !--------------------------------------------------------------------------------
2 : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
3 : ! This file is part of FLEUR and available as free software under the conditions
4 : ! of the MIT license as expressed in the LICENSE file in more detail.
5 : !--------------------------------------------------------------------------------
6 : MODULE m_bfield
7 : USE m_juDFT
8 : CONTAINS
9 688 : SUBROUTINE bfield(input,stars,noco,atoms,field,vTot)
10 : !This subroutine adds a Zeeman-field to the potential
11 : !field%b_field is the field applied everywhere
12 : !field%b_field_mt is the field specific to the MT-sphere of a single atom type
13 : USE m_types
14 : USE m_constants
15 : IMPLICIT NONE
16 : TYPE(t_input),INTENT(IN)::input
17 : TYPE(t_noco),INTENT(IN) ::noco
18 : TYPE(t_stars),INTENT(IN) :: stars
19 : TYPE(t_atoms),INTENT(IN)::atoms
20 : TYPE(t_field),INTENT(IN)::field
21 : TYPE(t_potden),INTENT(INOUT)::vtot
22 :
23 : INTEGER :: n
24 :
25 :
26 688 : IF (.NOT.field%l_b_field) RETURN !no B-field specified
27 :
28 0 : IF (input%jspins.NE.2) CALL judft_error("B-fields can only be used in spin-polarized calculations")
29 0 : IF (noco%l_noco) CALL judft_error("B-fields not implemented in noco case")
30 :
31 : !Interstitial
32 0 : vTot%pw_w(:,1)=vTot%pw_w(:,1)-((field%b_field/2.0)*stars%ustep(:))
33 0 : vTot%pw_w(:,2)=vTot%pw_w(:,2)+((field%b_field/2.0)*stars%ustep(:))
34 :
35 : !MT-spheres
36 0 : DO n=1,atoms%ntype
37 0 : vTot%mt(:atoms%jri(n),0,n,1)=vTot%mt(:atoms%jri(n),0,n,1)-(field%b_field+field%b_field_mt(n))/2.*atoms%rmsh(:atoms%jri(n),n)/sfp_const
38 0 : vTot%mt(:atoms%jri(n),0,n,2)=vTot%mt(:atoms%jri(n),0,n,2)+(field%b_field+field%b_field_mt(n))/2.*atoms%rmsh(:atoms%jri(n),n)/sfp_const
39 : ENDDO
40 :
41 : !Vacuum
42 0 : vTot%vac(:,1,:,1)=vTot%vac(:,1,:,1)-field%b_field/2.
43 0 : vTot%vac(:,1,:,2)=vTot%vac(:,1,:,2)+field%b_field/2.
44 : END SUBROUTINE bfield
45 : END MODULE m_bfield
|