LCOV - code coverage report
Current view: top level - src - input_cp2k_negf.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:123285f) Lines: 99.5 % 196 195
Test Date: 2026-11-04 00:58:17 Functions: 100.0 % 6 6

            Line data    Source code
       1              : !--------------------------------------------------------------------------------------------------!
       2              : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3              : !   Copyright 2000-2026 CP2K developers group <https://cp2k.org>                                   !
       4              : !                                                                                                  !
       5              : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6              : !--------------------------------------------------------------------------------------------------!
       7              : 
       8              : ! **************************************************************************************************
       9              : !> \brief Input section for NEGF based quantum transport calculations.
      10              : ! **************************************************************************************************
      11              : 
      12              : MODULE input_cp2k_negf
      13              :    USE bibliography,                    ONLY: Bailey2006,&
      14              :                                               Papior2017
      15              :    USE cp_output_handling,              ONLY: add_last_numeric,&
      16              :                                               cp_print_key_section_create,&
      17              :                                               debug_print_level,&
      18              :                                               high_print_level,&
      19              :                                               low_print_level,&
      20              :                                               medium_print_level,&
      21              :                                               silent_print_level
      22              :    USE input_constants,                 ONLY: negfint_method_cc,&
      23              :                                               negfint_method_simpson
      24              :    USE input_keyword_types,             ONLY: keyword_create,&
      25              :                                               keyword_release,&
      26              :                                               keyword_type
      27              :    USE input_section_types,             ONLY: section_add_keyword,&
      28              :                                               section_add_subsection,&
      29              :                                               section_create,&
      30              :                                               section_release,&
      31              :                                               section_type
      32              :    USE input_val_types,                 ONLY: char_t,&
      33              :                                               enum_t,&
      34              :                                               integer_t,&
      35              :                                               real_t
      36              :    USE kinds,                           ONLY: dp
      37              :    USE physcon,                         ONLY: kelvin
      38              :    USE qs_density_mixing_types,         ONLY: create_mixing_section
      39              :    USE string_utilities,                ONLY: s2a
      40              : #include "./base/base_uses.f90"
      41              : 
      42              :    IMPLICIT NONE
      43              :    PRIVATE
      44              : 
      45              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_negf'
      46              : 
      47              :    PUBLIC :: create_negf_section
      48              : 
      49              : CONTAINS
      50              : 
      51              : ! **************************************************************************************************
      52              : !> \brief Create NEGF input section.
      53              : !> \param section input section
      54              : !> \par History
      55              : !>    * 02.2017 created [Sergey Chulkov]
      56              : ! **************************************************************************************************
      57         1462 :    SUBROUTINE create_negf_section(section)
      58              :       TYPE(section_type), POINTER                        :: section
      59              : 
      60              :       TYPE(keyword_type), POINTER                        :: keyword
      61              :       TYPE(section_type), POINTER                        :: print_key, subsection
      62              : 
      63         1462 :       CPASSERT(.NOT. ASSOCIATED(section))
      64              :       CALL section_create(section, __LOCATION__, name="NEGF", &
      65              :                           description="Parameters which control quantum transport calculation"// &
      66              :                           " based on Non-Equilibrium Green Function method.", &
      67              :                           citations=[Bailey2006, Papior2017], &
      68         4386 :                           n_keywords=18, n_subsections=6, repeats=.FALSE.)
      69              : 
      70         1462 :       NULLIFY (keyword, print_key, subsection)
      71              : 
      72         1462 :       CALL create_contact_section(subsection)
      73         1462 :       CALL section_add_subsection(section, subsection)
      74         1462 :       CALL section_release(subsection)
      75              : 
      76         1462 :       CALL create_scattering_region_section(subsection)
      77         1462 :       CALL section_add_subsection(section, subsection)
      78         1462 :       CALL section_release(subsection)
      79              : 
      80              :       ! mixing section
      81         1462 :       CALL create_mixing_section(subsection, ls_scf=.FALSE.)
      82         1462 :       CALL section_add_subsection(section, subsection)
      83         1462 :       CALL section_release(subsection)
      84              : 
      85              :       CALL keyword_create(keyword, __LOCATION__, name="DISABLE_CACHE", &
      86              :                           description="Do not keep contact self-energy matrices for future reuse", &
      87         1462 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
      88         1462 :       CALL section_add_keyword(section, keyword)
      89         1462 :       CALL keyword_release(keyword)
      90              : 
      91              :       ! convergence thresholds
      92              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_DENSITY", &
      93              :                           description="Target accuracy for electronic density.", &
      94         1462 :                           n_var=1, type_of_var=real_t, default_r_val=1.0e-5_dp)
      95         1462 :       CALL section_add_keyword(section, keyword)
      96         1462 :       CALL keyword_release(keyword)
      97              : 
      98              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_GREEN", &
      99              :                           description="Target accuracy for surface Green's functions.", &
     100         1462 :                           n_var=1, type_of_var=real_t, default_r_val=1.0e-5_dp)
     101         1462 :       CALL section_add_keyword(section, keyword)
     102         1462 :       CALL keyword_release(keyword)
     103              : 
     104              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_SCF", &
     105              :                           description="Target accuracy for SCF convergence.", &
     106         1462 :                           n_var=1, type_of_var=real_t, default_r_val=1.0e-5_dp)
     107         1462 :       CALL section_add_keyword(section, keyword)
     108         1462 :       CALL keyword_release(keyword)
     109              : 
     110              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_GEO", &
     111              :                           description="Accuracy in mapping atoms between different force environments.", &
     112              :                           n_var=1, type_of_var=real_t, unit_str="angstrom", &
     113         1462 :                           default_r_val=1.0e-6_dp)
     114         1462 :       CALL section_add_keyword(section, keyword)
     115         1462 :       CALL keyword_release(keyword)
     116              : 
     117              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_LBOUND", &
     118              :                           description="Lower bound energy of the conductance band.", &
     119              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     120         1462 :                           default_r_val=-5.0_dp)
     121         1462 :       CALL section_add_keyword(section, keyword)
     122         1462 :       CALL keyword_release(keyword)
     123              : 
     124              :       CALL keyword_create(keyword, __LOCATION__, name="ETA", &
     125              :                           description="Infinitesimal offset from the real axis.", &
     126              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     127         1462 :                           default_r_val=1.0e-5_dp)
     128         1462 :       CALL section_add_keyword(section, keyword)
     129         1462 :       CALL keyword_release(keyword)
     130              : 
     131              :       CALL keyword_create(keyword, __LOCATION__, name="HOMO_LUMO_GAP", &
     132              :                           description="The gap between the HOMO and some fictitious LUMO. This option is used as"// &
     133              :                           " an initial offset to determine the actual Fermi level of bulk contacts."// &
     134              :                           " It does not need to be exact HOMO-LUMO gap, just some value to start with.", &
     135              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     136         1462 :                           default_r_val=0.2_dp)
     137         1462 :       CALL section_add_keyword(section, keyword)
     138         1462 :       CALL keyword_release(keyword)
     139              : 
     140              :       CALL keyword_create(keyword, __LOCATION__, name="DELTA_NPOLES", &
     141              :                           description="Number of poles of Fermi function to consider.", &
     142              :                           n_var=1, type_of_var=integer_t, &
     143         1462 :                           default_i_val=4)
     144         1462 :       CALL section_add_keyword(section, keyword)
     145         1462 :       CALL keyword_release(keyword)
     146              : 
     147              :       CALL keyword_create(keyword, __LOCATION__, name="GAMMA_KT", &
     148              :                           description="Offset from the axis (in terms of k*T)"// &
     149              :                           " where poles of the Fermi function reside.", &
     150              :                           n_var=1, type_of_var=integer_t, &
     151         1462 :                           default_i_val=20)
     152         1462 :       CALL section_add_keyword(section, keyword)
     153         1462 :       CALL keyword_release(keyword)
     154              : 
     155              :       CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_METHOD", &
     156              :                           description="Method to integrate Green's functions along a closed-circuit contour.", &
     157              :                           default_i_val=negfint_method_cc, &
     158              :                           enum_c_vals=s2a("CLENSHAW-CURTIS", "SIMPSON"), &
     159              :                           enum_desc=s2a( &
     160              :                           "Adaptive Clenshaw-Curtis quadrature method. Requires FFTW3 library.", &
     161              :                           "Adaptive Simpson method. Works without FFTW3."), &
     162         1462 :                           enum_i_vals=[negfint_method_cc, negfint_method_simpson])
     163         1462 :       CALL section_add_keyword(section, keyword)
     164         1462 :       CALL keyword_release(keyword)
     165              : 
     166              :       CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_MIN_POINTS", &
     167              :                           description="Initial (minimal) number of grid point for adaptive numerical integration.", &
     168              :                           n_var=1, type_of_var=integer_t, &
     169         1462 :                           default_i_val=16)
     170         1462 :       CALL section_add_keyword(section, keyword)
     171         1462 :       CALL keyword_release(keyword)
     172              : 
     173              :       CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_MAX_POINTS", &
     174              :                           description="Maximal number of grid point for adaptive numerical integration.", &
     175              :                           n_var=1, type_of_var=integer_t, &
     176         1462 :                           default_i_val=512)
     177         1462 :       CALL section_add_keyword(section, keyword)
     178         1462 :       CALL keyword_release(keyword)
     179              : 
     180              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_SCF", &
     181              :                           description="Maximum number of SCF iterations to be performed.", &
     182              :                           n_var=1, type_of_var=integer_t, &
     183         1462 :                           default_i_val=30)
     184         1462 :       CALL section_add_keyword(section, keyword)
     185         1462 :       CALL keyword_release(keyword)
     186              : 
     187              :       CALL keyword_create(keyword, __LOCATION__, name="NPROC_POINT", &
     188              :                           description="Number of MPI processes to be used per energy point."// &
     189              :                           " Default is to use all processors (0).", &
     190              :                           n_var=1, type_of_var=integer_t, &
     191         1462 :                           default_i_val=0)
     192         1462 :       CALL section_add_keyword(section, keyword)
     193         1462 :       CALL keyword_release(keyword)
     194              : 
     195              :       CALL keyword_create(keyword, __LOCATION__, name="V_SHIFT", &
     196              :                           description="Initial value of the Hartree potential shift", &
     197              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     198         1462 :                           default_r_val=0.0_dp)
     199         1462 :       CALL section_add_keyword(section, keyword)
     200         1462 :       CALL keyword_release(keyword)
     201              : 
     202              :       CALL keyword_create(keyword, __LOCATION__, name="V_SHIFT_OFFSET", &
     203              :                           description="Initial offset to determine the optimal shift in Hartree potential.", &
     204         1462 :                           n_var=1, type_of_var=real_t, default_r_val=0.10_dp)
     205         1462 :       CALL section_add_keyword(section, keyword)
     206         1462 :       CALL keyword_release(keyword)
     207              : 
     208              :       CALL keyword_create(keyword, __LOCATION__, name="V_SHIFT_MAX_ITERS", &
     209              :                           description="Maximal number of iteration to determine the optimal shift in Hartree potential.", &
     210         1462 :                           n_var=1, type_of_var=integer_t, default_i_val=30)
     211         1462 :       CALL section_add_keyword(section, keyword)
     212         1462 :       CALL keyword_release(keyword)
     213              : 
     214              :       ! PRINT subsection
     215              :       CALL section_create(subsection, __LOCATION__, "PRINT", "Printing of information during the NEGF.", &
     216         1462 :                           repeats=.FALSE.)
     217              : 
     218         1462 :       CALL create_print_program_run_info_section(print_key)
     219         1462 :       CALL section_add_subsection(subsection, print_key)
     220         1462 :       CALL section_release(print_key)
     221              : 
     222         1462 :       CALL create_print_dos_section(print_key, "DOS", "the Density of States (DOS) in the scattering region")
     223         1462 :       CALL section_add_subsection(subsection, print_key)
     224         1462 :       CALL section_release(print_key)
     225              : 
     226         1462 :       CALL create_print_dos_section(print_key, "TRANSMISSION", "the transmission function")
     227         1462 :       CALL section_add_subsection(subsection, print_key)
     228         1462 :       CALL section_release(print_key)
     229              : 
     230              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_UNIT", &
     231              :                           description="Energy unit used for the printed Transmission/DOS energy axis. "// &
     232              :                           "Density of states (DOS) values are converted consistently to the selected energy unit.", &
     233              :                           usage="ENERGY_UNIT HARTREE", type_of_var=enum_t, &
     234              :                           enum_c_vals=s2a("HARTREE", "EV"), &
     235              :                           enum_i_vals=[1, 2], &
     236              :                           enum_desc=s2a("Print energies in Hartree (a.u.).", &
     237              :                                         "Print energies in electronvolt (eV)."), &
     238         1462 :                           default_i_val=2)
     239         1462 :       CALL section_add_keyword(subsection, keyword)
     240         1462 :       CALL keyword_release(keyword)
     241              : 
     242              :       ! RESTART subsection
     243              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
     244              :                                        description="Controls the dumping of the restart files during NEGF SCF.", &
     245              :                                        print_level=low_print_level, common_iter_levels=3, &
     246              :                                        each_iter_names=s2a("NEGF_SCF"), each_iter_values=[1], &
     247         1462 :                                        add_last=add_last_numeric, filename="RESTART", do_backup=.TRUE.)
     248         1462 :       CALL section_add_subsection(subsection, print_key)
     249         1462 :       CALL section_release(print_key)
     250              : 
     251         1462 :       CALL section_add_subsection(section, subsection)
     252         1462 :       CALL section_release(subsection)
     253              : 
     254              :       ! SCF subsection
     255              :       CALL section_create(subsection, __LOCATION__, "SCF", "Additional parameters for an NEGF SCF run.", &
     256         1462 :                           repeats=.FALSE.)
     257              : 
     258              :       CALL keyword_create(keyword, __LOCATION__, name="UPDATE_HS", &
     259              :                           description="Change the atomic Hamiltonian during NEGF self-consistent cycle."// &
     260              :                           " If .FALSE., only the density matrix is updated.", &
     261         1462 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     262         1462 :       CALL section_add_keyword(subsection, keyword)
     263         1462 :       CALL keyword_release(keyword)
     264              : 
     265              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_SCF", &
     266              :                           description="Restart SCF from files saved as defined in NEGF%PRINT%RESTART", &
     267         1462 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     268         1462 :       CALL section_add_keyword(subsection, keyword)
     269         1462 :       CALL keyword_release(keyword)
     270              : 
     271         1462 :       CALL section_add_subsection(section, subsection)
     272         1462 :       CALL section_release(subsection)
     273              : 
     274         1462 :    END SUBROUTINE create_negf_section
     275              : 
     276              : ! **************************************************************************************************
     277              : !> \brief Create NEGF%CONTACT input section.
     278              : !> \param section input section
     279              : !> \par History
     280              : !>    * 09.2017 split from create_negf_section() [Sergey Chulkov]
     281              : ! **************************************************************************************************
     282         1462 :    SUBROUTINE create_contact_section(section)
     283              :       TYPE(section_type), POINTER                        :: section
     284              : 
     285              :       TYPE(keyword_type), POINTER                        :: keyword
     286              :       TYPE(section_type), POINTER                        :: print_key, subsection, subsection2
     287              : 
     288         1462 :       CPASSERT(.NOT. ASSOCIATED(section))
     289              : 
     290              :       CALL section_create(section, __LOCATION__, name="CONTACT", &
     291              :                           description="Section defining the contact region of NEGF setup.", &
     292         1462 :                           n_keywords=5, n_subsections=3, repeats=.TRUE.)
     293              : 
     294         1462 :       NULLIFY (keyword, print_key, subsection, subsection2)
     295              : 
     296              :       CALL create_atomlist_section(subsection, "BULK_REGION", &
     297         1462 :                                    "the bulk contact adjacent to the screening region.", .FALSE.)
     298         1462 :       CALL section_add_subsection(section, subsection)
     299              :       CALL create_atomlist_section(subsection2, "CELL", &
     300              :                                    "a single bulk contact unit cell. Bulk Hamiltonian will be contstructed "// &
     301              :                                    "using two such unit cells instead of performing k-point bulk calculation. "// &
     302         1462 :                                    "FORCE_EVAL_SECTION must be 0.", .TRUE.)
     303         1462 :       CALL section_add_subsection(subsection, subsection2)
     304         1462 :       CALL section_release(subsection2)
     305         1462 :       CALL section_release(subsection)
     306              : 
     307              :       CALL create_atomlist_section(subsection, "SCREENING_REGION", &
     308         1462 :                                    "the given contact adjacent to the scattering region.", .FALSE.)
     309         1462 :       CALL section_add_subsection(section, subsection)
     310         1462 :       CALL section_release(subsection)
     311              : 
     312              :       CALL keyword_create(keyword, __LOCATION__, name="FORCE_EVAL_SECTION", &
     313              :                           description=" Index of the FORCE_EVAL section which will be used for bulk calculation.", &
     314         1462 :                           n_var=1, type_of_var=integer_t, default_i_val=0)
     315         1462 :       CALL section_add_keyword(section, keyword)
     316         1462 :       CALL keyword_release(keyword)
     317              : 
     318              :       CALL keyword_create(keyword, __LOCATION__, name="ELECTRIC_POTENTIAL", &
     319              :                           description="External electrostatic potential applied to the given contact.", &
     320              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     321         1462 :                           default_r_val=0.0_dp)
     322         1462 :       CALL section_add_keyword(section, keyword)
     323         1462 :       CALL keyword_release(keyword)
     324              : 
     325              :       CALL keyword_create(keyword, __LOCATION__, name="FERMI_LEVEL", &
     326              :                           description="Contact Fermi level at the given temperature."// &
     327              :                           " If this keyword is not given explicitly, the Fermi level"// &
     328              :                           " will be automatically computed prior the actual NEGF calculation.", &
     329              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     330         1462 :                           default_r_val=0.0_dp)
     331         1462 :       CALL section_add_keyword(section, keyword)
     332         1462 :       CALL keyword_release(keyword)
     333              : 
     334              :       CALL keyword_create(keyword, __LOCATION__, name="REFINE_FERMI_LEVEL", &
     335              :                           description="Compute the Fermi level using the value from the FERMI_LEVEL keyword"// &
     336              :                           " as a starting point. By default the Fermi level is computed only"// &
     337              :                           " when the keyword FERMI_LEVEL is not given explicitly.", &
     338         1462 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     339         1462 :       CALL section_add_keyword(section, keyword)
     340         1462 :       CALL keyword_release(keyword)
     341              : 
     342              :       CALL keyword_create(keyword, __LOCATION__, name="FERMI_LEVEL_SHIFTED", &
     343              :                           description="Used to shift the zero-energy level of an electrode to the common zero-energy level."// &
     344              :                           " If this keyword is specified, the Fermi level,"// &
     345              :                           " calculated by standard DFT or NEGF (using the REFINE_FERMI_LEVEL keyword),"// &
     346              :                           " or previously specified using the FERMI_LEVEL keyword,"// &
     347              :                           " is changed to this value. All diagonal elements of the Hamiltonian are shifted accordingly.", &
     348              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     349         1462 :                           default_r_val=0.0_dp)
     350         1462 :       CALL section_add_keyword(section, keyword)
     351         1462 :       CALL keyword_release(keyword)
     352              : 
     353              :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
     354              :                           description="Electronic temperature.", &
     355              :                           n_var=1, type_of_var=real_t, unit_str="K", &
     356         1462 :                           default_r_val=300.0_dp/kelvin)
     357         1462 :       CALL section_add_keyword(section, keyword)
     358         1462 :       CALL keyword_release(keyword)
     359              : 
     360              :       ! PRINT subsection
     361              :       CALL section_create(subsection, __LOCATION__, "PRINT", "Print properties for the given contact.", &
     362         1462 :                           repeats=.FALSE.)
     363              : 
     364         1462 :       CALL create_print_dos_section(print_key, "DOS", "the Density of States (DOS)")
     365         1462 :       CALL section_add_subsection(subsection, print_key)
     366         1462 :       CALL section_release(print_key)
     367              : 
     368         1462 :       CALL section_add_subsection(section, subsection)
     369         1462 :       CALL section_release(subsection)
     370              : 
     371              :       ! RESTART subsection
     372              :       CALL section_create(subsection, __LOCATION__, "RESTART", &
     373         1462 :                           "Controls reading and writing of the restart files for the specified contact.", repeats=.FALSE.)
     374              : 
     375              :       CALL keyword_create(keyword, __LOCATION__, name="FILENAME", &
     376              :                           description=' Controls part of the filename for output. '// &
     377              :                           ' Use filename to obtain projectname-filename. '// &
     378              :                           ' Use ./filename to get filename.'// &
     379              :                           ' A middle name (contact number, type of matrix, spin if 2 spins) and extension '// &
     380              :                           ' are always added to the filename.', &
     381              :                           usage="FILENAME ./filename ", &
     382         1462 :                           default_lc_val="")
     383         1462 :       CALL section_add_keyword(subsection, keyword)
     384         1462 :       CALL keyword_release(keyword)
     385              : 
     386              :       CALL keyword_create(keyword, __LOCATION__, name="READ_WRITE_HS", &
     387              :                           description="Requests reading of the electrode Hamiltonian and overlap matrices from a file."// &
     388              :                           " If at least one of these files doesn't exist, all Hamiltonian and overlap matrices"// &
     389              :                           " are calculated and saved. If no name is specified by FILENAME, the default file names are"// &
     390              :                           " projectname-Nn-H00, projectname-Nn-H01, projectname-Nn-S00, projectname-Nn-S01"// &
     391              :                           " for restricted calculations with identical spin population, or"// &
     392              :                           " projectname-Nn-H00-Ss, projectname-Nn-H01-Ss, projectname-Nn-S00-Ss, projectname-Nn-S01-Ss"// &
     393              :                           " for unrestricted calculations with two spin components,"// &
     394              :                           " where n is the number of the contact and s is the spin index."// &
     395              :                           " Otherwise, projectname is modified. Note that the code does not distinguish"// &
     396              :                           " between the files created by a separate electrode or the entire system.", &
     397         1462 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     398         1462 :       CALL section_add_keyword(subsection, keyword)
     399         1462 :       CALL keyword_release(keyword)
     400              : 
     401         1462 :       CALL section_add_subsection(section, subsection)
     402         1462 :       CALL section_release(subsection)
     403              : 
     404         1462 :    END SUBROUTINE create_contact_section
     405              : 
     406              : ! **************************************************************************************************
     407              : !> \brief Create a scattering region section.
     408              : !> \param section              NEGF section
     409              : !> \par History
     410              : !>    * 02.2026 created [Dmitry Ryndyk]
     411              : ! **************************************************************************************************
     412         1462 :    SUBROUTINE create_scattering_region_section(section)
     413              :       TYPE(section_type), POINTER                        :: section
     414              : 
     415              :       TYPE(keyword_type), POINTER                        :: keyword
     416              :       TYPE(section_type), POINTER                        :: subsection
     417              : 
     418         1462 :       CPASSERT(.NOT. ASSOCIATED(section))
     419              : 
     420              :       CALL section_create(section, __LOCATION__, name="SCATTERING_REGION", &
     421              :                           description="Section defining the scattering region of NEGF setup.", &
     422         1462 :                           n_keywords=2, n_subsections=1, repeats=.FALSE.)
     423              : 
     424         1462 :       NULLIFY (keyword, subsection)
     425              : 
     426              :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
     427              :                           description="Specifies a list of atoms.", &
     428              :                           usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
     429         1462 :                           n_var=-1, type_of_var=integer_t)
     430         1462 :       CALL section_add_keyword(section, keyword)
     431         1462 :       CALL keyword_release(keyword)
     432              : 
     433              :       CALL keyword_create(keyword, __LOCATION__, name="MOLNAME", &
     434              :                           description="Specifies a list of named molecular fragments.", &
     435              :                           usage="MOLNAME WAT MEOH", repeats=.TRUE., &
     436         1462 :                           n_var=-1, type_of_var=char_t)
     437         1462 :       CALL section_add_keyword(section, keyword)
     438         1462 :       CALL keyword_release(keyword)
     439              : 
     440              :       ! RESTART subsection
     441              :       CALL section_create(subsection, __LOCATION__, "RESTART", &
     442              :                           "Controls reading and writing of the initial restart files for the scattering region,"// &
     443         1462 :                           " including the coupling to the electrodes.", repeats=.FALSE.)
     444              :       CALL keyword_create(keyword, __LOCATION__, name="FILENAME", &
     445              :                           description=' Controls part of the filename. '// &
     446              :                           ' Use filename to obtain projectname-filename. '// &
     447              :                           ' Use ./filename to get filename.'// &
     448              :                           ' A middle name (type of matrix, contact number for coupling matrices, spin if 2 spins)'// &
     449              :                           ' and extension are always added to the filename.', &
     450              :                           usage="FILENAME ./filename ", &
     451         1462 :                           default_lc_val="")
     452         1462 :       CALL section_add_keyword(subsection, keyword)
     453         1462 :       CALL keyword_release(keyword)
     454              :       CALL keyword_create(keyword, __LOCATION__, name="READ_WRITE_HS", &
     455              :                           description="Requests reading of the Hamiltonian and overlap matrices from a file."// &
     456              :                           " For the scattering region, including the coupling to the electrodes."// &
     457              :                           " If at least one of these files doesn't exist, all Hamiltonian and overlap matrices"// &
     458              :                           " are calculated and saved. If no name is specified by FILENAME, the default file names are"// &
     459              :                           " projectname-H, projectname-H-Nn, projectname-S, projectname-S-Nn"// &
     460              :                           " for restricted calculations with identical spin population, or"// &
     461              :                           " projectname-H-Ss, projectname-H-Nn-Ss, projectname-S-Ss, projectname-S-Nn-Ss"// &
     462              :                           " for unrestricted calculations with two spin components,"// &
     463              :                           " where n is the number of the contact and s is the spin index."// &
     464              :                           " Otherwise, projectname is modified.", &
     465         1462 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     466         1462 :       CALL section_add_keyword(subsection, keyword)
     467         1462 :       CALL keyword_release(keyword)
     468         1462 :       CALL section_add_subsection(section, subsection)
     469         1462 :       CALL section_release(subsection)
     470              : 
     471         1462 :    END SUBROUTINE create_scattering_region_section
     472              : 
     473              : ! **************************************************************************************************
     474              : !> \brief Create an atomic list section.
     475              : !> \param section              NEGF section
     476              : !> \param name                 name of the new section
     477              : !> \param description          section description
     478              : !> \param repeats              whether the section can be repeated
     479              : !> \par History
     480              : !>    * 02.2017 created [Sergey Chulkov]
     481              : ! **************************************************************************************************
     482         4386 :    SUBROUTINE create_atomlist_section(section, name, description, repeats)
     483              :       TYPE(section_type), POINTER                        :: section
     484              :       CHARACTER(len=*), INTENT(in)                       :: name, description
     485              :       LOGICAL, INTENT(in)                                :: repeats
     486              : 
     487              :       TYPE(keyword_type), POINTER                        :: keyword
     488              : 
     489            0 :       CPASSERT(.NOT. ASSOCIATED(section))
     490              : 
     491              :       CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(name)), &
     492              :                           description="Atoms belonging to "//TRIM(ADJUSTL(description)), &
     493         4386 :                           n_keywords=2, n_subsections=0, repeats=repeats)
     494              : 
     495         4386 :       NULLIFY (keyword)
     496              : 
     497              :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
     498              :                           description="Specifies a list of atoms.", &
     499              :                           usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
     500         4386 :                           n_var=-1, type_of_var=integer_t)
     501         4386 :       CALL section_add_keyword(section, keyword)
     502         4386 :       CALL keyword_release(keyword)
     503              : 
     504              :       CALL keyword_create(keyword, __LOCATION__, name="MOLNAME", &
     505              :                           description="Specifies a list of named molecular fragments.", &
     506              :                           usage="MOLNAME WAT MEOH", repeats=.TRUE., &
     507         4386 :                           n_var=-1, type_of_var=char_t)
     508         4386 :       CALL section_add_keyword(section, keyword)
     509         4386 :       CALL keyword_release(keyword)
     510         4386 :    END SUBROUTINE create_atomlist_section
     511              : 
     512              : ! **************************************************************************************************
     513              : !> \brief Create the PROGRAM_RUN_INFO print section.
     514              : !> \param section              section to create
     515              : !> \par History
     516              : !>    * 11.2020 created [Dmitry Ryndyk]
     517              : ! **************************************************************************************************
     518         1462 :    SUBROUTINE create_print_program_run_info_section(section)
     519              : 
     520              :       TYPE(section_type), POINTER                        :: section
     521              : 
     522              :       TYPE(keyword_type), POINTER                        :: keyword
     523              : 
     524              :       CALL cp_print_key_section_create(section, __LOCATION__, "PROGRAM_RUN_INFO", &
     525              :                                        description="Controls the printing of basic information during the NEGF.", &
     526         1462 :                                        print_level=low_print_level, filename="__STD_OUT__")
     527         1462 :       NULLIFY (keyword)
     528              : 
     529              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     530              :                           description="Level starting at which this property is printed", &
     531              :                           usage="_SECTION_PARAMETERS_", &
     532              :                           default_i_val=low_print_level, lone_keyword_i_val=low_print_level, &
     533              :                           enum_c_vals=s2a("on", "off", "silent", "low", "medium", "high", "debug"), &
     534              :                           enum_i_vals=[silent_print_level - 1, debug_print_level + 1, &
     535              :                                        silent_print_level, low_print_level, &
     536         1462 :                                        medium_print_level, high_print_level, debug_print_level])
     537         1462 :       CALL section_add_keyword(section, keyword)
     538         1462 :       CALL keyword_release(keyword)
     539              : 
     540              :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_LEVEL", &
     541              :                           variants=["IOLEVEL"], &
     542              :                           description="Determines the verbose level for this section "// &
     543              :                           "additionally to GLOBAL%PRINT_LEVEL and SECTION_PARAMETERS, "// &
     544              :                           "which switch on printing.", &
     545              :                           usage="PRINT_LEVEL HIGH", &
     546              :                           default_i_val=low_print_level, enum_c_vals= &
     547              :                           s2a("SILENT", "LOW", "MEDIUM", "HIGH", "DEBUG"), &
     548              :                           enum_desc=s2a("No output", &
     549              :                                         "Little output", "Quite some output", "Lots of output", &
     550              :                                         "Everything is written out, useful for debugging purposes only"), &
     551              :                           enum_i_vals=[silent_print_level, low_print_level, medium_print_level, &
     552         2924 :                                        high_print_level, debug_print_level])
     553         1462 :       CALL section_add_keyword(section, keyword)
     554         1462 :       CALL keyword_release(keyword)
     555              : 
     556         1462 :    END SUBROUTINE create_print_program_run_info_section
     557              : 
     558              : ! **************************************************************************************************
     559              : !> \brief Create the DOS/TRANSMISSION print section.
     560              : !> \param section              section to create
     561              : !> \param name                 name of the new section
     562              : !> \param description          section description
     563              : !> \par History
     564              : !>    * 11.2017 created [Sergey Chulkov]
     565              : ! **************************************************************************************************
     566         4386 :    SUBROUTINE create_print_dos_section(section, name, description)
     567              :       TYPE(section_type), POINTER                        :: section
     568              :       CHARACTER(len=*), INTENT(in)                       :: name, description
     569              : 
     570              :       TYPE(keyword_type), POINTER                        :: keyword
     571              : 
     572              :       CALL cp_print_key_section_create(section, __LOCATION__, TRIM(ADJUSTL(name)), &
     573              :                                        description="Controls the printing of "//TRIM(ADJUSTL(description))//".", &
     574         4386 :                                        print_level=high_print_level, filename="__STD_OUT__")
     575         4386 :       NULLIFY (keyword)
     576              : 
     577              :       CALL keyword_create(keyword, __LOCATION__, name="FROM_ENERGY", &
     578              :                           description="Energy point to start with.", &
     579              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     580         4386 :                           default_r_val=-1.0_dp)
     581         4386 :       CALL section_add_keyword(section, keyword)
     582         4386 :       CALL keyword_release(keyword)
     583              : 
     584              :       CALL keyword_create(keyword, __LOCATION__, name="TILL_ENERGY", &
     585              :                           description="Energy point to end with.", &
     586              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
     587         4386 :                           default_r_val=1.0_dp)
     588         4386 :       CALL section_add_keyword(section, keyword)
     589         4386 :       CALL keyword_release(keyword)
     590              : 
     591              :       CALL keyword_create(keyword, __LOCATION__, name="N_GRIDPOINTS", &
     592              :                           description="Number of points to compute.", &
     593         4386 :                           n_var=1, type_of_var=integer_t, default_i_val=201)
     594         4386 :       CALL section_add_keyword(section, keyword)
     595         4386 :       CALL keyword_release(keyword)
     596         4386 :    END SUBROUTINE create_print_dos_section
     597              : END MODULE input_cp2k_negf
        

Generated by: LCOV version 2.0-1