LCOV - code coverage report
Current view: top level - src - input_cp2k_xc.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4c33f95) Lines: 615 615 100.0 %
Date: 2025-01-30 06:53:08 Functions: 8 8 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2025 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \brief function that build the xc section of the input
      10             : !> \par History
      11             : !>      10.2009 moved out of input_cp2k_dft [jgh]
      12             : !> \author fawzi
      13             : ! **************************************************************************************************
      14             : MODULE input_cp2k_xc
      15             :    USE bibliography,                    ONLY: &
      16             :         Becke1988, Becke1997, BeckeRoussel1989, Caldeweyher2020, Goedecker1996, Grimme2006, &
      17             :         Grimme2010, Grimme2011, Heyd2004, Kruse2012, Lee1988, Ortiz1994, Perdew1981, Perdew1996, &
      18             :         Perdew2008, Proynov2007, Tao2003, Tran2013, Vosko1980, Wellendorff2012, Zhang1998
      19             :    USE cp_output_handling,              ONLY: add_last_numeric,&
      20             :                                               cp_print_key_section_create,&
      21             :                                               high_print_level
      22             :    USE eeq_input,                       ONLY: create_eeq_control_section
      23             :    USE input_constants,                 ONLY: &
      24             :         do_adiabatic_hybrid_mcy3, do_adiabatic_model_pade, fxc_funct_gga, fxc_funct_lda, &
      25             :         fxc_funct_pade, fxc_none, gaussian, slater, vdw_nl_drsll, vdw_nl_lmkll, vdw_nl_rvv10, &
      26             :         vdw_pairpot_dftd2, vdw_pairpot_dftd3, vdw_pairpot_dftd3bj, vdw_pairpot_dftd4, &
      27             :         xc_funct_b3lyp, xc_funct_beefvdw, xc_funct_blyp, xc_funct_bp, xc_funct_hcth120, &
      28             :         xc_funct_no_shortcut, xc_funct_olyp, xc_funct_pade, xc_funct_pbe, xc_funct_pbe0, &
      29             :         xc_funct_tpss, xc_none, xc_pot_energy_none, xc_pot_energy_sum_eigenvalues, &
      30             :         xc_pot_energy_xc_functional, xc_vdw_fun_none, xc_vdw_fun_nonloc, xc_vdw_fun_pairpot
      31             :    USE input_cp2k_hfx,                  ONLY: create_hfx_section
      32             :    USE input_cp2k_mp2,                  ONLY: create_mp2_section
      33             :    USE input_keyword_types,             ONLY: keyword_create,&
      34             :                                               keyword_release,&
      35             :                                               keyword_type
      36             :    USE input_section_types,             ONLY: section_add_keyword,&
      37             :                                               section_add_subsection,&
      38             :                                               section_create,&
      39             :                                               section_release,&
      40             :                                               section_type
      41             :    USE input_val_types,                 ONLY: char_t,&
      42             :                                               integer_t,&
      43             :                                               real_t
      44             :    USE kinds,                           ONLY: dp
      45             :    USE string_utilities,                ONLY: s2a
      46             :    USE xc_input_constants,              ONLY: &
      47             :         c_pw92, c_pw92dmc, c_pw92vmc, c_pz, c_pzdmc, c_pzvmc, do_vwn3, do_vwn5, ke_lc, ke_llp, &
      48             :         ke_ol1, ke_ol2, ke_pbe, ke_pw86, ke_pw91, ke_t92, pz_orig, xalpha, xc_b97_3c, &
      49             :         xc_b97_grimme, xc_b97_mardirossian, xc_b97_orig, xc_debug_new_routine, &
      50             :         xc_default_f_routine, xc_deriv_collocate, xc_deriv_nn10_smooth, xc_deriv_nn50_smooth, &
      51             :         xc_deriv_pw, xc_deriv_spline2, xc_deriv_spline2_smooth, xc_deriv_spline3, &
      52             :         xc_deriv_spline3_smooth, xc_pbe_orig, xc_pbe_rev, xc_pbe_sol, xc_rho_nn10, xc_rho_nn50, &
      53             :         xc_rho_no_smooth, xc_rho_spline2_smooth, xc_rho_spline3_smooth, xc_test_lsd_f_routine, &
      54             :         xgga_b88x, xgga_ev93, xgga_opt, xgga_pbex, xgga_pw86, xgga_pw91, xgga_revpbe
      55             :    USE xc_libxc,                        ONLY: libxc_add_sections
      56             : #include "./base/base_uses.f90"
      57             : 
      58             :    IMPLICIT NONE
      59             :    PRIVATE
      60             : 
      61             :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      62             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_xc'
      63             : 
      64             :    PUBLIC :: create_xc_section, create_xc_fun_section
      65             : 
      66             : CONTAINS
      67             : 
      68             : ! **************************************************************************************************
      69             : !> \brief creates the structure of the section needed to select the xc functional
      70             : !> \param section the section that will be created
      71             : !> \author fawzi
      72             : ! **************************************************************************************************
      73       73712 :    SUBROUTINE create_xc_fun_section(section)
      74             :       TYPE(section_type), POINTER                        :: section
      75             : 
      76             :       TYPE(keyword_type), POINTER                        :: keyword
      77             :       TYPE(section_type), POINTER                        :: subsection
      78             : 
      79       73712 :       CPASSERT(.NOT. ASSOCIATED(section))
      80             :       CALL section_create(section, __LOCATION__, name="xc_functional", &
      81             :                           description="The eXchange-Correlation functional to use. In case of hybrid functionals, all scaling "// &
      82             :                           "parameters and potential types have to be specified in the HF section except from a few "// &
      83             :                           "predefined combinations (see _SECTION_PARAMETERS_ below). CP2K does NOT set it up "// &
      84             :                           "automatically not even for LibXC functionals.", &
      85             :                           n_keywords=0, n_subsections=4, repeats=.FALSE., &
      86             :                           citations=(/Ortiz1994, Becke1988, Perdew1996, Zhang1998, Lee1988, &
      87             :                                       Heyd2004, Vosko1980, Goedecker1996, Perdew1981, &
      88      884544 :                                       Tao2003, Wellendorff2012/))
      89             : 
      90       73712 :       NULLIFY (subsection, keyword)
      91             :       CALL keyword_create( &
      92             :          keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
      93             :          description="Shortcut for the most common functional combinations. These make use of the implementations provided by "// &
      94             :          "native CP2K (without LibXC). In case of hybrid functionals (B3LYP, PBE0), set the "// &
      95             :          "accuracy-related and system-dependent parameters in the HF section (especially MAX_MEMORY, EPS_SCHWARZ, "// &
      96             :          "CUTOFF_RADIUS, POTENTIAL_TYPE) as these are not set automatically.", &
      97             :          usage="&xc_functional BLYP", &
      98             :          enum_c_vals=s2a("B3LYP", "PBE0", "BLYP", "BP", "PADE", "LDA", "PBE", &
      99             :                          "TPSS", "HCTH120", "OLYP", "BEEFVDW", "NO_SHORTCUT", "NONE"), &
     100             :          enum_i_vals=(/xc_funct_b3lyp, xc_funct_pbe0, xc_funct_blyp, xc_funct_bp, xc_funct_pade, xc_funct_pade, xc_funct_pbe, &
     101             :                        xc_funct_tpss, xc_funct_hcth120, xc_funct_olyp, xc_funct_beefvdw, xc_funct_no_shortcut, xc_none/), &
     102             :          enum_desc=s2a("B3LYP", &
     103             :                        "PBE0 (see note in section XC/XC_FUNCTIONAL/PBE)", &
     104             :                        "BLYP", "BP", "PADE", "Alias for PADE", &
     105             :                        "PBE (see note in section XC/XC_FUNCTIONAL/PBE)", &
     106             :                        "TPSS (not available with LSD, use LIBXC version instead)", "HCTH120", "OLYP", &
     107             :                        "BEEFVDW", "NO_SHORTCUT", "NONE"), &
     108             :          default_i_val=xc_funct_no_shortcut, &
     109       73712 :          lone_keyword_i_val=xc_funct_no_shortcut)
     110       73712 :       CALL section_add_keyword(section, keyword)
     111       73712 :       CALL keyword_release(keyword)
     112             : 
     113             :       CALL section_create(subsection, __LOCATION__, name="BECKE88", &
     114             :                           description="Uses the Becke 88 exchange functional", &
     115             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     116      147424 :                           citations=(/Becke1988/))
     117             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     118             :                           description="activates the functional", &
     119       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     120       73712 :       CALL section_add_keyword(subsection, keyword)
     121       73712 :       CALL keyword_release(keyword)
     122             :       CALL keyword_create( &
     123             :          keyword, __LOCATION__, name="scale_x", &
     124             :          description="scales the exchange part of the functional", &
     125       73712 :          default_r_val=1._dp)
     126       73712 :       CALL section_add_keyword(subsection, keyword)
     127       73712 :       CALL keyword_release(keyword)
     128             : 
     129       73712 :       CALL section_add_subsection(section, subsection)
     130       73712 :       CALL section_release(subsection)
     131             : 
     132             :       CALL section_create(subsection, __LOCATION__, name="LYP_ADIABATIC", &
     133             :                           description="Uses the LYP correlation functional in an adiabatic fashion", &
     134             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     135      147424 :                           citations=(/Lee1988/))
     136             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     137             :                           description="activates the functional", &
     138       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     139       73712 :       CALL section_add_keyword(subsection, keyword)
     140       73712 :       CALL keyword_release(keyword)
     141             :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
     142             :                           description="Defines the parameter of the adiabatic curve.", &
     143       73712 :                           default_r_val=1._dp)
     144       73712 :       CALL section_add_keyword(subsection, keyword)
     145       73712 :       CALL keyword_release(keyword)
     146             : 
     147       73712 :       CALL section_add_subsection(section, subsection)
     148       73712 :       CALL section_release(subsection)
     149             : 
     150             :       CALL section_create(subsection, __LOCATION__, name="BECKE88_LR_ADIABATIC", &
     151             :                           description="Uses the Becke 88 longrange exchange functional in an adiabatic fashion", &
     152             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     153      147424 :                           citations=(/Becke1988/))
     154             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     155             :                           description="activates the functional", &
     156       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     157       73712 :       CALL section_add_keyword(subsection, keyword)
     158       73712 :       CALL keyword_release(keyword)
     159             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     160             :                           description="scales the exchange part of the functional", &
     161       73712 :                           default_r_val=1._dp)
     162       73712 :       CALL section_add_keyword(subsection, keyword)
     163       73712 :       CALL keyword_release(keyword)
     164             :       CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
     165             :                           description="Potential parameter in erf(omega*r)/r", &
     166       73712 :                           default_r_val=1._dp)
     167       73712 :       CALL section_add_keyword(subsection, keyword)
     168       73712 :       CALL keyword_release(keyword)
     169             :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
     170             :                           description="Defines the parameter of the adiabatic curve", &
     171       73712 :                           default_r_val=1._dp)
     172       73712 :       CALL section_add_keyword(subsection, keyword)
     173       73712 :       CALL keyword_release(keyword)
     174             : 
     175       73712 :       CALL section_add_subsection(section, subsection)
     176       73712 :       CALL section_release(subsection)
     177             : 
     178             :       CALL section_create(subsection, __LOCATION__, name="BECKE88_LR", &
     179             :                           description="Uses the Becke 88 longrange exchange functional", &
     180             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     181      147424 :                           citations=(/Becke1988/))
     182             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     183             :                           description="activates the functional", &
     184       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     185       73712 :       CALL section_add_keyword(subsection, keyword)
     186       73712 :       CALL keyword_release(keyword)
     187             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     188             :                           description="scales the exchange part of the functional", &
     189       73712 :                           default_r_val=1._dp)
     190       73712 :       CALL section_add_keyword(subsection, keyword)
     191       73712 :       CALL keyword_release(keyword)
     192             :       CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
     193             :                           description="Potential parameter in erf(omega*r)/r", &
     194       73712 :                           default_r_val=1._dp)
     195       73712 :       CALL section_add_keyword(subsection, keyword)
     196       73712 :       CALL keyword_release(keyword)
     197             : 
     198       73712 :       CALL section_add_subsection(section, subsection)
     199       73712 :       CALL section_release(subsection)
     200             : 
     201             :       CALL section_create(subsection, __LOCATION__, name="LYP", &
     202             :                           description="Uses the LYP functional", &
     203             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     204      147424 :                           citations=(/Lee1988/))
     205             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     206             :                           description="activates the functional", &
     207       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     208       73712 :       CALL section_add_keyword(subsection, keyword)
     209       73712 :       CALL keyword_release(keyword)
     210             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     211             :                           description="scales the correlation part of the functional", &
     212       73712 :                           default_r_val=1._dp)
     213       73712 :       CALL section_add_keyword(subsection, keyword)
     214       73712 :       CALL keyword_release(keyword)
     215       73712 :       CALL section_add_subsection(section, subsection)
     216       73712 :       CALL section_release(subsection)
     217             : 
     218             :       CALL section_create(subsection, __LOCATION__, name="PADE", &
     219             :                           description="Uses the PADE functional", &
     220             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     221      147424 :                           citations=(/Goedecker1996/))
     222             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     223             :                           description="activates the functional", &
     224       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     225       73712 :       CALL section_add_keyword(subsection, keyword)
     226       73712 :       CALL keyword_release(keyword)
     227       73712 :       CALL section_add_subsection(section, subsection)
     228       73712 :       CALL section_release(subsection)
     229             : 
     230             :       CALL section_create(subsection, __LOCATION__, name="HCTH", &
     231             :                           description="Uses the HCTH class of functionals", &
     232       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     233             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_SET", &
     234             :                           description="Which version of the parameters should be used", &
     235             :                           usage="PARAMETER_SET 407", &
     236             :                           enum_c_vals=(/"93 ", "120", "147", "407", "HLE"/), &
     237             :                           enum_i_vals=(/93, 120, 147, 407, 408/), &
     238      442272 :                           default_i_val=120)
     239       73712 :       CALL section_add_keyword(subsection, keyword)
     240       73712 :       CALL keyword_release(keyword)
     241             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     242             :                           description="activates the functional", &
     243       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     244       73712 :       CALL section_add_keyword(subsection, keyword)
     245       73712 :       CALL keyword_release(keyword)
     246       73712 :       CALL section_add_subsection(section, subsection)
     247       73712 :       CALL section_release(subsection)
     248             : 
     249             :       CALL section_create(subsection, __LOCATION__, name="OPTX", &
     250             :                           description="Uses the OPTX functional", &
     251       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     252             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     253             :                           description="activates the functional", &
     254       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     255       73712 :       CALL section_add_keyword(subsection, keyword)
     256       73712 :       CALL keyword_release(keyword)
     257             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     258             :                           description="scales the exchange part of the functional", &
     259       73712 :                           default_r_val=1._dp)
     260       73712 :       CALL section_add_keyword(subsection, keyword)
     261       73712 :       CALL keyword_release(keyword)
     262             :       CALL keyword_create(keyword, __LOCATION__, name="a1", &
     263             :                           description="OPTX a1 coefficient", &
     264       73712 :                           default_r_val=1.05151_dp)
     265       73712 :       CALL section_add_keyword(subsection, keyword)
     266       73712 :       CALL keyword_release(keyword)
     267             :       CALL keyword_create(keyword, __LOCATION__, name="a2", &
     268             :                           description="OPTX a2 coefficient", &
     269       73712 :                           default_r_val=1.43169_dp)
     270       73712 :       CALL section_add_keyword(subsection, keyword)
     271       73712 :       CALL keyword_release(keyword)
     272             :       CALL keyword_create(keyword, __LOCATION__, name="gamma", &
     273             :                           description="OPTX gamma coefficient", &
     274       73712 :                           default_r_val=0.006_dp)
     275       73712 :       CALL section_add_keyword(subsection, keyword)
     276       73712 :       CALL keyword_release(keyword)
     277       73712 :       CALL section_add_subsection(section, subsection)
     278       73712 :       CALL section_release(subsection)
     279             : 
     280       73712 :       CALL libxc_add_sections(section)
     281             : 
     282             :       CALL section_create(subsection, __LOCATION__, name="CS1", &
     283             :                           description="Uses the CS1 functional", &
     284       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     285             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     286             :                           description="activates the functional", &
     287       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     288       73712 :       CALL section_add_keyword(subsection, keyword)
     289       73712 :       CALL keyword_release(keyword)
     290       73712 :       CALL section_add_subsection(section, subsection)
     291       73712 :       CALL section_release(subsection)
     292             : 
     293             :       CALL section_create(subsection, __LOCATION__, name="XGGA", &
     294             :                           description="Uses one of the XGGA functionals (optimized versions of "// &
     295             :                           "some of these functionals might be available outside this section).", &
     296       73712 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     297             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     298             :                           description="activates the functional", &
     299       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     300       73712 :       CALL section_add_keyword(subsection, keyword)
     301       73712 :       CALL keyword_release(keyword)
     302             :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL", &
     303             :                           description="Which one of the XGGA functionals should be used", &
     304             :                           usage="FUNCTIONAL PW86X", &
     305             :                           enum_c_vals=(/ &
     306             :                           "BECKE88X", &
     307             :                           "PW86X   ", &
     308             :                           "PW91X   ", &
     309             :                           "PBEX    ", &
     310             :                           "REV_PBEX", &
     311             :                           "OPTX    ", &
     312             :                           "EV93    "/), &
     313             :                           enum_i_vals=(/xgga_b88x, xgga_pw86, xgga_pw91, xgga_pbex, xgga_revpbe, xgga_opt, xgga_ev93/), &
     314      589696 :                           default_i_val=xgga_b88x)
     315       73712 :       CALL section_add_keyword(subsection, keyword)
     316       73712 :       CALL keyword_release(keyword)
     317       73712 :       CALL section_add_subsection(section, subsection)
     318       73712 :       CALL section_release(subsection)
     319             : 
     320             :       CALL section_create(subsection, __LOCATION__, name="KE_GGA", &
     321             :                           description="Uses one of the KE_GGA functionals (optimized versions of "// &
     322             :                           "some of these functionals might be available outside this section). "// &
     323             :                           "These functionals are needed for the computation of the kinetic "// &
     324             :                           "energy in the Kim-Gordon method.", &
     325       73712 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     326             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     327             :                           description="activates the functional", &
     328       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     329       73712 :       CALL section_add_keyword(subsection, keyword)
     330       73712 :       CALL keyword_release(keyword)
     331             :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL", &
     332             :                           description="Which one of the KE_GGA functionals should be used", &
     333             :                           usage="FUNCTIONAL (OL1|OL2|LLP|PW86|PW91|LC|T92|PBE)", &
     334             :                           enum_c_vals=(/"OL1 ", "OL2 ", "LLP ", "PW86", "PW91", "LC  ", "T92 ", "PBE "/), &
     335             :                           enum_i_vals=(/ke_ol1, ke_ol2, ke_llp, ke_pw86, ke_pw91, ke_lc, ke_t92, ke_pbe/), &
     336             :                           enum_desc=s2a("Uses first Ou-Yang and Levy functional, currently not producing correct results", &
     337             :                                         "Uses second Ou-Yang and Levy functional, currently not producing correct results", &
     338             :                                         "Uses Lee, Lee, and Parr functional", &
     339             :                                         "Uses Perdew and Wang's 1986 functional", &
     340             :                                         "Uses Perdew and Wang's 1991 functional", &
     341             :                                         "Uses Lembarki and Chermette functional", &
     342             :                                         "Uses Thakkar functional", &
     343             :                                         "Uses the 1996 functional of Perdew, Burke and Ernzerhof"), &
     344      663408 :                           default_i_val=ke_llp)
     345       73712 :       CALL section_add_keyword(subsection, keyword)
     346       73712 :       CALL keyword_release(keyword)
     347       73712 :       CALL section_add_subsection(section, subsection)
     348       73712 :       CALL section_release(subsection)
     349             : 
     350             :       CALL section_create(subsection, __LOCATION__, name="P86C", &
     351             :                           description="Uses the P86C functional", &
     352       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     353             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     354             :                           description="activates the functional", &
     355       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     356       73712 :       CALL section_add_keyword(subsection, keyword)
     357       73712 :       CALL keyword_release(keyword)
     358             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     359             :                           description="scales the correlation part of the functional", &
     360       73712 :                           default_r_val=1._dp)
     361       73712 :       CALL section_add_keyword(subsection, keyword)
     362       73712 :       CALL keyword_release(keyword)
     363       73712 :       CALL section_add_subsection(section, subsection)
     364       73712 :       CALL section_release(subsection)
     365             : 
     366             :       CALL section_create(subsection, __LOCATION__, name="PW92", &
     367             :                           description="Uses the PerdewWang correlation functional.", &
     368       73712 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     369             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     370             :                           description="activates the functional", &
     371       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     372       73712 :       CALL section_add_keyword(subsection, keyword)
     373       73712 :       CALL keyword_release(keyword)
     374             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
     375             :                           description="Scaling of the energy functional", &
     376       73712 :                           default_r_val=1.0_dp)
     377       73712 :       CALL section_add_keyword(subsection, keyword)
     378       73712 :       CALL keyword_release(keyword)
     379             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETRIZATION", &
     380             :                           description="Which one of parametrizations should be used", &
     381             :                           usage="PARAMETRIZATION DMC", &
     382             :                           enum_c_vals=(/ &
     383             :                           "ORIGINAL", &
     384             :                           "DMC     ", &
     385             :                           "VMC     "/), &
     386             :                           enum_i_vals=(/c_pw92, c_pw92dmc, c_pw92vmc/), &
     387      294848 :                           default_i_val=c_pw92)
     388       73712 :       CALL section_add_keyword(subsection, keyword)
     389       73712 :       CALL keyword_release(keyword)
     390       73712 :       CALL section_add_subsection(section, subsection)
     391       73712 :       CALL section_release(subsection)
     392             : 
     393             :       CALL section_create(subsection, __LOCATION__, name="PZ81", &
     394             :                           description="Uses the PZ functional.", &
     395             :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
     396      221136 :                           citations=(/Perdew1981, Ortiz1994/))
     397             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     398             :                           description="activates the functional", &
     399       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     400       73712 :       CALL section_add_keyword(subsection, keyword)
     401       73712 :       CALL keyword_release(keyword)
     402             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETRIZATION", &
     403             :                           description="Which one of parametrizations should be used", &
     404             :                           usage="PARAMETRIZATION DMC", &
     405             :                           enum_c_vals=(/ &
     406             :                           "ORIGINAL", &
     407             :                           "DMC     ", &
     408             :                           "VMC     "/), &
     409             :                           enum_i_vals=(/c_pz, c_pzdmc, c_pzvmc/), &
     410      294848 :                           default_i_val=pz_orig)
     411       73712 :       CALL section_add_keyword(subsection, keyword)
     412       73712 :       CALL keyword_release(keyword)
     413             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     414             :                           description="scales the correlation part of the functional", &
     415       73712 :                           default_r_val=1._dp)
     416       73712 :       CALL section_add_keyword(subsection, keyword)
     417       73712 :       CALL keyword_release(keyword)
     418       73712 :       CALL section_add_subsection(section, subsection)
     419       73712 :       CALL section_release(subsection)
     420             : 
     421             :       CALL section_create(subsection, __LOCATION__, name="TFW", &
     422             :                           description="Uses the TFW functional", &
     423       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     424             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     425             :                           description="activates the functional", &
     426       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     427       73712 :       CALL section_add_keyword(subsection, keyword)
     428       73712 :       CALL keyword_release(keyword)
     429       73712 :       CALL section_add_subsection(section, subsection)
     430       73712 :       CALL section_release(subsection)
     431             : 
     432             :       CALL section_create(subsection, __LOCATION__, name="TF", &
     433             :                           description="Uses the TF functional", &
     434       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     435             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     436             :                           description="activates the functional", &
     437       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     438       73712 :       CALL section_add_keyword(subsection, keyword)
     439       73712 :       CALL keyword_release(keyword)
     440       73712 :       CALL section_add_subsection(section, subsection)
     441       73712 :       CALL section_release(subsection)
     442             : 
     443             :       CALL section_create(subsection, __LOCATION__, name="VWN", &
     444             :                           description="Uses the VWN functional", &
     445             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     446      147424 :                           citations=(/Vosko1980/))
     447             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     448             :                           description="activates the functional", &
     449       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     450       73712 :       CALL section_add_keyword(subsection, keyword)
     451       73712 :       CALL keyword_release(keyword)
     452             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     453             :                           description="scales the correlation part of the functional", &
     454       73712 :                           default_r_val=1._dp)
     455       73712 :       CALL section_add_keyword(subsection, keyword)
     456       73712 :       CALL keyword_release(keyword)
     457             : 
     458             :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_TYPE", &
     459             :                           description="Which version of the VWN functional should be used", &
     460             :                           usage="FUNCTIONAL_TYPE VWN5", &
     461             :                           enum_c_vals=s2a("VWN5", "VWN3"), &
     462             :                           enum_i_vals=(/do_vwn5, do_vwn3/), &
     463             :                           enum_desc=s2a("This is the recommended (correct) version of the VWN functional", &
     464             :                                         "This version is the default in Gaussian, but not recommended. "// &
     465             :                                         "Notice that it is also employed in Gaussian's default version of B3LYP"), &
     466       73712 :                           default_i_val=do_vwn5)
     467             : 
     468       73712 :       CALL section_add_keyword(subsection, keyword)
     469       73712 :       CALL keyword_release(keyword)
     470       73712 :       CALL section_add_subsection(section, subsection)
     471       73712 :       CALL section_release(subsection)
     472             : 
     473             :       CALL section_create(subsection, __LOCATION__, name="XALPHA", &
     474             :                           description="Uses the XALPHA (SLATER) functional.", &
     475       73712 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     476             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     477             :                           description="activates the functional", &
     478       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     479       73712 :       CALL section_add_keyword(subsection, keyword)
     480       73712 :       CALL keyword_release(keyword)
     481             :       CALL keyword_create(keyword, __LOCATION__, name="XA", &
     482             :                           description="Value of the xa parameter (this does not change the exponent, "// &
     483             :                           "just the mixing)", &
     484       73712 :                           usage="XA 0.7", default_r_val=2._dp/3._dp)
     485       73712 :       CALL section_add_keyword(subsection, keyword)
     486       73712 :       CALL keyword_release(keyword)
     487             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     488             :                           description="scales the exchange part of the functional", &
     489       73712 :                           default_r_val=1._dp)
     490       73712 :       CALL section_add_keyword(subsection, keyword)
     491       73712 :       CALL keyword_release(keyword)
     492       73712 :       CALL section_add_subsection(section, subsection)
     493       73712 :       CALL section_release(subsection)
     494             : 
     495             :       CALL section_create(subsection, __LOCATION__, name="TPSS", &
     496             :                           description="Uses the TPSS functional. Note, that there is no LSD version available. "// &
     497             :                           "In such cases, use the LIBXC version instead.", &
     498             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     499      147424 :                           citations=(/Tao2003/))
     500             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     501             :                           description="Activates the functional", &
     502       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     503       73712 :       CALL section_add_keyword(subsection, keyword)
     504       73712 :       CALL keyword_release(keyword)
     505             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     506             :                           description="scales the exchange part of the functional", &
     507       73712 :                           default_r_val=1._dp)
     508       73712 :       CALL section_add_keyword(subsection, keyword)
     509       73712 :       CALL keyword_release(keyword)
     510             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     511             :                           description="scales the correlation part of the functional", &
     512       73712 :                           default_r_val=1._dp)
     513       73712 :       CALL section_add_keyword(subsection, keyword)
     514       73712 :       CALL keyword_release(keyword)
     515       73712 :       CALL section_add_subsection(section, subsection)
     516       73712 :       CALL section_release(subsection)
     517             : 
     518             :       CALL section_create(subsection, __LOCATION__, name="PBE", &
     519             :                           description="Uses the PBE functional", &
     520             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     521      294848 :                           citations=(/Perdew1996, Zhang1998, Perdew2008/))
     522             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     523             :                           description="activates the functional", &
     524       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     525       73712 :       CALL section_add_keyword(subsection, keyword)
     526       73712 :       CALL keyword_release(keyword)
     527             :       CALL keyword_create(keyword, __LOCATION__, name="parametrization", &
     528             :                           description="switches between the different "// &
     529             :                           "parametrizations of the functional. "// &
     530             :                           "Note: Beta parameters used have only 5 significant digits, "// &
     531             :                           "as published. For higher precision and program comparison "// &
     532             :                           "use the LIBXC library.", &
     533             :                           enum_i_vals=(/xc_pbe_orig, xc_pbe_rev, xc_pbe_sol/), &
     534             :                           enum_c_vals=(/"ORIG  ", "revPBE", "PBEsol"/), &
     535             :                           enum_desc=(/"original PBE                        ", &
     536             :                                       "revised PBE (revPBE)                ", &
     537             :                                       "PBE for solids and surfaces (PBEsol)"/), &
     538      515984 :                           default_i_val=xc_pbe_orig)
     539       73712 :       CALL section_add_keyword(subsection, keyword)
     540       73712 :       CALL keyword_release(keyword)
     541             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     542             :                           description="scales the exchange part of the functional", &
     543       73712 :                           default_r_val=1._dp)
     544       73712 :       CALL section_add_keyword(subsection, keyword)
     545       73712 :       CALL keyword_release(keyword)
     546             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     547             :                           description="scales the correlation part of the functional", &
     548       73712 :                           default_r_val=1._dp)
     549       73712 :       CALL section_add_keyword(subsection, keyword)
     550       73712 :       CALL keyword_release(keyword)
     551       73712 :       CALL section_add_subsection(section, subsection)
     552       73712 :       CALL section_release(subsection)
     553             : 
     554             :       CALL section_create(subsection, __LOCATION__, name="XWPBE", &
     555             :                           description="Uses the short range PBE functional", &
     556             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     557      147424 :                           citations=(/Heyd2004/))
     558             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     559             :                           description="activates the functional", &
     560       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     561       73712 :       CALL section_add_keyword(subsection, keyword)
     562       73712 :       CALL keyword_release(keyword)
     563             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     564             :                           description="scales the exchange part of the functional", &
     565       73712 :                           default_r_val=1._dp)
     566       73712 :       CALL section_add_keyword(subsection, keyword)
     567       73712 :       CALL keyword_release(keyword)
     568             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x0", &
     569             :                           description="scales the exchange part of the original hole PBE-functional", &
     570       73712 :                           default_r_val=0.0_dp)
     571       73712 :       CALL section_add_keyword(subsection, keyword)
     572       73712 :       CALL keyword_release(keyword)
     573             :       CALL keyword_create(keyword, __LOCATION__, name="omega", &
     574             :                           description="screening parameter", &
     575       73712 :                           default_r_val=1._dp)
     576       73712 :       CALL section_add_keyword(subsection, keyword)
     577       73712 :       CALL keyword_release(keyword)
     578       73712 :       CALL section_add_subsection(section, subsection)
     579       73712 :       CALL section_release(subsection)
     580             : 
     581             :       CALL section_create(subsection, __LOCATION__, name="BECKE97", &
     582             :                           description="Uses the Becke 97 exchange correlation functional", &
     583             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     584      221136 :                           citations=(/Becke1997, Grimme2006/))
     585             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     586             :                           description="activates the functional", &
     587       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     588       73712 :       CALL section_add_keyword(subsection, keyword)
     589       73712 :       CALL keyword_release(keyword)
     590             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     591             :                 description="scales the exchange part of the functional, if -1 the default for the given parametrization is used", &
     592       73712 :                           default_r_val=-1._dp)
     593       73712 :       CALL section_add_keyword(subsection, keyword)
     594       73712 :       CALL keyword_release(keyword)
     595             :       CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
     596             :                           description="scales the correlation part of the functional", &
     597       73712 :                           default_r_val=1._dp)
     598       73712 :       CALL section_add_keyword(subsection, keyword)
     599       73712 :       CALL keyword_release(keyword)
     600             :       CALL keyword_create(keyword, __LOCATION__, name="parametrization", &
     601             :                           description="switches between the B97 and Grimme parametrization ", &
     602             :                           enum_i_vals=(/xc_b97_orig, xc_b97_grimme, xc_b97_grimme, xc_b97_mardirossian, xc_b97_3c/), &
     603             :                           enum_c_vals=(/"ORIG      ", "B97GRIMME ", "B97_GRIMME", "wB97X-V   ", "B97-3c    "/), &
     604      442272 :                           default_i_val=xc_b97_orig)
     605       73712 :       CALL section_add_keyword(subsection, keyword)
     606       73712 :       CALL keyword_release(keyword)
     607             : 
     608       73712 :       CALL section_add_subsection(section, subsection)
     609       73712 :       CALL section_release(subsection)
     610             : 
     611             :       CALL section_create(subsection, __LOCATION__, name="BECKE_ROUSSEL", &
     612             :                           description="Becke Roussel exchange hole model. Can be used "// &
     613             :                           "as long range correction with a truncated coulomb potential", &
     614             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     615      221136 :                           citations=(/BeckeRoussel1989, Proynov2007/))
     616             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     617             :                           description="activates the functional", &
     618       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     619       73712 :       CALL section_add_keyword(subsection, keyword)
     620       73712 :       CALL keyword_release(keyword)
     621             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     622             :                           description="scales the exchange part of the functional", &
     623       73712 :                           default_r_val=1._dp)
     624       73712 :       CALL section_add_keyword(subsection, keyword)
     625       73712 :       CALL keyword_release(keyword)
     626             :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
     627             :                           description="Defines the cutoff radius for the truncation. "// &
     628             :                           "If put to zero, the standard full range potential will be used", &
     629       73712 :                           usage="CUTOFF_RADIUS 2.0", default_r_val=0.0_dp)
     630       73712 :       CALL section_add_keyword(subsection, keyword)
     631       73712 :       CALL keyword_release(keyword)
     632             :       CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
     633             :                           description="Parameter in the exchange hole. "// &
     634             :                           "Usually this is put to 1.0 or 0.8", &
     635       73712 :                           usage="GAMMA 0.8", default_r_val=1.0_dp)
     636       73712 :       CALL section_add_keyword(subsection, keyword)
     637       73712 :       CALL keyword_release(keyword)
     638       73712 :       CALL section_add_subsection(section, subsection)
     639       73712 :       CALL section_release(subsection)
     640             : 
     641             :       CALL section_create(subsection, __LOCATION__, name="LDA_HOLE_T_C_LR", &
     642             :                           description="LDA exchange hole model in truncated coulomb potential", &
     643       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     644             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     645             :                           description="activates the functional", &
     646       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     647       73712 :       CALL section_add_keyword(subsection, keyword)
     648       73712 :       CALL keyword_release(keyword)
     649             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
     650             :                           description="scales the exchange part of the functional", &
     651       73712 :                           default_r_val=1._dp)
     652       73712 :       CALL section_add_keyword(subsection, keyword)
     653       73712 :       CALL keyword_release(keyword)
     654             :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
     655             :                           description="Defines cutoff for lower integration boundary", &
     656       73712 :                           default_r_val=0.0_dp, unit_str="angstrom")
     657       73712 :       CALL section_add_keyword(subsection, keyword)
     658       73712 :       CALL keyword_release(keyword)
     659       73712 :       CALL section_add_subsection(section, subsection)
     660       73712 :       CALL section_release(subsection)
     661             : 
     662             :       CALL section_create(subsection, __LOCATION__, name="PBE_HOLE_T_C_LR", &
     663             :                           description="PBE exchange hole model in trucanted coulomb potential", &
     664       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     665             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     666             :                           description="activates the functional", &
     667       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     668       73712 :       CALL section_add_keyword(subsection, keyword)
     669       73712 :       CALL keyword_release(keyword)
     670             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
     671             :                           description="scales the exchange part of the functional", &
     672       73712 :                           default_r_val=1._dp)
     673       73712 :       CALL section_add_keyword(subsection, keyword)
     674       73712 :       CALL keyword_release(keyword)
     675             :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
     676             :                           description="Defines cutoff for lower integration boundary", &
     677       73712 :                           default_r_val=1.0_dp, unit_str="angstrom")
     678       73712 :       CALL section_add_keyword(subsection, keyword)
     679       73712 :       CALL keyword_release(keyword)
     680       73712 :       CALL section_add_subsection(section, subsection)
     681       73712 :       CALL section_release(subsection)
     682             : 
     683             :       CALL section_create(subsection, __LOCATION__, name="GV09", &
     684             :                           description="Combination of three different exchange hole models", &
     685       73712 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     686             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     687             :                           description="activates the functional", &
     688       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     689       73712 :       CALL section_add_keyword(subsection, keyword)
     690       73712 :       CALL keyword_release(keyword)
     691             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
     692             :                           description="scales the exchange part of the functional", &
     693       73712 :                           default_r_val=1._dp)
     694       73712 :       CALL section_add_keyword(subsection, keyword)
     695       73712 :       CALL keyword_release(keyword)
     696             :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
     697             :                           description="Defines cutoff for lower integration boundary", &
     698       73712 :                           default_r_val=0.0_dp, unit_str="angstrom")
     699       73712 :       CALL section_add_keyword(subsection, keyword)
     700       73712 :       CALL keyword_release(keyword)
     701             :       CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
     702             :                           description="Parameter for Becke Roussel hole", &
     703       73712 :                           default_r_val=1.0_dp)
     704       73712 :       CALL section_add_keyword(subsection, keyword)
     705       73712 :       CALL keyword_release(keyword)
     706       73712 :       CALL section_add_subsection(section, subsection)
     707       73712 :       CALL section_release(subsection)
     708             : 
     709             :       CALL section_create(subsection, __LOCATION__, name="BEEF", & !rk: BEEF Exchange
     710             :                           description="Uses the BEEFvdW exchange functional", &
     711             :                           n_keywords=0, n_subsections=0, repeats=.FALSE., &
     712      147424 :                           citations=(/Wellendorff2012/))
     713             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     714             :                           description="activates the functional", &
     715       73712 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     716       73712 :       CALL section_add_keyword(subsection, keyword)
     717       73712 :       CALL keyword_release(keyword)
     718             :       CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
     719             :                           description="scales the exchange part of the functional", &
     720       73712 :                           default_r_val=1._dp)
     721       73712 :       CALL section_add_keyword(subsection, keyword)
     722       73712 :       CALL keyword_release(keyword)
     723       73712 :       CALL section_add_subsection(section, subsection)
     724       73712 :       CALL section_release(subsection)
     725             : 
     726       73712 :    END SUBROUTINE create_xc_fun_section
     727             : 
     728             : ! **************************************************************************************************
     729             : !> \brief creates the structure of the section needed to select an xc potential
     730             : !> \param section the section that will be created
     731             : !> \author thomas chassaing
     732             : ! **************************************************************************************************
     733       64492 :    SUBROUTINE create_xc_potential_section(section)
     734             :       TYPE(section_type), POINTER                        :: section
     735             : 
     736             :       TYPE(keyword_type), POINTER                        :: keyword
     737             :       TYPE(section_type), POINTER                        :: subsection
     738             : 
     739       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
     740             :       CALL section_create(section, __LOCATION__, name="xc_potential", &
     741             :                           description="The xc potential to use (CAREFUL: xc potential here refers "// &
     742             :                           "to potentials that are not derived from an xc functional, but rather are "// &
     743             :                           "modelled directly. Therefore there is no consistent xc energy available. "// &
     744             :                           "To still get an energy expression, see ENERGY below", &
     745       64492 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
     746             : 
     747       64492 :       NULLIFY (subsection, keyword)
     748             :       CALL section_create(subsection, __LOCATION__, name="SAOP", &
     749             :                           description="Uses the SAOP potential", &
     750       64492 :                           n_keywords=3, n_subsections=0, repeats=.TRUE.)
     751             :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
     752             :                           description="Value of the alpha parameter (default = 1.19).", &
     753       64492 :                           usage="ALPHA 1.19", default_r_val=1.19_dp)
     754       64492 :       CALL section_add_keyword(subsection, keyword)
     755       64492 :       CALL keyword_release(keyword)
     756             :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
     757             :                           description="Value of the beta parameter (default = 0.01).", &
     758       64492 :                           usage="BETA 0.01", default_r_val=0.01_dp)
     759       64492 :       CALL section_add_keyword(subsection, keyword)
     760       64492 :       CALL keyword_release(keyword)
     761             :       CALL keyword_create(keyword, __LOCATION__, name="K_RHO", &
     762             :                           description="Value of the K_rho parameter (default = 0.42).", &
     763       64492 :                           usage="ALPHA 0.42", default_r_val=0.42_dp)
     764       64492 :       CALL section_add_keyword(subsection, keyword)
     765       64492 :       CALL keyword_release(keyword)
     766       64492 :       CALL section_add_subsection(section, subsection)
     767       64492 :       CALL section_release(subsection)
     768             : 
     769             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY", &
     770             :                           description="How to determine the total energy.", &
     771             :                           usage="ENERGY [NONE,XC_FUNCTIONAL,SUM_EIGENVALUES", &
     772             :                           enum_c_vals=s2a("NONE", "XC_FUNCTIONAL", "FUNCTIONAL", "SUM_EIGENVALUES", "SOE"), &
     773             :                           enum_i_vals=(/xc_pot_energy_none, &
     774             :                                         xc_pot_energy_xc_functional, &
     775             :                                         xc_pot_energy_xc_functional, &
     776             :                                         xc_pot_energy_sum_eigenvalues, &
     777             :                                         xc_pot_energy_sum_eigenvalues/), &
     778       64492 :                           default_i_val=xc_pot_energy_none)
     779       64492 :       CALL section_add_keyword(section, keyword)
     780       64492 :       CALL keyword_release(keyword)
     781             : 
     782       64492 :    END SUBROUTINE create_xc_potential_section
     783             : 
     784             : ! **************************************************************************************************
     785             : !> \brief creates the structure of the section needed to select an xc kernel
     786             : !> \param section the section that will be created
     787             : !> \author JGH
     788             : ! **************************************************************************************************
     789       64492 :    SUBROUTINE create_xc_kernel_section(section)
     790             :       TYPE(section_type), POINTER                        :: section
     791             : 
     792             :       TYPE(keyword_type), POINTER                        :: keyword
     793             : 
     794       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
     795             :       CALL section_create(section, __LOCATION__, name="XC_KERNEL", &
     796             :                           description="The xc kernel to use (CAREFUL: xc kernel here refers "// &
     797             :                           "to kernels that are not derived from an xc functional, but rather are "// &
     798             :                           "modelled directly. This kernel will be used in a TDDFPT calculation. "// &
     799             :                           "Cannot be combined with XC_FUNCTIONAL or XC_POTENTIAL.", &
     800       64492 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
     801             : 
     802       64492 :       NULLIFY (keyword)
     803             :       CALL keyword_create( &
     804             :          keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     805             :          description="Selection of kernel functionals.", &
     806             :          usage="&XC_KERNEL LDAfxc", &
     807             :          enum_c_vals=s2a("PADEfxc", "LDAfxc", "GGAfxc", "NONE"), &
     808             :          enum_i_vals=(/fxc_funct_pade, fxc_funct_lda, fxc_funct_gga, fxc_none/), &
     809             :          enum_desc=s2a("Fxc based on LDA PADE approximation", &
     810             :                        "Fxc based on LDA functionals", &
     811             :                        "Fxc model from fit to PBE functional", &
     812             :                        "NONE"), &
     813             :          default_i_val=fxc_none, &
     814       64492 :          lone_keyword_i_val=fxc_none)
     815       64492 :       CALL section_add_keyword(section, keyword)
     816       64492 :       CALL keyword_release(keyword)
     817             : 
     818             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETER", &
     819             :                           description="List of parameters specific to the kernel function", &
     820             :                           usage="PARAMETER <REAL> .. <REAL>", &
     821       64492 :                           type_of_var=real_t, n_var=-1)
     822       64492 :       CALL section_add_keyword(section, keyword)
     823       64492 :       CALL keyword_release(keyword)
     824             :       CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
     825             :                           description="B97 GAMMA parameters [gx, gab, gaa]", &
     826             :                           usage="GAMMA <REAL> <REAL> <REAL>", &
     827             :                           default_r_vals=(/0.004_dp, 0.006_dp, 0.2_dp/), &
     828       64492 :                           type_of_var=real_t, n_var=3)
     829       64492 :       CALL section_add_keyword(section, keyword)
     830       64492 :       CALL keyword_release(keyword)
     831             :       CALL keyword_create(keyword, __LOCATION__, name="C_XAA", &
     832             :                           description="B97 C parameters for exchange", &
     833             :                           usage="C_XAA <REAL> <REAL> <REAL>", &
     834             :                           default_r_vals=(/1.0_dp, 0.63_dp, 0.94_dp/), &
     835       64492 :                           type_of_var=real_t, n_var=3)
     836       64492 :       CALL section_add_keyword(section, keyword)
     837       64492 :       CALL keyword_release(keyword)
     838             :       CALL keyword_create(keyword, __LOCATION__, name="C_CAB", &
     839             :                           description="B97 C parameters for same spin correlation.", &
     840             :                           usage="C_CAB <REAL> <REAL> <REAL>", &
     841             :                           default_r_vals=(/1.0_dp, 0.75_dp, -4.60_dp/), &
     842       64492 :                           type_of_var=real_t, n_var=3)
     843       64492 :       CALL section_add_keyword(section, keyword)
     844       64492 :       CALL keyword_release(keyword)
     845             :       CALL keyword_create(keyword, __LOCATION__, name="C_CAA", &
     846             :                           description="B97 C parameters for opposite spin correlation.", &
     847             :                           usage="C_CAB <REAL> <REAL> <REAL>", &
     848             :                           default_r_vals=(/0.17_dp, 2.35_dp, -2.55_dp/), &
     849       64492 :                           type_of_var=real_t, n_var=3)
     850       64492 :       CALL section_add_keyword(section, keyword)
     851       64492 :       CALL keyword_release(keyword)
     852             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
     853             :                           description="Scaling parameter for exchange kernel.", &
     854       64492 :                           usage="SCALE_X 0.2", default_r_val=1.0_dp)
     855       64492 :       CALL section_add_keyword(section, keyword)
     856       64492 :       CALL keyword_release(keyword)
     857             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_C", &
     858             :                           description="Scaling parameter for correlation kernel.", &
     859       64492 :                           usage="SCALE_C 0.2", default_r_val=1.0_dp)
     860       64492 :       CALL section_add_keyword(section, keyword)
     861       64492 :       CALL keyword_release(keyword)
     862             : 
     863       64492 :    END SUBROUTINE create_xc_kernel_section
     864             : 
     865             : ! **************************************************************************************************
     866             : !> \brief creates the structure of the section needed to select an hfx kernel
     867             : !> \param section the section that will be created
     868             : !> \author JGH
     869             : ! **************************************************************************************************
     870       64492 :    SUBROUTINE create_hfx_kernel_section(section)
     871             :       TYPE(section_type), POINTER                        :: section
     872             : 
     873             :       TYPE(keyword_type), POINTER                        :: keyword
     874             :       TYPE(section_type), POINTER                        :: subsection
     875             : 
     876       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
     877             :       CALL section_create(section, __LOCATION__, name="HFX_KERNEL", &
     878             :                           description="The hfx kernel to use. Cannot be combined with HF section.", &
     879       64492 :                           n_keywords=1, n_subsections=2, repeats=.FALSE.)
     880             : 
     881       64492 :       NULLIFY (subsection, keyword)
     882             :       CALL keyword_create(keyword, __LOCATION__, name="DO_HFXSR", &
     883             :                           description="Switch to use the HFXSR (short range) kernel.", &
     884             :                           usage="DO_HFXSR T/F", default_l_val=.FALSE., &
     885       64492 :                           lone_keyword_l_val=.TRUE.)
     886       64492 :       CALL section_add_keyword(section, keyword)
     887       64492 :       CALL keyword_release(keyword)
     888       64492 :       NULLIFY (subsection, keyword)
     889             :       CALL keyword_create(keyword, __LOCATION__, name="HFXSR_PRIMBAS", &
     890             :                           description="Default number of primitives in ADMM basis in HFXSR. "// &
     891             :                           "0 indicates the use of a contracted minimal basis. ", &
     892       64492 :                           usage="HFXSR_PRIMBAS 3", default_i_val=0)
     893       64492 :       CALL section_add_keyword(section, keyword)
     894       64492 :       CALL keyword_release(keyword)
     895             : 
     896       64492 :       CALL create_hfx_section(subsection)
     897       64492 :       CALL section_add_subsection(section, subsection)
     898       64492 :       CALL section_release(subsection)
     899             : 
     900             :       CALL section_create(subsection, __LOCATION__, name="HFXLR", &
     901             :                           description="Uses the HFXLR (long range) kernel", &
     902       64492 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
     903             :       CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
     904             :                           description="Value of lower range cutoff of interaction [Bohr]", &
     905       64492 :                           usage="RCUT 5.00", default_r_val=6.00_dp, unit_str="bohr")
     906       64492 :       CALL section_add_keyword(subsection, keyword)
     907       64492 :       CALL keyword_release(keyword)
     908             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
     909             :                           description="Scaling parameter for HFX kernel.", &
     910       64492 :                           usage="SCALE 0.25", default_r_val=1.00_dp)
     911       64492 :       CALL section_add_keyword(subsection, keyword)
     912       64492 :       CALL keyword_release(keyword)
     913       64492 :       CALL section_add_subsection(section, subsection)
     914       64492 :       CALL section_release(subsection)
     915             : 
     916       64492 :    END SUBROUTINE create_hfx_kernel_section
     917             : ! **************************************************************************************************
     918             : !> \brief creates the structure of the section needed for vdW potentials
     919             : !> \param section the section that will be created
     920             : !> \author jgh
     921             : ! **************************************************************************************************
     922       64492 :    SUBROUTINE create_vdw_potential_section(section)
     923             :       TYPE(section_type), POINTER                        :: section
     924             : 
     925             :       TYPE(keyword_type), POINTER                        :: keyword
     926             :       TYPE(section_type), POINTER                        :: newsection, print_key, subsection
     927             : 
     928       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
     929             :       CALL section_create(section, __LOCATION__, name="vdw_potential", &
     930             :                           description="This section combines all possible additional dispersion "// &
     931             :                           "corrections to the normal XC functionals. This can be more functionals "// &
     932             :                           "or simple empirical pair potentials. ", &
     933             :                           citations=(/grimme2006, Tran2013/), &
     934      193476 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
     935             : 
     936       64492 :       NULLIFY (subsection, keyword)
     937             :       CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_TYPE", &
     938             :                           variants=s2a("DISPERSION_FUNCTIONAL"), &
     939             :                           description="Type of dispersion/vdW functional or potential to use", &
     940             :                           usage="POTENTIAL_TYPE (NONE|PAIR_POTENTIAL|NON_LOCAL)", &
     941             :                           enum_c_vals=s2a("NONE", "PAIR_POTENTIAL", "NON_LOCAL"), &
     942             :                           enum_i_vals=(/xc_vdw_fun_none, xc_vdw_fun_pairpot, xc_vdw_fun_nonloc/), &
     943             :                           enum_desc=s2a("No dispersion/van der Waals functional", &
     944             :                                         "Pair potential van der Waals density functional", &
     945             :                                         "Nonlocal van der Waals density functional"), &
     946       64492 :                           default_i_val=xc_vdw_fun_none)
     947       64492 :       CALL section_add_keyword(section, keyword)
     948       64492 :       CALL keyword_release(keyword)
     949             : 
     950             :       CALL section_create(subsection, __LOCATION__, name="PAIR_POTENTIAL", &
     951             :                           description="Information on the pair potential to calculate dispersion", &
     952       64492 :                           n_keywords=5, n_subsections=0, repeats=.TRUE.)
     953             :       CALL keyword_create(keyword, __LOCATION__, name="R_CUTOFF", &
     954             :                           variants=s2a("D3_CUTOFF", "D4_3B_CUTOFF"), &
     955             :                           description="Range of potential. The cutoff will be 2 times this value. "// &
     956             :                           "In the case of D4 it will be used for the 3-body term", &
     957             :                           usage="R_CUTOFF 20.0", default_r_val=20.0_dp, &
     958       64492 :                           unit_str="angstrom")
     959       64492 :       CALL section_add_keyword(subsection, keyword)
     960       64492 :       CALL keyword_release(keyword)
     961             :       CALL keyword_create(keyword, __LOCATION__, name="D4_CUTOFF", &
     962             :                           description="Range of potential. The cutoff will be 2 times this value. "// &
     963             :                           "Only used for the 2-body term of D4", &
     964             :                           usage="D4_CUTOFF 30.0", default_r_val=20.0_dp, &
     965       64492 :                           unit_str="angstrom")
     966       64492 :       CALL section_add_keyword(subsection, keyword)
     967       64492 :       CALL keyword_release(keyword)
     968             :       CALL keyword_create(keyword, __LOCATION__, name="D4_CN_CUTOFF", &
     969             :                           description="Coordination number cutoff for D4", &
     970             :                           usage="D4_CN_CUTOFF 30.0", default_r_val=10.0_dp, &
     971       64492 :                           unit_str="angstrom")
     972       64492 :       CALL section_add_keyword(subsection, keyword)
     973       64492 :       CALL keyword_release(keyword)
     974             :       CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
     975             :                           description="Type of potential", &
     976             :                           citations=(/grimme2006, grimme2010, grimme2011, Caldeweyher2020/), &
     977             :                           usage="TYPE (DFTD2|DFTD3|DFTD3(BJ)|DFTD4)", &
     978             :                           enum_c_vals=s2a("DFTD2", "DFTD3", "DFTD3(BJ)", "DFTD4"), &
     979             :                           enum_i_vals=(/vdw_pairpot_dftd2, vdw_pairpot_dftd3, &
     980             :                                         vdw_pairpot_dftd3bj, vdw_pairpot_dftd4/), &
     981             :                           enum_desc=s2a("Grimme D2 method", &
     982             :                                         "Grimme D3 method (zero damping)", &
     983             :                                         "Grimme D3 method (Becke-Johnson damping)", &
     984             :                                         "Grimme D4 method"), &
     985      322460 :                           default_i_val=vdw_pairpot_dftd3)
     986       64492 :       CALL section_add_keyword(subsection, keyword)
     987       64492 :       CALL keyword_release(keyword)
     988             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_FILE_NAME", &
     989             :                           description="Name of the parameter file, may include a path (not used for D4)", &
     990             :                           usage="PARAMETER_FILE_NAME <FILENAME>", &
     991       64492 :                           default_lc_val="DISPERSION_PARAMETERS")
     992       64492 :       CALL section_add_keyword(subsection, keyword)
     993       64492 :       CALL keyword_release(keyword)
     994             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_FUNCTIONAL", &
     995             :                           description="Use parameters for this specific density functional. "// &
     996             :                           "For available D3 and D3(BJ) parameters see: "// &
     997             :                           "<https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3>. "// &
     998             :                           "For the defintion of D4 parameters see: "// &
     999             :                           "<https://github.com/dftd4/dftd4>.", &
    1000             :                           usage="REFERENCE_FUNCTIONAL <functional>", &
    1001       64492 :                           type_of_var=char_t)
    1002       64492 :       CALL section_add_keyword(subsection, keyword)
    1003       64492 :       CALL keyword_release(keyword)
    1004             :       CALL keyword_create(keyword, __LOCATION__, name="D4_REFERENCE_CODE", &
    1005             :                           description="Calculate D4 energy using external library.", &
    1006             :                           usage="D4_REFERENCE_CODE", default_l_val=.TRUE., &
    1007       64492 :                           lone_keyword_l_val=.TRUE.)
    1008       64492 :       CALL section_add_keyword(subsection, keyword)
    1009       64492 :       CALL keyword_release(keyword)
    1010             :       CALL keyword_create(keyword, __LOCATION__, name="D4_DEBUG", &
    1011             :                           description="Debug output for D4 method using reference code.", &
    1012             :                           usage="D4_DEBUG", default_l_val=.FALSE., &
    1013       64492 :                           lone_keyword_l_val=.TRUE.)
    1014       64492 :       CALL section_add_keyword(subsection, keyword)
    1015       64492 :       CALL keyword_release(keyword)
    1016             :       CALL keyword_create(keyword, __LOCATION__, name="D2_SCALING", &
    1017             :                           variants=["SCALING"], &
    1018             :                           description="XC Functional dependent scaling parameter, if set to zero CP2K attempts"// &
    1019             :                           " to guess the xc functional that is in use and sets the associated scaling parameter.", &
    1020      128984 :                           usage="SCALING 0.2", default_r_val=0._dp)
    1021       64492 :       CALL section_add_keyword(subsection, keyword)
    1022       64492 :       CALL keyword_release(keyword)
    1023             :       CALL keyword_create(keyword, __LOCATION__, name="D2_EXP_PRE", &
    1024             :                           variants=["EXP_PRE"], &
    1025             :                           description="Prefactor in exponential damping factor (DFT-D2 potential)", &
    1026      128984 :                           usage="D2_EXP_PRE 20.", default_r_val=20._dp)
    1027       64492 :       CALL section_add_keyword(subsection, keyword)
    1028       64492 :       CALL keyword_release(keyword)
    1029             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_CN", &
    1030             :                           description="Cutoff value for coordination number function (DFT-D3 method)", &
    1031       64492 :                           usage="EPS_CN 1.e-6_dp", default_r_val=1.e-6_dp)
    1032       64492 :       CALL section_add_keyword(subsection, keyword)
    1033       64492 :       CALL keyword_release(keyword)
    1034             :       CALL keyword_create(keyword, __LOCATION__, name="D3_SCALING", &
    1035             :                           description="XC Functional dependent scaling parameters (s6,sr6,s8) for the DFT-D3 method,"// &
    1036             :                           " if set to zero CP2K attempts"// &
    1037             :                           " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
    1038             :                           usage="D3_SCALING 1.0 1.0 1.0", n_var=3, &
    1039       64492 :                           default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
    1040       64492 :       CALL section_add_keyword(subsection, keyword)
    1041       64492 :       CALL keyword_release(keyword)
    1042             :       CALL keyword_create(keyword, __LOCATION__, name="D3BJ_SCALING", &
    1043             :                           description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D3(BJ) method,"// &
    1044             :                           " if set to zero CP2K attempts"// &
    1045             :                           " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
    1046             :                           usage="D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
    1047       64492 :                           default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
    1048       64492 :       CALL section_add_keyword(subsection, keyword)
    1049       64492 :       CALL keyword_release(keyword)
    1050             :       CALL keyword_create(keyword, __LOCATION__, name="D4_SCALING", &
    1051             :                           description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D4 method,"// &
    1052             :                           " if set to zero CP2K attempts"// &
    1053             :                           " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
    1054             :                           usage="D4_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
    1055       64492 :                           default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
    1056       64492 :       CALL section_add_keyword(subsection, keyword)
    1057       64492 :       CALL keyword_release(keyword)
    1058             :       CALL keyword_create(keyword, __LOCATION__, name="CALCULATE_C9_TERM", &
    1059             :                           description="Calculate C9 terms in DFT-D3 model", &
    1060             :                           usage="CALCULATE_C9_TERM", default_l_val=.FALSE., &
    1061       64492 :                           lone_keyword_l_val=.TRUE.)
    1062       64492 :       CALL section_add_keyword(subsection, keyword)
    1063       64492 :       CALL keyword_release(keyword)
    1064             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_C9_TERM", &
    1065             :                           description="Calculate C9 terms in DFT-D3 model using reference coordination numbers", &
    1066             :                           usage="REFERENCE_C9_TERM", default_l_val=.FALSE., &
    1067       64492 :                           lone_keyword_l_val=.TRUE.)
    1068       64492 :       CALL section_add_keyword(subsection, keyword)
    1069       64492 :       CALL keyword_release(keyword)
    1070             :       CALL keyword_create(keyword, __LOCATION__, name="FACTOR_S9_TERM", &
    1071             :                           description="S9 prefactor of the many-body term in the DFT-D4 method.", &
    1072       64492 :                           usage="FACTOR_S9_TERM 1.e-0", default_r_val=1.00_dp)
    1073       64492 :       CALL section_add_keyword(subsection, keyword)
    1074       64492 :       CALL keyword_release(keyword)
    1075             :       CALL keyword_create(keyword, __LOCATION__, name="LONG_RANGE_CORRECTION", &
    1076             :                           description="Calculate a long range correction to the DFT-D3 model."// &
    1077             :                           " WARNING: Use with care! Only for isotropic dense systems.", &
    1078             :                           usage="LONG_RANGE_CORRECTION", default_l_val=.FALSE., &
    1079       64492 :                           lone_keyword_l_val=.TRUE.)
    1080       64492 :       CALL section_add_keyword(subsection, keyword)
    1081       64492 :       CALL keyword_release(keyword)
    1082             :       CALL keyword_create(keyword, __LOCATION__, name="SHORT_RANGE_CORRECTION", &
    1083             :                           description="Calculate a short-range bond correction to the DFT-D3 model", &
    1084             :                           usage="SHORT_RANGE_CORRECTION", default_l_val=.FALSE., &
    1085       64492 :                           lone_keyword_l_val=.TRUE.)
    1086       64492 :       CALL section_add_keyword(subsection, keyword)
    1087       64492 :       CALL keyword_release(keyword)
    1088             :       CALL keyword_create(keyword, __LOCATION__, name="SHORT_RANGE_CORRECTION_PARAMETERS", &
    1089             :                           description="Parameters for the short-range bond correction to the DFT-D3 model. "// &
    1090             :                           "s*(za*zb)^t1*EXP(-g*dr*r0ab^t2), parameters: s, g, t1, t2 "// &
    1091             :                           "Defaults: s=0.08, g=10.0, t1=0.5, t2=-1.0 ", &
    1092             :                           usage="SHORT_RANGE_CORRECTION_PARAMETRS", default_r_vals=(/0.08_dp, 10.0_dp, 0.5_dp, -1.0_dp/), &
    1093       64492 :                           n_var=4, type_of_var=real_t)
    1094       64492 :       CALL section_add_keyword(subsection, keyword)
    1095       64492 :       CALL keyword_release(keyword)
    1096             :       ! KG molecular corrections
    1097             :       CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_CORRECTION", &
    1098             :                           description="Calculate a intermolecular correction to the DFT-D3 model", &
    1099             :                           usage="MOLECULE_CORRECTION", default_l_val=.FALSE., &
    1100       64492 :                           lone_keyword_l_val=.TRUE.)
    1101       64492 :       CALL section_add_keyword(subsection, keyword)
    1102       64492 :       CALL keyword_release(keyword)
    1103             :       CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_CORRECTION_C8", &
    1104             :                           description="Calculate a intermolecular correction to the C8 term in the DFT-D3 model", &
    1105       64492 :                           usage="MOLECULE_CORRECTION_C8  1.0 ", default_r_val=0.0_dp)
    1106       64492 :       CALL section_add_keyword(subsection, keyword)
    1107       64492 :       CALL keyword_release(keyword)
    1108             :       CALL keyword_create(keyword, __LOCATION__, name="VERBOSE_OUTPUT", &
    1109             :                           description="Extensive output for the DFT-D2 and DFT-D3 models."// &
    1110             :                           " Needs PRINT_DFTD section to be specified.", &
    1111             :                           usage="VERBOSE_OUTPUT", default_l_val=.FALSE., &
    1112       64492 :                           lone_keyword_l_val=.TRUE.)
    1113       64492 :       CALL section_add_keyword(subsection, keyword)
    1114       64492 :       CALL keyword_release(keyword)
    1115             : 
    1116             :       ! Set coordination numbers by atom numbers
    1117             :       CALL keyword_create(keyword, __LOCATION__, name="D3_EXCLUDE_KIND", &
    1118             :                           description="Specifies the atomic kinds excluded in the DFT-D3 calculation.", &
    1119             :                           usage="D3_EXCLUDE_KIND kind1 kind2 ... ", repeats=.FALSE., &
    1120       64492 :                           n_var=-1, type_of_var=integer_t)
    1121       64492 :       CALL section_add_keyword(subsection, keyword)
    1122       64492 :       CALL keyword_release(keyword)
    1123             : 
    1124             :       ! Ignore selected pair interactins
    1125             :       CALL keyword_create(keyword, __LOCATION__, name="D3_EXCLUDE_KIND_PAIR", &
    1126             :                           description="Specifies the atomic kinds for interactions excluded from the DFT-D3 calculation.", &
    1127             :                           usage="D3_EXCLUDE_KIND_PAIR kind1 kind2 ", repeats=.TRUE., &
    1128       64492 :                           n_var=2, type_of_var=integer_t)
    1129       64492 :       CALL section_add_keyword(subsection, keyword)
    1130       64492 :       CALL keyword_release(keyword)
    1131             : 
    1132             :       ! Set coordination numbers by atom kinds
    1133             :       CALL keyword_create(keyword, __LOCATION__, name="KIND_COORDINATION_NUMBERS", &
    1134             :                           description="Specifies the coordination number for a kind for the C9 term in DFT-D3.", &
    1135             :                           usage="KIND_COORDINATION_NUMBERS CN kind ", repeats=.TRUE., &
    1136       64492 :                           n_var=-1, type_of_var=char_t)
    1137       64492 :       CALL section_add_keyword(subsection, keyword)
    1138       64492 :       CALL keyword_release(keyword)
    1139             :       ! Set coordination numbers by atom numbers
    1140             :       CALL keyword_create(keyword, __LOCATION__, name="ATOM_COORDINATION_NUMBERS", &
    1141             :                           description="Specifies the coordination number of a set of atoms for the C9 term in DFT-D3.", &
    1142             :                           usage="ATOM_COORDINATION_NUMBERS CN atom1 atom2 ... ", repeats=.TRUE., &
    1143       64492 :                           n_var=-1, type_of_var=char_t)
    1144       64492 :       CALL section_add_keyword(subsection, keyword)
    1145       64492 :       CALL keyword_release(keyword)
    1146             : 
    1147             :       ! parameter specification atom by atom
    1148             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMPARM", &
    1149             :                           description="Specifies parameters for atom types (in atomic units). If "// &
    1150             :                           "not provided default parameters are used (DFT-D2).", &
    1151             :                           usage="ATOMPARM <ELEMENT> <C6_parameter> <vdw_radii>", &
    1152       64492 :                           repeats=.TRUE., n_var=-1, type_of_var=char_t)
    1153       64492 :       CALL section_add_keyword(subsection, keyword)
    1154       64492 :       CALL keyword_release(keyword)
    1155             : 
    1156       64492 :       NULLIFY (print_key)
    1157             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PRINT_DFTD", &
    1158             :                                        description="Controls the printing of some info about DFTD contributions", &
    1159       64492 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1160       64492 :       CALL section_add_subsection(subsection, print_key)
    1161       64492 :       CALL section_release(print_key)
    1162             : 
    1163       64492 :       NULLIFY (newsection)
    1164       64492 :       CALL create_eeq_control_section(newsection)
    1165       64492 :       CALL section_add_subsection(subsection, newsection)
    1166       64492 :       CALL section_release(newsection)
    1167             : 
    1168       64492 :       CALL section_add_subsection(section, subsection)
    1169       64492 :       CALL section_release(subsection)
    1170             : 
    1171             :       ! nonlocal section
    1172       64492 :       NULLIFY (subsection, keyword)
    1173             :       CALL section_create(subsection, __LOCATION__, name="NON_LOCAL", &
    1174             :                           description="Information on the non local part of dispersion functionals. "// &
    1175             :                           "Correct functionals require a corresponding setting of XC_FUNCTIONAL.", &
    1176       64492 :                           n_keywords=0, n_subsections=0, repeats=.TRUE.)
    1177             : 
    1178             :       CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
    1179             :                           description="Type of functional (the corresponding kernel data file should be selected). "// &
    1180             :                           "Allows for common forms such as vdW-DF, vdW-DF2, optB88-vdW, rVV10.", &
    1181             :                           usage="TYPE DRSLL", &
    1182             :                           enum_c_vals=s2a("DRSLL", "LMKLL", "RVV10"), &
    1183             :                           enum_i_vals=(/vdw_nl_DRSLL, vdw_nl_LMKLL, vdw_nl_RVV10/), &
    1184             :                           enum_desc=s2a("Dion-Rydberg-Schroeder-Langreth-Lundqvist nonlocal van der Waals density functional", &
    1185             :                                         "Lee-Murray-Kong-Lundqvist-Langreth nonlocal van der Waals density functional", &
    1186             :                                         "Revised Vydrov-van Voorhis nonlocal van der Waals density functional"), &
    1187             :                           citations=(/Tran2013/), &
    1188      128984 :                           default_i_val=vdw_nl_DRSLL)
    1189       64492 :       CALL section_add_keyword(subsection, keyword)
    1190       64492 :       CALL keyword_release(keyword)
    1191             :       CALL keyword_create(keyword, __LOCATION__, name="VERBOSE_OUTPUT", &
    1192             :                           description="Extensive output for non local functionals", &
    1193             :                           usage="VERBOSE_OUTPUT", default_l_val=.FALSE., &
    1194       64492 :                           lone_keyword_l_val=.TRUE.)
    1195       64492 :       CALL section_add_keyword(subsection, keyword)
    1196       64492 :       CALL keyword_release(keyword)
    1197             :       CALL keyword_create(keyword, __LOCATION__, name="KERNEL_FILE_NAME", &
    1198             :                           description="Name of the kernel data file, may include a path. "// &
    1199             :                           "vdW_kernel_table.dat is for DRSLL and LMKLL and "// &
    1200             :                           "rVV10_kernel_table.dat is for rVV10.", &
    1201             :                           usage="KERNEL_FILE_NAME <FILENAME>", &
    1202       64492 :                           default_lc_val="vdW_kernel_table.dat")
    1203       64492 :       CALL section_add_keyword(subsection, keyword)
    1204       64492 :       CALL keyword_release(keyword)
    1205             :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF", &
    1206             :                           description="The cutoff of the FFT grid used in the calculation "// &
    1207             :                           "of the nonlocal vdW functional [Ry].", &
    1208             :                           usage="CUTOFF 300", &
    1209       64492 :                           default_r_val=-1._dp, unit_str="Ry")
    1210       64492 :       CALL section_add_keyword(subsection, keyword)
    1211       64492 :       CALL keyword_release(keyword)
    1212             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETERS", &
    1213             :                           description="Parameters b and C of the rVV10 functional", &
    1214             :                           usage="PARAMETERS 6.3 0.0093", &
    1215       64492 :                           type_of_var=real_t, default_r_vals=(/6.3_dp, 0.0093_dp/), n_var=2)
    1216       64492 :       CALL section_add_keyword(subsection, keyword)
    1217       64492 :       CALL keyword_release(keyword)
    1218             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
    1219             :                           description="Scales the energy contribution of the rVV10 functional", &
    1220             :                           usage="SCALE 1.0", &
    1221       64492 :                           type_of_var=real_t, default_r_val=1.0_dp)
    1222       64492 :       CALL section_add_keyword(subsection, keyword)
    1223       64492 :       CALL keyword_release(keyword)
    1224             : 
    1225       64492 :       CALL section_add_subsection(section, subsection)
    1226       64492 :       CALL section_release(subsection)
    1227             : 
    1228       64492 :    END SUBROUTINE create_vdw_potential_section
    1229             : 
    1230             : ! **************************************************************************************************
    1231             : !> \brief creates the structure of the section needed for gCP potentials
    1232             : !> \param section the section that will be created
    1233             : !> \author jgh
    1234             : ! **************************************************************************************************
    1235       64492 :    SUBROUTINE create_gcp_potential_section(section)
    1236             :       TYPE(section_type), POINTER                        :: section
    1237             : 
    1238             :       TYPE(keyword_type), POINTER                        :: keyword
    1239             : 
    1240       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
    1241             :       CALL section_create(section, __LOCATION__, name="gcp_potential", &
    1242             :                           description="This section combines geometrical counterpoise potentials."// &
    1243             :                           " This is a simple empirical pair potential to correct for BSSE. ", &
    1244             :                           citations=(/Kruse2012/), &
    1245      128984 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    1246             : 
    1247       64492 :       NULLIFY (keyword)
    1248             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_FILE_NAME", &
    1249             :                           description="Name of the parameter file, may include a path", &
    1250             :                           usage="PARAMETER_FILE_NAME <FILENAME>", &
    1251       64492 :                           default_lc_val="---")
    1252       64492 :       CALL section_add_keyword(section, keyword)
    1253       64492 :       CALL keyword_release(keyword)
    1254             : 
    1255             :       CALL keyword_create(keyword, __LOCATION__, name="GLOBAL_PARAMETERS", &
    1256             :                           description="Global parameters of the gCP method."// &
    1257             :                           " Parameters are sigma, alpha, beta, eta from the original paper.", &
    1258             :                           usage="GLOBAL_PARAMETERS 1.0 1.0 1.0 1.0", n_var=4, &
    1259       64492 :                           default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
    1260       64492 :       CALL section_add_keyword(section, keyword)
    1261       64492 :       CALL keyword_release(keyword)
    1262             : 
    1263             :       CALL keyword_create(keyword, __LOCATION__, name="DELTA_ENERGY", &
    1264             :                           description="Specify the delta energy [Hartree] term for an atom kind", &
    1265             :                           usage="DELTA_ENERGY  type value", &
    1266      193476 :                           type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=(/"XX ", "0.0"/))
    1267       64492 :       CALL section_add_keyword(section, keyword)
    1268       64492 :       CALL keyword_release(keyword)
    1269             : 
    1270             :       CALL keyword_create(keyword, __LOCATION__, name="VERBOSE", &
    1271             :                           description="Verbose output for gCP calculation", &
    1272             :                           usage="VERBOSE logical_value", &
    1273       64492 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1274       64492 :       CALL section_add_keyword(section, keyword)
    1275       64492 :       CALL keyword_release(keyword)
    1276             : 
    1277       64492 :    END SUBROUTINE create_gcp_potential_section
    1278             : 
    1279             : ! **************************************************************************************************
    1280             : !> \brief creates the input section for the xc part
    1281             : !> \param section the section to create
    1282             : !> \author fawzi
    1283             : ! **************************************************************************************************
    1284       64492 :    SUBROUTINE create_xc_section(section)
    1285             :       TYPE(section_type), POINTER                        :: section
    1286             : 
    1287             :       TYPE(keyword_type), POINTER                        :: keyword
    1288             :       TYPE(section_type), POINTER                        :: subsection
    1289             : 
    1290       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
    1291             :       CALL section_create(section, __LOCATION__, name="xc", &
    1292             :                           description="Parameters needed for the calculation of the eXchange and Correlation potential", &
    1293       64492 :                           n_keywords=5, n_subsections=2, repeats=.FALSE.)
    1294             : 
    1295       64492 :       NULLIFY (subsection, keyword)
    1296             : 
    1297             :       CALL keyword_create(keyword, __LOCATION__, name="density_cutoff", &
    1298             :                           description="The cutoff on the density used by the xc calculation", &
    1299       64492 :                           usage="density_cutoff 1.e-11", default_r_val=1.0e-10_dp)
    1300       64492 :       CALL section_add_keyword(section, keyword)
    1301       64492 :       CALL keyword_release(keyword)
    1302             : 
    1303             :       CALL keyword_create(keyword, __LOCATION__, name="gradient_cutoff", &
    1304             :                           description="The cutoff on the gradient of the density used by the "// &
    1305             :                           "xc calculation", &
    1306       64492 :                           usage="gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
    1307       64492 :       CALL section_add_keyword(section, keyword)
    1308       64492 :       CALL keyword_release(keyword)
    1309             : 
    1310             :       CALL keyword_create(keyword, __LOCATION__, name="DENSITY_SMOOTH_CUTOFF_RANGE", &
    1311             :                           description="Parameter for the smoothing procedure in xc calculation", &
    1312       64492 :                           usage="gradient_cutoff {real}", default_r_val=0.0_dp)
    1313       64492 :       CALL section_add_keyword(section, keyword)
    1314       64492 :       CALL keyword_release(keyword)
    1315             : 
    1316             :       CALL keyword_create(keyword, __LOCATION__, name="tau_cutoff", &
    1317             :                           description="The cutoff on tau used by the xc calculation", &
    1318       64492 :                           usage="tau_cutoff 1.e-11", default_r_val=1.0e-10_dp)
    1319       64492 :       CALL section_add_keyword(section, keyword)
    1320       64492 :       CALL keyword_release(keyword)
    1321             : 
    1322             :       CALL keyword_create( &
    1323             :          keyword, __LOCATION__, name="FUNCTIONAL_ROUTINE", &
    1324             :          description="Select the code for xc calculation", &
    1325             :          usage="FUNCTIONAL_ROUTINE (DEFAULT|TEST_LSD|DEBUG)", &
    1326             :          default_i_val=xc_default_f_routine, &
    1327             :          enum_c_vals=s2a("DEFAULT", "TEST_LSD", "DEBUG"), &
    1328             :          enum_i_vals=(/xc_default_f_routine, xc_test_lsd_f_routine, xc_debug_new_routine/), &
    1329             :          enum_desc=s2a("Carry out exchange-correlation functional calculation", &
    1330             :                        "Use test local-spin-density approximation code for exchange-correlation functional calculation", &
    1331       64492 :                        "Use debug new code for exchange-correlation functional calculation"))
    1332       64492 :       CALL section_add_keyword(section, keyword)
    1333       64492 :       CALL keyword_release(keyword)
    1334             : 
    1335             :       CALL section_create(subsection, __LOCATION__, name="xc_grid", & !FM to do
    1336             :                           description="The xc parameters used when calculating the xc on the grid", &
    1337       64492 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
    1338             :       CALL keyword_create(keyword, __LOCATION__, name="xc_smooth_rho", &
    1339             :                           description="The density smoothing used for the xc calculation", &
    1340             :                           usage="xc_smooth_rho nn10", default_i_val=xc_rho_no_smooth, &
    1341             :                           enum_c_vals=s2a("NONE", "NN50", "NN10", "SPLINE2", "NN6", "SPLINE3", "NN4"), &
    1342             :                           enum_i_vals=(/xc_rho_no_smooth, xc_rho_nn50, xc_rho_nn10, &
    1343             :                                         xc_rho_spline2_smooth, xc_rho_spline2_smooth, xc_rho_spline3_smooth, &
    1344       64492 :                                         xc_rho_spline3_smooth/))
    1345       64492 :       CALL section_add_keyword(subsection, keyword)
    1346       64492 :       CALL keyword_release(keyword)
    1347             : 
    1348             :       CALL keyword_create(keyword, __LOCATION__, name="xc_deriv", &
    1349             :                           description="The method used to compute the derivatives", &
    1350             :                           usage="xc_deriv NN10_SMOOTH", default_i_val=xc_deriv_pw, &
    1351             :                           enum_c_vals=s2a("PW", "SPLINE3", "SPLINE2", "NN50_SMOOTH", "NN10_SMOOTH", &
    1352             :                                           "SPLINE2_SMOOTH", "NN6_SMOOTH", "SPLINE3_SMOOTH", "NN4_SMOOTH", "COLLOCATE"), &
    1353             :                           enum_i_vals=(/xc_deriv_pw, xc_deriv_spline3, xc_deriv_spline2, &
    1354             :                                         xc_deriv_nn50_smooth, xc_deriv_nn10_smooth, xc_deriv_spline2_smooth, &
    1355             :                                         xc_deriv_spline2_smooth, xc_deriv_spline3_smooth, xc_deriv_spline3_smooth, &
    1356       64492 :                                         xc_deriv_collocate/))
    1357       64492 :       CALL section_add_keyword(subsection, keyword)
    1358       64492 :       CALL keyword_release(keyword)
    1359             : 
    1360             :       CALL keyword_create(keyword, __LOCATION__, name="use_finer_grid", &
    1361             :                           description="Uses a finer grid only to calculate the xc", &
    1362             :                           usage="use_finer_grid", default_l_val=.FALSE., &
    1363       64492 :                           lone_keyword_l_val=.TRUE.)
    1364       64492 :       CALL section_add_keyword(subsection, keyword)
    1365       64492 :       CALL keyword_release(keyword)
    1366             : 
    1367             :       CALL keyword_create(keyword, __LOCATION__, name="2ND_DERIV_ANALYTICAL", &
    1368             :                           description="Use analytical formulas or finite differences for 2nd derivatives of XC", &
    1369             :                           usage="2ND_DERIV_ANALYTICAL logical", default_l_val=.TRUE., &
    1370       64492 :                           lone_keyword_l_val=.TRUE.)
    1371       64492 :       CALL section_add_keyword(section, keyword)
    1372       64492 :       CALL keyword_release(keyword)
    1373             : 
    1374             :       CALL keyword_create(keyword, __LOCATION__, name="3RD_DERIV_ANALYTICAL", &
    1375             :                           description="Use analytical formulas or finite differences for 3rd derivatives of XC", &
    1376             :                           usage="3RD_DERIV_ANALYTICAL logical", default_l_val=.TRUE., &
    1377       64492 :                           lone_keyword_l_val=.TRUE.)
    1378       64492 :       CALL section_add_keyword(section, keyword)
    1379       64492 :       CALL keyword_release(keyword)
    1380             : 
    1381             :       CALL keyword_create(keyword, __LOCATION__, name="STEP_SIZE", &
    1382             :                           description="Step size in terms of the first order potential for the numerical "// &
    1383             :                           "evaluation of XC derivatives", &
    1384       64492 :                           usage="STEP_SIZE 1.0E-3", default_r_val=1e-3_dp)
    1385       64492 :       CALL section_add_keyword(section, keyword)
    1386       64492 :       CALL keyword_release(keyword)
    1387             : 
    1388             :       CALL keyword_create(keyword, __LOCATION__, name="NSTEPS", &
    1389             :                           description="Number of steps to consider in each direction for the numerical "// &
    1390             :                           "evaluation of XC derivatives. Must be a value from 1 to 4 (Default: 3).", &
    1391       64492 :                           usage="NSTEPS 4", default_i_val=3)
    1392       64492 :       CALL section_add_keyword(section, keyword)
    1393       64492 :       CALL keyword_release(keyword)
    1394             : 
    1395       64492 :       CALL section_add_subsection(section, subsection)
    1396       64492 :       CALL section_release(subsection)
    1397             : 
    1398       64492 :       CALL create_xc_fun_section(subsection)
    1399       64492 :       CALL section_add_subsection(section, subsection)
    1400       64492 :       CALL section_release(subsection)
    1401             : 
    1402       64492 :       CALL create_hfx_section(subsection)
    1403       64492 :       CALL section_add_subsection(section, subsection)
    1404       64492 :       CALL section_release(subsection)
    1405             : 
    1406       64492 :       CALL create_mp2_section(subsection)
    1407       64492 :       CALL section_add_subsection(section, subsection)
    1408       64492 :       CALL section_release(subsection)
    1409             : 
    1410       64492 :       CALL create_adiabatic_section(subsection)
    1411       64492 :       CALL section_add_subsection(section, subsection)
    1412       64492 :       CALL section_release(subsection)
    1413             : 
    1414       64492 :       CALL create_xc_potential_section(subsection)
    1415       64492 :       CALL section_add_subsection(section, subsection)
    1416       64492 :       CALL section_release(subsection)
    1417             : 
    1418       64492 :       CALL create_xc_kernel_section(subsection)
    1419       64492 :       CALL section_add_subsection(section, subsection)
    1420       64492 :       CALL section_release(subsection)
    1421             : 
    1422       64492 :       CALL create_hfx_kernel_section(subsection)
    1423       64492 :       CALL section_add_subsection(section, subsection)
    1424       64492 :       CALL section_release(subsection)
    1425             : 
    1426       64492 :       CALL create_vdw_potential_section(subsection)
    1427       64492 :       CALL section_add_subsection(section, subsection)
    1428       64492 :       CALL section_release(subsection)
    1429             : 
    1430       64492 :       CALL create_gcp_potential_section(subsection)
    1431       64492 :       CALL section_add_subsection(section, subsection)
    1432       64492 :       CALL section_release(subsection)
    1433             : 
    1434       64492 :    END SUBROUTINE create_xc_section
    1435             : 
    1436             : ! **************************************************************************************************
    1437             : !> \brief creates the section for adiabatic hybrid functionals
    1438             : !> \param section ...
    1439             : !> \author Manuel Guidon
    1440             : ! **************************************************************************************************
    1441       64492 :    SUBROUTINE create_adiabatic_section(section)
    1442             :       TYPE(section_type), POINTER                        :: section
    1443             : 
    1444             :       TYPE(keyword_type), POINTER                        :: keyword
    1445             : 
    1446       64492 :       CPASSERT(.NOT. ASSOCIATED(section))
    1447             :       CALL section_create(section, __LOCATION__, name="ADIABATIC_RESCALING", &
    1448             :                           description="Parameters for self interaction corrected hybrid functionals", &
    1449       64492 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
    1450       64492 :       NULLIFY (keyword)
    1451             :       CALL keyword_create( &
    1452             :          keyword, __LOCATION__, &
    1453             :          name="FUNCTIONAL_TYPE", &
    1454             :          description="Which Hybrid functional should be used. "// &
    1455             :          "(Has to be consistent with the definitions in XC and HF).", &
    1456             :          usage="FUNCTIONAL_TYPE MCY3", &
    1457             :          enum_c_vals=s2a("MCY3"), &
    1458             :          enum_i_vals=(/do_adiabatic_hybrid_mcy3/), &
    1459             :          enum_desc=s2a("Use MCY3 hybrid functional"), &
    1460       64492 :          default_i_val=do_adiabatic_hybrid_mcy3)
    1461       64492 :       CALL section_add_keyword(section, keyword)
    1462       64492 :       CALL keyword_release(keyword)
    1463             : 
    1464       64492 :       NULLIFY (keyword)
    1465             :       CALL keyword_create( &
    1466             :          keyword, __LOCATION__, &
    1467             :          name="LAMBDA", &
    1468             :          description="The point to be used along the adiabatic curve (0 &lt; &lambda; &lt; 1)", &
    1469             :          usage="LAMBDA 0.71", &
    1470       64492 :          default_r_val=0.71_dp)
    1471       64492 :       CALL section_add_keyword(section, keyword)
    1472       64492 :       CALL keyword_release(keyword)
    1473             : 
    1474       64492 :       NULLIFY (keyword)
    1475             :       CALL keyword_create( &
    1476             :          keyword, __LOCATION__, &
    1477             :          name="OMEGA", &
    1478             :          description="Long-range parameter", &
    1479             :          usage="OMEGA 0.2", &
    1480       64492 :          default_r_val=0.2_dp)
    1481       64492 :       CALL section_add_keyword(section, keyword)
    1482       64492 :       CALL keyword_release(keyword)
    1483             : 
    1484       64492 :       NULLIFY (keyword)
    1485             :       CALL keyword_create( &
    1486             :          keyword, __LOCATION__, &
    1487             :          name="FUNCTIONAL_MODEL", &
    1488             :          description="Which model for the coupling constant integration should be used. ", &
    1489             :          usage="FUNCTIONAL_MODEL PADE", &
    1490             :          enum_c_vals=s2a("PADE"), &
    1491             :          enum_i_vals=(/do_adiabatic_model_pade/), &
    1492             :          enum_desc=s2a("Use pade model: W(lambda)=a+(b*lambda)/(1+c*lambda)"), &
    1493       64492 :          default_i_val=do_adiabatic_model_pade)
    1494       64492 :       CALL section_add_keyword(section, keyword)
    1495       64492 :       CALL keyword_release(keyword)
    1496       64492 :    END SUBROUTINE create_adiabatic_section
    1497             : 
    1498             : END MODULE input_cp2k_xc

Generated by: LCOV version 1.15