constants.f90 5.27 KB
Newer Older
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_constants
8 9
  use m_types_fleurinput_base
  IMPLICIT NONE
10

11
  TYPE,EXTENDS(t_fleurinput_base)::t_constants
12
   CONTAINS
13 14 15
     PROCEDURE:: read_xml=>read_xml_constants
     PROCEDURE:: mpi_bc=>mpi_bc_constants
  END TYPE t_constants
16

17 18 19 20 21 22 23 24 25 26 27 28
  REAL                        :: warp_factor=1.0  !should be set from input later
  INTEGER,          PARAMETER :: noState_const = 0
  INTEGER,          PARAMETER :: coreState_const = 1
  INTEGER,          PARAMETER :: valenceState_const = 2
  INTEGER,          PARAMETER :: lmaxU_const = 3
  REAL,             PARAMETER :: pi_const=3.1415926535897932
  REAL,             PARAMETER :: tpi_const=2.*3.1415926535897932
  REAL,             PARAMETER :: fpi_const=4.*3.1415926535897932
  REAL,             PARAMETER :: sfp_const=SQRT(4.*3.1415926535897932)
  COMPLEX,          PARAMETER :: ImagUnit=(0.0,1.0)
  REAL,             PARAMETER :: hartree_to_ev_const=27.21138602 ! value from 2014 CODATA recommended values. Uncertainty is 0.00000017
  REAL,             PARAMETER :: eVac0Default_const = -0.25
29 30
  CHARACTER(len=9), PARAMETER :: version_const = 'fleur 30'
  CHARACTER(len=49), PARAMETER :: version_const_MaX = '     MaX-Release 3.1          (www.max-centre.eu)'
31
  REAL, PARAMETER             :: boltzmann_const = 3.1668114e-6 ! value is given in Hartree/Kelvin
32

33 34 35 36 37 38 39
  INTEGER, PARAMETER :: POTDEN_TYPE_OTHER     = 0    ! POTDEN_TYPE <= 0 ==> undefined
  INTEGER, PARAMETER :: POTDEN_TYPE_POTTOT    = 1    ! 0 < POTDEN_TYPE <= 1000 ==> potential
  INTEGER, PARAMETER :: POTDEN_TYPE_POTCOUL   = 2
  INTEGER, PARAMETER :: POTDEN_TYPE_POTX      = 3
  INTEGER, PARAMETER :: POTDEN_TYPE_POTYUK    = 4
  INTEGER, PARAMETER :: POTDEN_TYPE_EnergyDen = 5
  INTEGER, PARAMETER :: POTDEN_TYPE_DEN       = 1001 ! 1000 < POTDEN_TYPE ==> density
40

41 42 43 44 45 46 47 48 49 50
  CHARACTER(2),DIMENSION(0:103),PARAMETER :: namat_const=(/&
       'va',' H','He','Li','Be',' B',' C',' N',' O',' F','Ne',&
       'Na','Mg','Al','Si',' P',' S','Cl','Ar',' K','Ca','Sc','Ti',&
       ' V','Cr','Mn','Fe','Co','Ni','Cu','Zn','Ga','Ge','As','Se',&
       'Br','Kr','Rb','Sr',' Y','Zr','Nb','Mo','Tc','Ru','Rh','Pd',&
       'Ag','Cd','In','Sn','Sb','Te',' I','Xe','Cs','Ba','La','Ce',&
       'Pr','Nd','Pm','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb',&
       'Lu','Hf','Ta',' W','Re','Os','Ir','Pt','Au','Hg','Tl','Pb',&
       'Bi','Po','At','Rn','Fr','Ra','Ac','Th','Pa',' U','Np','Pu',&
       'Am','Cm','Bk','Cf','Es','Fm','Md','No','Lw'/)
51

