mt_setup.F90 2.21 KB
Newer Older
1 2 3 4 5 6 7 8 9
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------

MODULE m_mt_setup

CONTAINS
10
  SUBROUTINE mt_setup(atoms,sym,sphhar,input,noco,enpara,inden,vTot,mpi,results,DIMENSION,td,ud)
11
    USE m_types
12 13 14
    USE m_usetup
    USE m_tlmplm_cholesky
    USE m_tlmplm_store
15
    USE m_spnorb
16 17 18 19 20 21 22 23 24 25
    IMPLICIT NONE
    TYPE(t_results),INTENT(INOUT):: results
    TYPE(t_mpi),INTENT(IN)       :: mpi
    TYPE(t_dimension),INTENT(IN) :: DIMENSION
    TYPE(t_enpara),INTENT(INOUT) :: enpara
    TYPE(t_input),INTENT(IN)     :: input
    TYPE(t_noco),INTENT(IN)      :: noco
    TYPE(t_sym),INTENT(IN)       :: sym  
    TYPE(t_sphhar),INTENT(IN)    :: sphhar
    TYPE(t_atoms),INTENT(IN)     :: atoms
26
    TYPE(t_potden),INTENT(IN)    :: inDen
27
    TYPE(t_potden),INTENT(INOUT) :: vTot
28 29 30 31 32 33
    TYPE(t_tlmplm),INTENT(INOUT) :: td
    TYPE(t_usdus),INTENT(INOUT)  :: ud

    INTEGER:: jsp

    IF ((atoms%n_u.GT.0)) THEN
34 35
       CALL u_setup(sym,atoms,sphhar,input,enpara%el0(0:,:,:),inDen,vTot,mpi,results)
    END IF
36 37 38

    CALL timestart("tlmplm")
    CALL td%init(DIMENSION%lmplmd,DIMENSION%lmd,atoms%ntype,atoms%lmaxd,atoms%llod,SUM(atoms%nlo),&
39
         DOT_PRODUCT(atoms%nlo,atoms%nlo+1)/2,MERGE(4,input%jspins,noco%l_mtNocoPot),&
40 41
         (noco%l_noco.AND.noco%l_soc.AND..NOT.noco%l_ss).OR.noco%l_constr)!l_offdiag

42
    DO jsp=1,MERGE(4,input%jspins,noco%l_mtNocoPot)
43
       !CALL tlmplm_cholesky(sphhar,atoms,DIMENSION,enpara, jsp,1,mpi,vTot%mt(:,0,1,jsp),input,vTot%mmpMat, td,ud)
44
       CALL tlmplm_cholesky(sphhar,atoms,noco,enpara,jsp,mpi,vTot,input,td,ud)
45
       IF (input%l_f) CALL write_tlmplm(td,vTot%mmpMat,atoms%n_u>0,jsp,jsp,input%jspins)
46 47 48 49
    END DO
    CALL timestop("tlmplm")

    !Setup of soc parameters for first-variation SOC
50
    IF (noco%l_soc.AND.noco%l_noco.AND..NOT.noco%l_ss) THEN
51
       CALL spnorb(atoms,noco,input,mpi,enpara,vTot%mt,ud,td%rsoc,.FALSE.)
52
    END IF
53 54 55

  END SUBROUTINE mt_setup
END MODULE m_mt_setup