types_usdus.F90 2.56 KB
Newer Older
1 2 3 4 5 6 7 8
!--------------------------------------------------------------------------------
! 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_usdus
  TYPE t_usdus
9 10 11 12 13
     REAL,ALLOCATABLE,DIMENSION(:,:,:) CPP_MANAGED   :: us
     REAL,ALLOCATABLE,DIMENSION(:,:,:) CPP_MANAGED   :: dus
     REAL,ALLOCATABLE,DIMENSION(:,:,:) CPP_MANAGED   :: uds
     REAL,ALLOCATABLE,DIMENSION(:,:,:) CPP_MANAGED   :: duds !(0:lmaxd,ntype,jspd)
     REAL,ALLOCATABLE,DIMENSION(:,:,:) CPP_MANAGED   :: ddn  !(0:lmaxd,ntype,jspd)
14 15 16
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: ulos
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dulos
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: uulon
17 18 19 20 21
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dulon     ! (nlod,ntype,jspd)
     REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: uloulopn  ! (nlod,nlod,ntypd,jspd)
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: uuilon
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: duilon    ! (nlod,ntype,jspd)
     REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: ulouilopn ! (nlod,nlod,ntypd,jspd)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
   CONTAINS
     PROCEDURE :: init => usdus_init
  END TYPE t_usdus


 
CONTAINS
  SUBROUTINE usdus_init(ud,atoms,jsp)
    USE m_judft
    USE m_types_setup
    IMPLICIT NONE
    CLASS(t_usdus)           :: ud
    TYPE(t_atoms),INTENT(IN) :: atoms
    INTEGER,INTENT(IN)       :: jsp

37
    INTEGER :: err(13)
38 39 40 41 42 43 44 45
    ALLOCATE ( ud%uloulopn(atoms%nlod,atoms%nlod,atoms%ntype,jsp),stat=err(1) )
    ALLOCATE ( ud%ddn(0:atoms%lmaxd,atoms%ntype,jsp),stat=err(2) )
    ALLOCATE ( ud%us(0:atoms%lmaxd,atoms%ntype,jsp),stat=err(3))
    ALLOCATE ( ud%uds(0:atoms%lmaxd,atoms%ntype,jsp),stat=err(4) )
    ALLOCATE ( ud%dus(0:atoms%lmaxd,atoms%ntype,jsp),stat=err(5))
    ALLOCATE ( ud%duds(0:atoms%lmaxd,atoms%ntype,jsp),stat=err(6))
    ALLOCATE ( ud%ulos(atoms%nlod,atoms%ntype,jsp ),stat=err(7))
    ALLOCATE (ud%dulos(atoms%nlod,atoms%ntype,jsp ),stat=err(8) )
46
    ALLOCATE (ud%uulon(atoms%nlod,atoms%ntype,jsp ),stat=err(9))
47
    ALLOCATE (ud%dulon(atoms%nlod,atoms%ntype,jsp) ,stat=err(10))
48 49 50
    ALLOCATE (ud%uuilon(atoms%nlod,atoms%ntype,jsp),stat=err(11))
    ALLOCATE (ud%duilon(atoms%nlod,atoms%ntype,jsp),stat=err(12))
    ALLOCATE (ud%ulouilopn(atoms%nlod,atoms%nlod,atoms%ntype,jsp),stat=err(13))
51 52 53 54 55 56 57

    IF (ANY(err>0)) CALL judft_error("Not enough memory allocating usdus datatype")

  END SUBROUTINE usdus_init
  
 
END MODULE m_types_usdus