52 53 54 55 56 57 58
  CHARACTER(7),DIMENSION(29),PARAMETER :: coreStateList_const=(/&
       '(1s1/2)','(2s1/2)','(2p1/2)','(2p3/2)','(3s1/2)',&
       '(3p1/2)','(3p3/2)','(4s1/2)','(3d3/2)','(3d5/2)',&
       '(4p1/2)','(4p3/2)','(5s1/2)','(4d3/2)','(4d5/2)',&
       '(5p1/2)','(5p3/2)','(6s1/2)','(4f5/2)','(4f7/2)',&
       '(5d3/2)','(5d5/2)','(6p1/2)','(6p3/2)','(7s1/2)',&
       '(5f5/2)','(5f7/2)','(6d3/2)','(6d5/2)' /)
59

60 61 62
  INTEGER,DIMENSION(29),PARAMETER :: coreStateNumElecsList_const=(/& ! This is the number of electrons per spin
       1, 1, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 1, 2,&
       3, 1, 2, 1, 3, 4, 2, 3, 1, 2, 1, 3, 4, 2, 3/)
63

64 65 66 67 68 69
  INTEGER,DIMENSION(29),PARAMETER :: coreStateNprncList_const=(/&
       1, 2, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 5, 4, 4,&
       5, 5, 6, 4, 4, 5, 5, 6, 6, 7, 5, 5, 6, 6/)
  INTEGER,DIMENSION(29),PARAMETER :: coreStateKappaList_const=(/&
       -1,-1, 1,-2,-1, 1,-2,-1, 2,-3, 1,-2,-1, 2,-3,&
       1,-2,-1, 3,-4, 2,-3, 1,-2,-1, 3,-4, 2,-3/)
70

71
  CHARACTER(4),DIMENSION(6),PARAMETER :: nobleGasConfigList_const=(/'[He]','[Ne]','[Ar]','[Kr]','[Xe]','[Rn]'/)
72

73
  INTEGER,DIMENSION(6),PARAMETER :: nobleGasNumStatesList_const=(/1, 4, 7, 12, 17, 24/)
74

75
CONTAINS
76

77 78 79 80
  REAL PURE FUNCTION pimach()
    IMPLICIT NONE
    !  This subprogram supplies the value of the constant PI correct to
    !  machine precision where
81

82
    !  PI=3.1415926535897932384626433832795028841971693993751058209749446
83

84 85
    pimach = 3.1415926535897932
  END FUNCTION pimach
86

87 88 89
  REAL ELEMENTAL FUNCTION c_light(fac)
    IMPLICIT NONE
    !  This subprogram supplies the value of c according to
90
    !  NIST standard 13.1.99
91
    !  Hartree and Rydbergs changed by fac = 1.0 or 2.0
92

93 94 95 96
    REAL, INTENT (IN) :: fac
    c_light = 137.0359895e0 * fac * warp_factor
    !c_light = 1e6*fac
  END FUNCTION c_light
97

98 99 100 101
  SUBROUTINE  read_xml_constants(this,xml)
    USE m_types_xml
    CLASS(t_constants),INTENT(INout)::this
    TYPE(t_xml),INTENT(in)   ::xml
102

103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
    IF (xml%GetNumberOfNodes('/fleurInput/calculationSetup/expertModes/@warp_factor')==1)&
    warp_factor=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/expertModes/@warp_factor'))
  END SUBROUTINE read_xml_constants
  SUBROUTINE mpi_bc_constants(this,mpi_comm,irank)
    USE m_mpi_bc_tool
    CLASS(t_constants),INTENT(INOUT)::this
    INTEGER,INTENT(IN):: mpi_comm
    INTEGER,INTENT(IN),OPTIONAL::irank
    INTEGER ::rank
    IF (PRESENT(irank)) THEN
       rank=irank
    ELSE
       rank=0
    END IF
    CALL mpi_bc(warp_factor,rank,mpi_comm)
  END SUBROUTINE mpi_bc_constants
119
END MODULE m_constants