types_usdus.F90 2.85 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
Uliana Alekseeva's avatar
Uliana Alekseeva committed
9 10 11 12 13 14 15
#ifdef CPP_GPU
     REAL,ALLOCATABLE,DIMENSION(:,:,:),MANAGED   :: us
     REAL,ALLOCATABLE,DIMENSION(:,:,:),MANAGED   :: dus
     REAL,ALLOCATABLE,DIMENSION(:,:,:),MANAGED   :: uds
     REAL,ALLOCATABLE,DIMENSION(:,:,:),MANAGED   :: duds !(0:lmaxd,ntype,jspd)
     REAL,ALLOCATABLE,DIMENSION(:,:,:),MANAGED   :: ddn  !(0:lmaxd,ntype,jspd)
#else
16 17 18 19 20
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: us
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dus
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: uds
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: duds !(0:lmaxd,ntype,jspd)
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: ddn  !(0:lmaxd,ntype,jspd)
Uliana Alekseeva's avatar
Uliana Alekseeva committed
21
#endif
22 23 24
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: ulos
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dulos
     REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: uulon
25 26 27 28 29
     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)
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
   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

45
    INTEGER :: err(13)
46 47 48 49 50 51 52 53
    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) )
54
    ALLOCATE (ud%uulon(atoms%nlod,atoms%ntype,jsp ),stat=err(9))
55
    ALLOCATE (ud%dulon(atoms%nlod,atoms%ntype,jsp) ,stat=err(10))
56 57 58
    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))
59 60 61 62 63 64 65

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

  END SUBROUTINE usdus_init
  
 
END MODULE m_types_usdus