LCOV - code coverage report
Current view: top level - src - input_cp2k_tb.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:42dac4a) Lines: 100.0 % 223 223
Test Date: 2025-07-25 12:55:17 Functions: 100.0 % 6 6

            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 dft section of the input
      10              : !> \par History
      11              : !>      10.2005 moved out of input_cp2k [fawzi]
      12              : !> \author fawzi
      13              : ! **************************************************************************************************
      14              : MODULE input_cp2k_tb
      15              :    USE bibliography,                    ONLY: &
      16              :         Asgeirsson2017, Bannwarth2019, Caldeweyher2017, Caldeweyher2020, Elstner1998, Grimme2017, &
      17              :         Hu2007, Porezag1995, Seifert1996, Zhechkov2005
      18              :    USE eeq_input,                       ONLY: create_eeq_control_section
      19              :    USE input_constants,                 ONLY: dispersion_d2,&
      20              :                                               dispersion_d3,&
      21              :                                               dispersion_d3bj,&
      22              :                                               dispersion_uff,&
      23              :                                               gfn1xtb,&
      24              :                                               gfn2xtb,&
      25              :                                               ipea1xtb,&
      26              :                                               slater
      27              :    USE input_cp2k_mm,                   ONLY: create_GENPOT_section
      28              :    USE input_keyword_types,             ONLY: keyword_create,&
      29              :                                               keyword_release,&
      30              :                                               keyword_type
      31              :    USE input_section_types,             ONLY: section_add_keyword,&
      32              :                                               section_add_subsection,&
      33              :                                               section_create,&
      34              :                                               section_release,&
      35              :                                               section_type
      36              :    USE input_val_types,                 ONLY: char_t
      37              :    USE kinds,                           ONLY: dp
      38              :    USE string_utilities,                ONLY: s2a
      39              : #include "./base/base_uses.f90"
      40              : 
      41              :    IMPLICIT NONE
      42              :    PRIVATE
      43              : 
      44              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_tb'
      45              : 
      46              :    PUBLIC :: create_dftb_control_section, create_xtb_control_section
      47              : 
      48              : CONTAINS
      49              : 
      50              : ! **************************************************************************************************
      51              : !> \brief ...
      52              : !> \param section ...
      53              : ! **************************************************************************************************
      54         9254 :    SUBROUTINE create_dftb_control_section(section)
      55              :       TYPE(section_type), POINTER                        :: section
      56              : 
      57              :       TYPE(keyword_type), POINTER                        :: keyword
      58              :       TYPE(section_type), POINTER                        :: subsection
      59              : 
      60         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
      61              :       CALL section_create(section, __LOCATION__, name="DFTB", &
      62              :                           description="Parameters needed to set up the DFTB methods", &
      63              :                           n_keywords=1, n_subsections=1, repeats=.FALSE., &
      64        46270 :                           citations=(/Porezag1995, Seifert1996, Elstner1998, Zhechkov2005/))
      65              : 
      66         9254 :       NULLIFY (subsection)
      67         9254 :       CALL create_dftb_parameter_section(subsection)
      68         9254 :       CALL section_add_subsection(section, subsection)
      69         9254 :       CALL section_release(subsection)
      70              : 
      71         9254 :       NULLIFY (keyword)
      72              :       CALL keyword_create(keyword, __LOCATION__, name="self_consistent", &
      73              :                           description="Use self-consistent method", &
      74              :                           citations=(/Elstner1998/), &
      75        18508 :                           usage="SELF_CONSISTENT", default_l_val=.TRUE.)
      76         9254 :       CALL section_add_keyword(section, keyword)
      77         9254 :       CALL keyword_release(keyword)
      78              : 
      79              :       CALL keyword_create(keyword, __LOCATION__, name="orthogonal_basis", &
      80              :                           description="Assume orthogonal basis set", &
      81         9254 :                           usage="ORTHOGONAL_BASIS", default_l_val=.FALSE.)
      82         9254 :       CALL section_add_keyword(section, keyword)
      83         9254 :       CALL keyword_release(keyword)
      84              : 
      85              :       CALL keyword_create(keyword, __LOCATION__, name="do_ewald", &
      86              :                           description="Use Ewald type method instead of direct sum for Coulomb interaction", &
      87         9254 :                           usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
      88         9254 :       CALL section_add_keyword(section, keyword)
      89         9254 :       CALL keyword_release(keyword)
      90              : 
      91              :       CALL keyword_create(keyword, __LOCATION__, name="dispersion", &
      92              :                           description="Use dispersion correction", &
      93              :                           citations=(/Zhechkov2005/), lone_keyword_l_val=.TRUE., &
      94        18508 :                           usage="DISPERSION", default_l_val=.FALSE.)
      95         9254 :       CALL section_add_keyword(section, keyword)
      96         9254 :       CALL keyword_release(keyword)
      97              : 
      98              :       CALL keyword_create(keyword, __LOCATION__, name="DIAGONAL_DFTB3", &
      99              :                           description="Use a diagonal version of the 3rd order energy correction (DFTB3) ", &
     100              :                           lone_keyword_l_val=.TRUE., &
     101         9254 :                           usage="DIAGONAL_DFTB3", default_l_val=.FALSE.)
     102         9254 :       CALL section_add_keyword(section, keyword)
     103         9254 :       CALL keyword_release(keyword)
     104              : 
     105              :       CALL keyword_create(keyword, __LOCATION__, name="HB_SR_GAMMA", &
     106              :                           description="Uses a modified version for the GAMMA within the SCC-DFTB scheme, "// &
     107              :                           "specifically tuned for hydrogen bonds.", &
     108              :                           citations=(/Hu2007/), lone_keyword_l_val=.TRUE., &
     109        18508 :                           usage="HB_SR_GAMMA", default_l_val=.FALSE.)
     110         9254 :       CALL section_add_keyword(section, keyword)
     111         9254 :       CALL keyword_release(keyword)
     112              : 
     113              :       CALL keyword_create(keyword, __LOCATION__, name="eps_disp", &
     114              :                           description="Define accuracy of dispersion interaction", &
     115         9254 :                           usage="EPS_DISP", default_r_val=0.0001_dp)
     116         9254 :       CALL section_add_keyword(section, keyword)
     117         9254 :       CALL keyword_release(keyword)
     118              : 
     119         9254 :    END SUBROUTINE create_dftb_control_section
     120              : 
     121              : ! **************************************************************************************************
     122              : !> \brief ...
     123              : !> \param section ...
     124              : ! **************************************************************************************************
     125         9254 :    SUBROUTINE create_xtb_control_section(section)
     126              :       TYPE(section_type), POINTER                        :: section
     127              : 
     128              :       TYPE(keyword_type), POINTER                        :: keyword
     129              :       TYPE(section_type), POINTER                        :: subsection
     130              : 
     131         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     132              :       CALL section_create(section, __LOCATION__, name="xTB", &
     133              :                           description="Parameters needed to set up the xTB methods", &
     134              :                           n_keywords=1, n_subsections=1, repeats=.FALSE., &
     135        18508 :                           citations=(/GRIMME2017/))
     136              : 
     137         9254 :       NULLIFY (subsection)
     138         9254 :       CALL create_xtb_parameter_section(subsection)
     139         9254 :       CALL section_add_subsection(section, subsection)
     140         9254 :       CALL section_release(subsection)
     141              : 
     142         9254 :       CALL create_xtb_nonbonded_section(subsection)
     143         9254 :       CALL section_add_subsection(section, subsection)
     144         9254 :       CALL section_release(subsection)
     145              : 
     146         9254 :       CALL create_eeq_control_section(subsection)
     147         9254 :       CALL section_add_subsection(section, subsection)
     148         9254 :       CALL section_release(subsection)
     149              : 
     150         9254 :       CALL create_xtb_tblite_section(subsection)
     151         9254 :       CALL section_add_subsection(section, subsection)
     152         9254 :       CALL section_release(subsection)
     153              : 
     154         9254 :       NULLIFY (keyword)
     155              :       CALL keyword_create(keyword, __LOCATION__, name="GFN_TYPE", &
     156              :                           description="Which GFN xTB method should be used.", &
     157         9254 :                           usage="GFN_TYPE 1", default_i_val=1)
     158         9254 :       CALL section_add_keyword(section, keyword)
     159         9254 :       CALL keyword_release(keyword)
     160              : 
     161              :       CALL keyword_create(keyword, __LOCATION__, name="DO_EWALD", &
     162              :                           description="Use Ewald type method instead of direct sum for Coulomb interaction", &
     163         9254 :                           usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     164         9254 :       CALL section_add_keyword(section, keyword)
     165         9254 :       CALL keyword_release(keyword)
     166              : 
     167              :       CALL keyword_create(keyword, __LOCATION__, name="STO_NG", &
     168              :                           description="Provides the order of the Slater orbital expansion in GTOs.", &
     169         9254 :                           usage="STO_NG 3", default_i_val=6)
     170         9254 :       CALL section_add_keyword(section, keyword)
     171         9254 :       CALL keyword_release(keyword)
     172              : 
     173              :       CALL keyword_create(keyword, __LOCATION__, name="HYDROGEN_STO_NG", &
     174              :                           description="Number of GTOs for Hydrogen basis expansion.", &
     175         9254 :                           usage="HYDROGEN_STO_NG 3", default_i_val=4)
     176         9254 :       CALL section_add_keyword(section, keyword)
     177         9254 :       CALL keyword_release(keyword)
     178              : 
     179              :       CALL keyword_create(keyword, __LOCATION__, name="USE_HALOGEN_CORRECTION", &
     180              :                           description="Use XB interaction term", &
     181         9254 :                           usage="USE_HALOGEN_CORRECTION T", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     182         9254 :       CALL section_add_keyword(section, keyword)
     183         9254 :       CALL keyword_release(keyword)
     184              : 
     185              :       CALL keyword_create(keyword, __LOCATION__, name="DO_NONBONDED", &
     186              :                           description="Controls the computation of real-space "// &
     187              :                           "(short-range) nonbonded interactions as correction to xTB.", &
     188         9254 :                           usage="DO_NONBONDED T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     189         9254 :       CALL section_add_keyword(section, keyword)
     190         9254 :       CALL keyword_release(keyword)
     191              : 
     192              :       CALL keyword_create(keyword, __LOCATION__, name="VDW_POTENTIAL", &
     193              :                           description="vdW potential to be used: NONE, DFTD3, DFTD4. "// &
     194              :                           "Defaults: DFTD3(gfn1), DFTD4(gfn0, gfn2).", &
     195         9254 :                           usage="VDW_POTENTIAL type", default_c_val="")
     196         9254 :       CALL section_add_keyword(section, keyword)
     197         9254 :       CALL keyword_release(keyword)
     198              : 
     199              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_INTERACTION", &
     200              :                           description="Use Coulomb interaction terms (electrostatics + TB3); for debug only", &
     201         9254 :                           usage="COULOMB_INTERACTION T", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     202         9254 :       CALL section_add_keyword(section, keyword)
     203         9254 :       CALL keyword_release(keyword)
     204              : 
     205              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_LR", &
     206              :                           description="Use Coulomb LR (1/r) interaction terms; for debug only", &
     207         9254 :                           usage="COULOMB_LR T", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     208         9254 :       CALL section_add_keyword(section, keyword)
     209         9254 :       CALL keyword_release(keyword)
     210              : 
     211              :       CALL keyword_create(keyword, __LOCATION__, name="TB3_INTERACTION", &
     212              :                           description="Use TB3 interaction terms; for debug only", &
     213         9254 :                           usage="TB3_INTERACTION T", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     214         9254 :       CALL section_add_keyword(section, keyword)
     215         9254 :       CALL keyword_release(keyword)
     216              : 
     217              :       CALL keyword_create(keyword, __LOCATION__, name="CHECK_ATOMIC_CHARGES", &
     218              :                           description="Stop calculation if atomic charges are outside chemical range.", &
     219         9254 :                           usage="CHECK_ATOMIC_CHARGES T", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     220         9254 :       CALL section_add_keyword(section, keyword)
     221         9254 :       CALL keyword_release(keyword)
     222              : 
     223              :       CALL keyword_create(keyword, __LOCATION__, name="VARIATIONAL_DIPOLE", &
     224              :                           description="gfn0-xTB use dipole definition from energy derivative.", &
     225         9254 :                           usage="VARIATIONAL_DIPOLE T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     226         9254 :       CALL section_add_keyword(section, keyword)
     227         9254 :       CALL keyword_release(keyword)
     228              : 
     229              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_PAIRPOTENTIAL", &
     230              :                           description="Accuracy for the repulsive pair potential.", &
     231         9254 :                           usage="EPS_PAIRPOTENTIAL 1.0E-8", default_r_val=1.0e-10_dp)
     232         9254 :       CALL section_add_keyword(section, keyword)
     233         9254 :       CALL keyword_release(keyword)
     234              : 
     235              :       CALL keyword_create(keyword, __LOCATION__, name="EN_SHIFT_TYPE", &
     236              :                           description="Shift function for electronegativity in EEQ method. "// &
     237              :                           "[Select/Molecule/Crystal] Default Select from periodicity.", &
     238              :                           usage="EN_SHIFT_TYPE [Select/Molecule/Crystal]", &
     239         9254 :                           n_var=1, type_of_var=char_t, default_c_val="Molecule")
     240         9254 :       CALL section_add_keyword(section, keyword)
     241         9254 :       CALL keyword_release(keyword)
     242              : 
     243         9254 :    END SUBROUTINE create_xtb_control_section
     244              : 
     245              : ! **************************************************************************************************
     246              : !> \brief ...
     247              : !> \param section ...
     248              : ! **************************************************************************************************
     249         9254 :    SUBROUTINE create_dftb_parameter_section(section)
     250              : 
     251              :       TYPE(section_type), POINTER                        :: section
     252              : 
     253              :       TYPE(keyword_type), POINTER                        :: keyword
     254              : 
     255         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     256              : 
     257              :       CALL section_create(section, __LOCATION__, name="PARAMETER", &
     258              :                           description="Information on where to find DFTB parameters", &
     259         9254 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     260              : 
     261         9254 :       NULLIFY (keyword)
     262              :       CALL keyword_create(keyword, __LOCATION__, name="SK_FILE", &
     263              :                           description="Define parameter file for atom pair", &
     264              :                           usage="SK_FILE a1 a2 filename", &
     265         9254 :                           n_var=3, type_of_var=char_t, repeats=.TRUE.)
     266         9254 :       CALL section_add_keyword(section, keyword)
     267         9254 :       CALL keyword_release(keyword)
     268              : 
     269              :       CALL keyword_create(keyword, __LOCATION__, name="PARAM_FILE_PATH", &
     270              :                           description="Specify the directory with the DFTB parameter files. "// &
     271              :                           "Used in combination with the filenames specified in the file "// &
     272              :                           "given in PARAM_FILE_NAME.", usage="PARAM_FILE_PATH pathname", &
     273         9254 :                           n_var=1, type_of_var=char_t, default_c_val="./")
     274         9254 :       CALL section_add_keyword(section, keyword)
     275         9254 :       CALL keyword_release(keyword)
     276              : 
     277              :       CALL keyword_create(keyword, __LOCATION__, name="PARAM_FILE_NAME", &
     278              :                           description="Specify file that contains the names of "// &
     279              :                           "Slater-Koster tables: A plain text file, each line has the "// &
     280              :                           'format "ATOM1 ATOM2 filename.spl".', &
     281              :                           usage="PARAM_FILE_NAME filename", &
     282         9254 :                           n_var=1, type_of_var=char_t, default_c_val="")
     283         9254 :       CALL section_add_keyword(section, keyword)
     284         9254 :       CALL keyword_release(keyword)
     285              : 
     286              :       CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_TYPE", &
     287              :                           description="Use dispersion correction of the specified type."// &
     288              :                           " Dispersion correction has to be switched on in the DFTB section.", &
     289              :                           usage="DISPERSION_TYPE (UFF|D3|D3(BJ)|D2)", &
     290              :                           enum_c_vals=s2a("UFF", "D3", "D3(BJ)", "D2"), &
     291              :                           enum_i_vals=(/dispersion_uff, dispersion_d3, dispersion_d3bj, dispersion_d2/), &
     292              :                           enum_desc=s2a("Uses the UFF force field for a pair potential dispersion correction.", &
     293              :                                         "Uses the Grimme D3 method (simplified) for a pair potential dispersion correction.", &
     294              :                                         "Uses the Grimme D3 method (simplified) with Becke-Johnson attenuation.", &
     295              :                                         "Uses the Grimme D2 method for pair potential dispersion correction."), &
     296         9254 :                           default_i_val=dispersion_uff)
     297         9254 :       CALL section_add_keyword(section, keyword)
     298         9254 :       CALL keyword_release(keyword)
     299              : 
     300              :       CALL keyword_create(keyword, __LOCATION__, name="UFF_FORCE_FIELD", &
     301              :                           description="Name of file with UFF parameters that will be used "// &
     302              :                           "for the dispersion correction. Needs to be specified when "// &
     303              :                           "DISPERSION==.TRUE., otherwise cp2k crashes with a Segmentation "// &
     304              :                           "Fault.", usage="UFF_FORCE_FIELD filename", &
     305         9254 :                           n_var=1, type_of_var=char_t, default_c_val="")
     306         9254 :       CALL section_add_keyword(section, keyword)
     307         9254 :       CALL keyword_release(keyword)
     308              : 
     309              :       CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_PARAMETER_FILE", &
     310              :                           description="Specify file that contains the atomic dispersion "// &
     311              :                           "parameters for the D3 method", &
     312              :                           usage="DISPERSION_PARAMETER_FILE filename", &
     313         9254 :                           n_var=1, type_of_var=char_t, default_c_val="")
     314         9254 :       CALL section_add_keyword(section, keyword)
     315         9254 :       CALL keyword_release(keyword)
     316              : 
     317              :       CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_RADIUS", &
     318              :                           description="Define radius of dispersion interaction", &
     319         9254 :                           usage="DISPERSION_RADIUS", default_r_val=15._dp)
     320         9254 :       CALL section_add_keyword(section, keyword)
     321         9254 :       CALL keyword_release(keyword)
     322              : 
     323              :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATION_CUTOFF", &
     324              :                           description="Define cutoff for coordination number calculation", &
     325         9254 :                           usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
     326         9254 :       CALL section_add_keyword(section, keyword)
     327         9254 :       CALL keyword_release(keyword)
     328              : 
     329              :       CALL keyword_create(keyword, __LOCATION__, name="D3_SCALING", &
     330              :                           description="Scaling parameters (s6,sr6,s8) for the D3 dispersion method,", &
     331         9254 :                           usage="D3_SCALING 1.0 1.0 1.0", n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
     332         9254 :       CALL section_add_keyword(section, keyword)
     333         9254 :       CALL keyword_release(keyword)
     334              : 
     335              :       CALL keyword_create(keyword, __LOCATION__, name="D3BJ_SCALING", &
     336              :                           description="Scaling parameters (s6,a1,s8,a2) for the D3(BJ) dispersion method,", &
     337              :                           usage="D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
     338         9254 :                           default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
     339         9254 :       CALL section_add_keyword(section, keyword)
     340         9254 :       CALL keyword_release(keyword)
     341              : 
     342              :       CALL keyword_create(keyword, __LOCATION__, name="D2_SCALING", &
     343              :                           description="Scaling parameter for the D2 dispersion method,", &
     344         9254 :                           usage="D2_SCALING 1.0", default_r_val=1.0_dp)
     345         9254 :       CALL section_add_keyword(section, keyword)
     346         9254 :       CALL keyword_release(keyword)
     347              : 
     348              :       CALL keyword_create(keyword, __LOCATION__, name="D2_EXP_PRE", &
     349              :                           description="Exp prefactor for damping for the D2 dispersion method,", &
     350         9254 :                           usage="D2_EXP_PRE 2.0", default_r_val=2.0_dp)
     351         9254 :       CALL section_add_keyword(section, keyword)
     352         9254 :       CALL keyword_release(keyword)
     353              : 
     354              :       CALL keyword_create(keyword, __LOCATION__, name="HB_SR_PARAM", &
     355              :                           description="Uses a modified version for the GAMMA within the SCC-DFTB scheme, "// &
     356              :                           "specifically tuned for hydrogen bonds. Specify the exponent used in the exponential.", &
     357         9254 :                           usage="HB_SR_PARAM {real}", default_r_val=4.0_dp)
     358         9254 :       CALL section_add_keyword(section, keyword)
     359         9254 :       CALL keyword_release(keyword)
     360              : 
     361         9254 :    END SUBROUTINE create_dftb_parameter_section
     362              : 
     363              : ! **************************************************************************************************
     364              : !> \brief ...
     365              : !> \param section ...
     366              : ! **************************************************************************************************
     367         9254 :    SUBROUTINE create_xtb_parameter_section(section)
     368              : 
     369              :       TYPE(section_type), POINTER                        :: section
     370              : 
     371              :       TYPE(keyword_type), POINTER                        :: keyword
     372              : 
     373         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     374              : 
     375              :       CALL section_create(section, __LOCATION__, name="PARAMETER", &
     376              :                           description="Information on and where to find xTB parameters", &
     377         9254 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     378              : 
     379         9254 :       NULLIFY (keyword)
     380              :       CALL keyword_create(keyword, __LOCATION__, name="PARAM_FILE_PATH", &
     381              :                           description="Specify the directory with the xTB parameter file. ", &
     382              :                           usage="PARAM_FILE_PATH pathname", &
     383         9254 :                           n_var=1, type_of_var=char_t, default_c_val="")
     384         9254 :       CALL section_add_keyword(section, keyword)
     385         9254 :       CALL keyword_release(keyword)
     386              : 
     387              :       CALL keyword_create(keyword, __LOCATION__, name="PARAM_FILE_NAME", &
     388              :                           description="Specify file that contains all xTB default parameters. ", &
     389              :                           usage="PARAM_FILE_NAME filename", &
     390         9254 :                           n_var=1, type_of_var=char_t, default_c_val="xTB_parameters")
     391         9254 :       CALL section_add_keyword(section, keyword)
     392         9254 :       CALL keyword_release(keyword)
     393              : 
     394              :       CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_PARAMETER_FILE", &
     395              :                           description="Specify file that contains the atomic dispersion "// &
     396              :                           "parameters for the D3 method", &
     397              :                           usage="DISPERSION_PARAMETER_FILE filename", &
     398         9254 :                           n_var=1, type_of_var=char_t, default_c_val="dftd3.dat")
     399         9254 :       CALL section_add_keyword(section, keyword)
     400         9254 :       CALL keyword_release(keyword)
     401              : 
     402              :       CALL keyword_create(keyword, __LOCATION__, name="DISPERSION_RADIUS", &
     403              :                           description="Define radius of dispersion interaction", &
     404         9254 :                           usage="DISPERSION_RADIUS", default_r_val=15._dp)
     405         9254 :       CALL section_add_keyword(section, keyword)
     406         9254 :       CALL keyword_release(keyword)
     407              : 
     408              :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATION_CUTOFF", &
     409              :                           description="Define cutoff for coordination number calculation", &
     410         9254 :                           usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
     411         9254 :       CALL section_add_keyword(section, keyword)
     412         9254 :       CALL keyword_release(keyword)
     413              : 
     414              :       CALL keyword_create(keyword, __LOCATION__, name="D3BJ_SCALING", &
     415              :                           description="Scaling parameters (s6,s8) for the D3 dispersion method.", &
     416         9254 :                           usage="D3BJ_SCALING 1.0 2.4", n_var=2, default_r_vals=(/1.0_dp, 2.4_dp/))
     417         9254 :       CALL section_add_keyword(section, keyword)
     418         9254 :       CALL keyword_release(keyword)
     419              : 
     420              :       CALL keyword_create(keyword, __LOCATION__, name="D3BJ_PARAM", &
     421              :                           description="Becke-Johnson parameters (a1, a2 for the D3 dispersion method.", &
     422         9254 :                           usage="D3BJ_PARAM 0.63 5.0", n_var=2, default_r_vals=(/0.63_dp, 5.0_dp/))
     423         9254 :       CALL section_add_keyword(section, keyword)
     424         9254 :       CALL keyword_release(keyword)
     425              : 
     426              :       CALL keyword_create(keyword, __LOCATION__, name="HUCKEL_CONSTANTS", &
     427              :                           description="Huckel parameters (s, p, d, sp, 2sH).", &
     428              :                           usage="HUCKEL_CONSTANTS 1.85 2.25 2.00 2.08 2.85", n_var=5, &
     429         9254 :                           default_r_vals=(/1.85_dp, 2.25_dp, 2.00_dp, 2.08_dp, 2.85_dp/))
     430         9254 :       CALL section_add_keyword(section, keyword)
     431         9254 :       CALL keyword_release(keyword)
     432              : 
     433              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_CONSTANTS", &
     434              :                           description="Scaling parameters for Coulomb interactions (electrons, nuclei).", &
     435              :                           usage="COULOMB_CONSTANTS 2.00 1.50", n_var=2, &
     436         9254 :                           default_r_vals=(/2.00_dp, 1.50_dp/))
     437         9254 :       CALL section_add_keyword(section, keyword)
     438         9254 :       CALL keyword_release(keyword)
     439              : 
     440              :       CALL keyword_create(keyword, __LOCATION__, name="CN_CONSTANTS", &
     441              :                           description="Scaling parameters for Coordination number correction term.", &
     442              :                           usage="CN_CONSTANTS 0.006 -0.003 -0.005", n_var=3, &
     443         9254 :                           default_r_vals=(/0.006_dp, -0.003_dp, -0.005_dp/))
     444         9254 :       CALL section_add_keyword(section, keyword)
     445         9254 :       CALL keyword_release(keyword)
     446              : 
     447              :       CALL keyword_create(keyword, __LOCATION__, name="EN_CONSTANTS", &
     448              :                           description="Scaling parameters for electronegativity correction term.", &
     449              :                           usage="EN_CONSTANTS -0.007 0.000 0.000", n_var=3, &
     450         9254 :                           default_r_vals=(/-0.007_dp, 0.000_dp, 0.000_dp/))
     451         9254 :       CALL section_add_keyword(section, keyword)
     452         9254 :       CALL keyword_release(keyword)
     453              : 
     454              :       CALL keyword_create(keyword, __LOCATION__, name="BEN_CONSTANT", &
     455              :                           description="Scaling parameter for electronegativity correction term.", &
     456              :                           usage="BEN_CONSTANT 4.0", n_var=1, &
     457         9254 :                           default_r_val=4.0_dp)
     458         9254 :       CALL section_add_keyword(section, keyword)
     459         9254 :       CALL keyword_release(keyword)
     460              : 
     461              :       CALL keyword_create(keyword, __LOCATION__, name="ENSCALE", &
     462              :                           description="Scaling parameter repulsive energy (dEN in exponential).", &
     463              :                           usage="ENSCALE 0.01", n_var=1, &
     464         9254 :                           default_r_val=0.0_dp)
     465         9254 :       CALL section_add_keyword(section, keyword)
     466         9254 :       CALL keyword_release(keyword)
     467              : 
     468              :       CALL keyword_create(keyword, __LOCATION__, name="HALOGEN_BINDING", &
     469              :                           description="Scaling parameters for electronegativity correction term.", &
     470         9254 :                           usage="HALOGEN_BINDING 1.30 0.44", n_var=2, default_r_vals=(/1.30_dp, 0.44_dp/))
     471         9254 :       CALL section_add_keyword(section, keyword)
     472         9254 :       CALL keyword_release(keyword)
     473              : 
     474              :       CALL keyword_create(keyword, __LOCATION__, name="KAB_PARAM", &
     475              :                           description="Specifies the specific Kab value for types A and B.", &
     476              :                           usage="KAB_PARAM kind1 kind2 value ", repeats=.TRUE., &
     477         9254 :                           n_var=-1, type_of_var=char_t)
     478         9254 :       CALL section_add_keyword(section, keyword)
     479         9254 :       CALL keyword_release(keyword)
     480              : 
     481              :       CALL keyword_create(keyword, __LOCATION__, name="XB_RADIUS", &
     482              :                           description="Specifies the radius [Bohr] of the XB pair interaction in xTB.", &
     483              :                           usage="XB_RADIUS 20.0 ", repeats=.FALSE., &
     484         9254 :                           n_var=1, default_r_val=20.0_dp)
     485         9254 :       CALL section_add_keyword(section, keyword)
     486         9254 :       CALL keyword_release(keyword)
     487              : 
     488              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_CUT", &
     489              :                           description="Maximum range of short range part of Coulomb interaction.", &
     490              :                           usage="COULOMB_SR_CUT 20.0 ", repeats=.FALSE., &
     491         9254 :                           n_var=1, default_r_val=20.0_dp)
     492         9254 :       CALL section_add_keyword(section, keyword)
     493         9254 :       CALL keyword_release(keyword)
     494              : 
     495              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_EPS", &
     496              :                           description="Cutoff for short range part of Coulomb interaction.", &
     497              :                           usage="COULOMB_SR_EPS 1.E-3 ", repeats=.FALSE., &
     498         9254 :                           n_var=1, default_r_val=1.0E-03_dp)
     499         9254 :       CALL section_add_keyword(section, keyword)
     500         9254 :       CALL keyword_release(keyword)
     501              : 
     502              :       CALL keyword_create(keyword, __LOCATION__, name="SRB_PARAMETER", &
     503              :                           description="SRB parameters (ksrb, esrb, gscal, c1, c2, shift).", &
     504              :                           usage="SRB_PARAMETER -0.0129 3.48 0.51 -1.71 2.11 0.0537", n_var=6, &
     505              :                           default_r_vals=(/-0.0129_dp, 3.4847_dp, 0.5097_dp, &
     506         9254 :                                            -1.70549806_dp, 2.10878369_dp, 0.0537_dp/))
     507         9254 :       CALL section_add_keyword(section, keyword)
     508         9254 :       CALL keyword_release(keyword)
     509              : 
     510         9254 :    END SUBROUTINE create_xtb_parameter_section
     511              : ! **************************************************************************************************
     512              : !> \brief ...
     513              : !> \param section ...
     514              : ! **************************************************************************************************
     515         9254 :    SUBROUTINE create_xtb_nonbonded_section(section)
     516              :       TYPE(section_type), POINTER                        :: section
     517              : 
     518              :       TYPE(keyword_type), POINTER                        :: keyword
     519              :       TYPE(section_type), POINTER                        :: subsection
     520              : 
     521         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     522              :       CALL section_create(section, __LOCATION__, name="NONBONDED", &
     523              :                           description="This section specifies the input parameters for NON-BONDED interactions.", &
     524         9254 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     525         9254 :       NULLIFY (subsection)
     526              : 
     527         9254 :       CALL create_GENPOT_section(subsection)
     528         9254 :       CALL section_add_subsection(section, subsection)
     529         9254 :       CALL section_release(subsection)
     530              : 
     531         9254 :       NULLIFY (keyword)
     532              :       CALL keyword_create(keyword, __LOCATION__, name="DX", &
     533              :                           description="Parameter used for computing the derivative with the Ridders' method.", &
     534         9254 :                           usage="DX <REAL>", default_r_val=0.1_dp, unit_str="bohr")
     535         9254 :       CALL section_add_keyword(section, keyword)
     536         9254 :       CALL keyword_release(keyword)
     537              : 
     538              :       CALL keyword_create(keyword, __LOCATION__, name="ERROR_LIMIT", &
     539              :                           description="Checks that the error in computing the derivative is not larger than "// &
     540              :                           "the value set; in case error is larger a warning message is printed.", &
     541         9254 :                           usage="ERROR_LIMIT <REAL>", default_r_val=1.0E-12_dp)
     542         9254 :       CALL section_add_keyword(section, keyword)
     543         9254 :       CALL keyword_release(keyword)
     544              : 
     545         9254 :    END SUBROUTINE create_xtb_nonbonded_section
     546              : ! **************************************************************************************************
     547              : !> \brief Creates the &TBLITE section
     548              : !> \param section the section to create
     549              : !> \author JVP
     550              : ! **************************************************************************************************
     551         9254 :    SUBROUTINE create_xtb_tblite_section(section)
     552              :       TYPE(section_type), POINTER                        :: section
     553              : 
     554              :       TYPE(keyword_type), POINTER                        :: keyword
     555              : 
     556         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     557              :       CALL section_create(section, __LOCATION__, name="TBLITE", &
     558              :                           description="Section used to specify options for an xTB computation using tblite.", &
     559              :                           n_keywords=1, n_subsections=0, repeats=.FALSE., citations=(/Caldeweyher2017, Caldeweyher2020, &
     560        55524 :                                                                                       Asgeirsson2017, Grimme2017, Bannwarth2019/))
     561              : 
     562         9254 :       NULLIFY (keyword)
     563              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     564              :                           description="activates the execution via tblite", &
     565         9254 :                           lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     566         9254 :       CALL section_add_keyword(section, keyword)
     567         9254 :       CALL keyword_release(keyword)
     568              : 
     569         9254 :       NULLIFY (keyword)
     570              :       CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
     571              :                           description="Selection of the method used in tblite.", &
     572              :                           usage="METHOD (GFN1|GFN2|IPEA1)", &
     573              :                           enum_c_vals=s2a("GFN1", "GFN2", "IPEA1"), &
     574              :                           enum_i_vals=(/gfn1xtb, gfn2xtb, ipea1xtb/), &
     575              :                           enum_desc=s2a("Uses the GFN1-XTB method by Grimme.", &
     576              :                                         "Uses the GFN2-XTB method by Grimme.", &
     577              :                                         "Uses the IEPEA1 method by Grimme."), &
     578         9254 :                           default_i_val=gfn2xtb)
     579         9254 :       CALL section_add_keyword(section, keyword)
     580         9254 :       CALL keyword_release(keyword)
     581              : 
     582         9254 :    END SUBROUTINE create_xtb_tblite_section
     583              : 
     584              : END MODULE input_cp2k_tb
        

Generated by: LCOV version 2.0-1