LCOV - code coverage report
Current view: top level - vgen - b_field.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 2 11 18.2 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          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         340 :   SUBROUTINE bfield(input,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             :     IMPLICIT NONE
      15             :     TYPE(t_input),INTENT(IN)::input
      16             :     TYPE(t_noco),INTENT(IN) ::noco
      17             :     TYPE(t_atoms),INTENT(IN)::atoms
      18             :     TYPE(t_field),INTENT(IN)::field
      19             :     TYPE(t_potden),INTENT(INOUT)::vtot
      20             : 
      21             :     INTEGER :: n
      22             : 
      23             :     
      24         340 :     IF (.NOT.field%l_b_field) RETURN !no B-field specified
      25             : 
      26           0 :     IF (input%jspins.NE.2) CALL judft_error("B-fields can only be used in spin-polarized calculations")
      27           0 :     IF (noco%l_noco) CALL judft_error("B-fields not implemented in noco case")
      28             :     
      29             :     !Interstitial
      30           0 :     vTot%pw(1,1)=vTot%pw(1,1)-field%b_field/2.
      31           0 :     vTot%pw(1,2)=vTot%pw(1,2)+field%b_field/2.
      32             : 
      33             :     !MT-spheres
      34           0 :     DO n=1,atoms%ntype
      35           0 :        vTot%mt(:,0,n,1)=vTot%mt(:,0,n,1)-(field%b_field+field%b_field_mt(n))/2.
      36           0 :        vTot%mt(:,0,n,2)=vTot%mt(:,0,n,2)+(field%b_field+field%b_field_mt(n))/2.
      37             :     ENDDO
      38             : 
      39             :     !Vacuum
      40           0 :     vTot%vacz(:,:,1)=vTot%vacz(:,:,1)-field%b_field/2.
      41           0 :     vTot%vacz(:,:,2)=vTot%vacz(:,:,2)+field%b_field/2.
      42             :   END SUBROUTINE bfield
      43             : END MODULE m_bfield

Generated by: LCOV version 1.13