types_tlmplm.F90 3.11 KB
Newer Older
Daniel Wortmann's avatar
Daniel Wortmann committed
1 2 3 4 5 6 7 8 9 10 11 12 13
!--------------------------------------------------------------------------------
! 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_types_tlmplm
  IMPLICIT NONE
  PRIVATE
  TYPE t_rsoc
     REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: rsopp,rsoppd,rsopdp,rsopdpd     !(atoms%ntype,atoms%lmaxd,2,2)
     REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: rsoplop,rsoplopd,rsopdplo,rsopplo!(atoms%ntype,atoms%nlod,2,2)
     REAL,ALLOCATABLE,DIMENSION(:,:,:,:,:) :: rsoploplop !(atoms%ntype,atoms%nlod,nlod,2,2)
14
     COMPLEX,ALLOCATABLE,DIMENSION(:,:,:,:,:,:)::soangl
Daniel Wortmann's avatar
Daniel Wortmann committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
  END TYPE t_rsoc

    TYPE t_tlmplm
     COMPLEX,ALLOCATABLE :: tdd(:,:,:)
     COMPLEX,ALLOCATABLE :: tdu(:,:,:)
     !(0:lmplmd,ntypd,tspin)
     COMPLEX,ALLOCATABLE :: tud(:,:,:)
     COMPLEX,ALLOCATABLE :: tuu(:,:,:)
     !(0:lmplmd,ntypd,tspin)
     INTEGER,ALLOCATABLE :: ind(:,:,:,:)
     !(0:lmd,0:lmd,ntypd,tspin)
     COMPLEX,ALLOCATABLE :: tdulo(:,:,:,:)
     !(0:lmd,-llod:llod,mlotot,tspin)
     COMPLEX,ALLOCATABLE :: tuulo(:,:,:,:)
     !(0:lmd,-llod:llod,mlotot,tspin)
     COMPLEX,ALLOCATABLE :: tuloulo(:,:,:,:)
     !(-llod:llod,-llod:llod,mlolotot,tspin)
     COMPLEX,ALLOCATABLE :: h_loc(:,:,:,:)
     COMPLEX,ALLOCATABLE :: h_off(:,:,:,:)
34
     REAL,ALLOCATABLE    :: e_shift(:,:)
Daniel Wortmann's avatar
Daniel Wortmann committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
     TYPE(t_rsoc)        :: rsoc
   CONTAINS
     PROCEDURE,PASS :: init => tlmplm_init
  END TYPE t_tlmplm
  PUBLIC t_tlmplm,t_rsoc
CONTAINS
  SUBROUTINE tlmplm_init(td,lmplmd,lmd,ntype,lmaxd,llod,mlotot,mlolotot,jspins,l_offdiag)
    USE m_judft
    CLASS(t_tlmplm),INTENT(INOUT):: td
    INTEGER,INTENT(in)           :: lmplmd,lmd,ntype,lmaxd,llod,mlotot,mlolotot,jspins
    LOGICAL,INTENT(IN)           :: l_offdiag
    INTEGER :: err

    IF (ALLOCATED(td%tuu)) &
         DEALLOCATE(td%tuu,td%tud,td%tdd,td%tdu,td%tdulo,td%tuulo,&
         td%tuloulo,td%ind,td%h_loc,td%e_shift,td%h_off)
    ALLOCATE(td%tuu(0:lmplmd,ntype,jspins),stat=err)
    ALLOCATE(td%tud(0:lmplmd,ntype,jspins),stat=err)
    ALLOCATE(td%tdd(0:lmplmd,ntype,jspins),stat=err)
    ALLOCATE(td%tdu(0:lmplmd,ntype,jspins),stat=err)
    ALLOCATE(td%tdulo(0:lmd,-llod:llod,mlotot,jspins),stat=err)
    ALLOCATE(td%tuulo(0:lmd,-llod:llod,mlotot,jspins),stat=err)
    ALLOCATE(td%tuloulo(-llod:llod,-llod:llod,MAX(mlolotot,1),jspins), stat=err)
    ALLOCATE(td%ind(0:lmd,0:lmd,ntype,jspins),stat=err )
    ALLOCATE(td%h_loc(0:2*lmaxd*(lmaxd+2)+1,0:2*lmaxd*(lmaxd+2)+1,ntype,jspins))
60
    ALLOCATE(td%e_shift(ntype,jspins))
Daniel Wortmann's avatar
Daniel Wortmann committed
61 62 63 64 65 66 67 68 69 70 71 72 73
    IF (l_offdiag) THEN
       ALLOCATE(td%h_off(0:2*lmaxd+1,0:2*lmaxd+1,ntype,2))
    ELSE
       ALLOCATE(td%h_off(1,1,1,1))
    END IF
    IF (err.NE.0) THEN
       WRITE (*,*) 'an error occured during allocation of'
       WRITE (*,*) 'the tlmplm%tuu, tlmplm%tdd etc.: ',err,'  size: ',mlotot
       CALL juDFT_error("eigen: Error during allocation of tlmplm, tdd  etc.",calledby ="types_tlmplm")
    ENDIF
  END SUBROUTINE tlmplm_init
    
END MODULE m_types_tlmplm