LCOV - code coverage report
Current view: top level - cdn_mt - magMoms.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 23 25 92.0 %
Date: 2019-09-08 04:53:50 Functions: 1 2 50.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2018 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             : 
       7             : MODULE m_magMoms
       8             : 
       9             : CONTAINS
      10             : 
      11         133 : SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,moments)
      12             : 
      13             :    USE m_types
      14             :    USE m_xmlOutput
      15             :    USE m_m_perp
      16             : 
      17             :    IMPLICIT NONE
      18             : 
      19             :    TYPE(t_dimension), INTENT(IN) :: dimension
      20             :    TYPE(t_input), INTENT(IN)     :: input
      21             :    TYPE(t_atoms), INTENT(IN)     :: atoms
      22             :    TYPE(t_noco), INTENT(INOUT)   :: noco
      23             :    TYPE(t_potden),INTENT(IN)     :: vTot
      24             :    TYPE(t_moments),INTENT(IN)    :: moments
      25             : 
      26             :    INTEGER                       :: iType, j, iRepAtom
      27             :    REAL                          :: sval,stot,scor,smom
      28             :    CHARACTER(LEN=20)             :: attributes(4)
      29             : 
      30         133 :    WRITE (6,FMT=8000)
      31         384 :    DO iType = 1,atoms%ntype
      32         251 :       sval = moments%svdn(iType,1) - moments%svdn(iType,input%jspins)
      33         251 :       stot = moments%stdn(iType,1) - moments%stdn(iType,input%jspins)
      34         251 :       scor = stot - sval
      35         384 :       WRITE (6,FMT=8010) iType,stot,sval,scor,moments%svdn(iType,1),moments%stdn(iType,1)
      36             :    END DO
      37             : 
      38             :    8000 FORMAT (/,/,10x,'spin density at the nucleus:',/,10x,'type',t25,&
      39             :                 'total',t42,'valence',t65,'core',t90,&
      40             :                 'majority valence and total density',/)
      41             :    8010 FORMAT (i13,2x,3e20.8,5x,2e20.8)
      42             : 
      43         133 :    WRITE (6,FMT=8020)
      44             :   
      45         133 :    CALL openXMLElement('magneticMomentsInMTSpheres',(/'units'/),(/'muBohr'/))
      46         133 :    iRepAtom = 1
      47         384 :    DO iType = 1, atoms%ntype
      48         251 :       smom = moments%chmom(iType,1) - moments%chmom(iType,input%jspins)
      49         251 :       WRITE (6,FMT=8030) iType,smom, (moments%chmom(iType,j),j=1,input%jspins)
      50        1255 :       attributes = ''
      51         251 :       WRITE(attributes(1),'(i0)') iType
      52         251 :       WRITE(attributes(2),'(f15.10)') smom
      53         251 :       WRITE(attributes(3),'(f15.10)') moments%chmom(iType,1)
      54         251 :       WRITE(attributes(4),'(f15.10)') moments%chmom(iType,2)
      55             :       CALL writeXMLElementFormPoly('magneticMoment',(/'atomType      ','moment        ','spinUpCharge  ',&
      56             :                                                       'spinDownCharge'/),&
      57         251 :                                    attributes,reshape((/8,6,12,14,6,15,15,15/),(/4,2/)))
      58             : 
      59         251 :       IF (noco%l_mperp) THEN
      60             :          !calculate the perpendicular part of the local moment
      61             :          !and relax the angle of the local moment or calculate
      62             :          !the constraint B-field.
      63           0 :          CALL m_perp(atoms,iType,iRepAtom,noco,vTot%mt(:,0,:,:),moments%chmom,moments%qa21)
      64             :       END IF
      65         384 :       iRepAtom= iRepAtom + atoms%neq(iType)
      66             :    END DO
      67         133 :    CALL closeXMLElement('magneticMomentsInMTSpheres')
      68             : 
      69             :    8020 FORMAT (/,/,2x,'-->  magnetic moments in the spheres:',/,2x,&
      70             :                 'mm -->   type',t22,'moment',t33,'spin-up',t43,'spin-down')
      71             :    8030 FORMAT (2x,'--> mm',i8,2x,3f12.5)
      72             : 
      73         133 : END SUBROUTINE magMoms
      74             : 
      75           0 : END MODULE m_magMoms

Generated by: LCOV version 1.13