types_hybrid.f90 4.17 KB
Newer Older
Daniel Wortmann's avatar
Daniel Wortmann committed
1 2 3 4 5 6 7
!--------------------------------------------------------------------------------
! 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_hybrid
Daniel Wortmann's avatar
Daniel Wortmann committed
8 9
  USE m_judft
  USE m_types_fleurinput_base
10 11
  IMPLICIT NONE
  PRIVATE
Daniel Wortmann's avatar
Daniel Wortmann committed
12 13
  
  TYPE,EXTENDS(t_fleurinput_base):: t_hybrid
Daniel Wortmann's avatar
Daniel Wortmann committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
      LOGICAL               ::  l_hybrid = .false.
      LOGICAL               ::  l_subvxc = .false.
      LOGICAL               ::  l_calhf = .false.
      LOGICAL               ::  l_addhf = .false.
      INTEGER               ::  ewaldlambda =3
      INTEGER               ::  lexp =16
      INTEGER               ::  bands1 !Only read in
      INTEGER               ::  nbasp
      INTEGER               ::  maxlcutm1
      INTEGER               ::  maxindxm1
      INTEGER               ::  maxbasm1
      INTEGER               ::  maxindxp1
      INTEGER               ::  maxgptm
      INTEGER               ::  maxgptm1
      INTEGER               ::  maxindx
      INTEGER               ::  maxlmindx
      INTEGER               ::  gptmd
      INTEGER, ALLOCATABLE   ::  nindx(:, :)
      INTEGER, ALLOCATABLE   ::  select1(:, :)
      INTEGER, ALLOCATABLE   ::  lcutm1(:)
      INTEGER, ALLOCATABLE   ::  nindxm1(:, :)
      INTEGER, ALLOCATABLE   ::  gptm(:, :)
      INTEGER, ALLOCATABLE   ::  ngptm1(:)
      INTEGER, ALLOCATABLE   ::  pgptm1(:, :)
      INTEGER, ALLOCATABLE   ::  ngptm(:)
      INTEGER, ALLOCATABLE   ::  pgptm(:, :)
      INTEGER, ALLOCATABLE   ::  lcutwf(:)
      INTEGER, ALLOCATABLE   ::  map(:, :)
      INTEGER, ALLOCATABLE   ::  tvec(:, :, :)
      INTEGER, ALLOCATABLE ::  nbasm(:)
      REAL                  ::  gcutm1
      REAL                  ::  tolerance1 = 1e-4 !only read in
      REAL, ALLOCATABLE   ::  basm1(:, :, :, :)
      COMPLEX, ALLOCATABLE   ::  d_wgn2(:, :, :, :)
      INTEGER, ALLOCATABLE   ::  ne_eig(:), nbands(:), nobd(:)                   !alloc in eigen_HF_init
      REAL, ALLOCATABLE   ::  div_vv(:, :, :)
50 51 52
    CONTAINS
      PROCEDURE :: read_xml =>read_xml_hybrid

Daniel Wortmann's avatar
Daniel Wortmann committed
53
   END TYPE t_hybrid
54 55 56
   PUBLIC t_hybrid

 CONTAINS
Daniel Wortmann's avatar
Daniel Wortmann committed
57
   SUBROUTINE read_xml_hybrid(this,xml)
58
     USE m_types_xml
Daniel Wortmann's avatar
Daniel Wortmann committed
59
     CLASS(t_hybrid),INTENT(out):: this
60 61 62 63 64 65 66
     TYPE(t_xml),INTENT(in)     :: xml
     
     
     INTEGER::numberNodes,ntype,itype
     CHARACTER(len=100)::xPathA

     ntype=xml%GetNumberOfNodes('/fleurInput/atomGroups/atomGroup')
Daniel Wortmann's avatar
Daniel Wortmann committed
67
     ALLOCATE(this%lcutm1(ntype),this%lcutwf(ntype),this%select1(4,ntype))
68 69
     numberNodes = xml%GetNumberOfNodes('/fleurInput/calculationSetup/prodBasis')
     IF (numberNodes==1) THEN
Daniel Wortmann's avatar
Daniel Wortmann committed
70 71 72 73 74
         this%gcutm1=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@gcutm'))
         this%tolerance1=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@tolerance'))
         this%ewaldlambda=evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@ewaldlambda'))
         this%lexp=evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@lexp'))
         this%bands1=evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@bands'))
75 76 77 78 79 80
      ENDIF

      DO itype=1,ntype
         xpatha=xml%SpeciesPath(itype)//'/prodBasis'
         numberNodes = xml%GetNumberOfNodes(TRIM(ADJUSTL(xPathA)))
         IF (numberNodes==1) THEN
Daniel Wortmann's avatar
Daniel Wortmann committed
81 82
            this%lcutm1(iType) =evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@lcutm'))
            this%lcutwf(iType) =evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@lcutwf'))
83
            xPathA=xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@select')
Daniel Wortmann's avatar
Daniel Wortmann committed
84 85 86 87
            this%select1(1,iType) = NINT(evaluateFirst(xPathA))
            this%select1(2,iType) = NINT(evaluateFirst(xPathA))
            this%select1(3,iType) = NINT(evaluateFirst(xPathA))
            this%select1(4,iType) = NINT(evaluateFirst(xPathA))
88
         ELSE
Daniel Wortmann's avatar
Daniel Wortmann committed
89
            this%lcutm1(iType) =-1
90 91 92
         ENDIF
      END DO
    END SUBROUTINE read_xml_hybrid
Daniel Wortmann's avatar
Daniel Wortmann committed
93
 END MODULE m_types_hybrid