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

            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 input section for NEGF based quantum transport calculations
      10              : !>        (integration with the quantum transport code OMEN)
      11              : !>
      12              : !> \par History
      13              : !>       07.2013 created [Hossein Bani-Hashemian]
      14              : !> \author Hossein Bani-Hashemian
      15              : ! **************************************************************************************************
      16              : MODULE input_cp2k_transport
      17              :    USE bibliography,                    ONLY: Bruck2014
      18              :    USE cp_output_handling,              ONLY: cp_print_key_section_create,&
      19              :                                               high_print_level
      20              :    USE cp_units,                        ONLY: cp_unit_to_cp2k
      21              :    USE input_constants,                 ONLY: &
      22              :         injmethod_beyn, injmethod_evp, injsign_negative, injsign_positive, linsolver_banded, &
      23              :         linsolver_full, linsolver_mumps, linsolver_pardiso, linsolver_splitsolve, &
      24              :         linsolver_superlu, linsolver_umfpack, matrixinv_full, matrixinv_pardiso, matrixinv_pexsi, &
      25              :         matrixinv_rgf, neutlead_bs, neutlead_dos, rho_negf, rho_qtbm, rlaxisint_GaussChebyshev, &
      26              :         rlaxisint_readfromfile, rlaxisint_trapezoidal, transport_localscf, transport_negf, &
      27              :         transport_transmission
      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: integer_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_transport'
      45              : 
      46              :    PUBLIC :: create_transport_section
      47              : 
      48              : CONTAINS
      49              : 
      50              : ! **************************************************************************************************
      51              : !> \brief creates the TRANSPORT section
      52              : !> \param[inout] section the section to be created
      53              : ! **************************************************************************************************
      54         9254 :    SUBROUTINE create_transport_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="TRANSPORT", &
      62              :                           description="Specifies the parameters for transport, sets parameters for the OMEN code, "// &
      63              :                           "see also <https://nano-tcad.ee.ethz.ch>.", &
      64              :                           citations=(/Bruck2014/), &
      65        18508 :                           n_keywords=29, n_subsections=4, repeats=.FALSE.)
      66              : 
      67         9254 :       NULLIFY (keyword)
      68              : 
      69              :       CALL keyword_create( &
      70              :          keyword, __LOCATION__, name="TRANSPORT_METHOD", &
      71              :          description="Preferred method for transport calculations.", &
      72              :          usage="TRANSPORT_METHOD <method>", &
      73              :          default_i_val=transport_negf, &
      74              :          enum_c_vals=s2a("TRANSPORT", "LOCAL_SCF", "TRANSMISSION"), &
      75              :          enum_desc=s2a("self-consistent CP2K and OMEN transport calculations", &
      76              :                        "CP2K valence Hamiltonian + OMEN self-consistent calculations on conduction electrons", &
      77              :                        "self-consistent transmission calculations without applied bias voltage"), &
      78         9254 :          enum_i_vals=(/transport_negf, transport_localscf, transport_transmission/))
      79         9254 :       CALL section_add_keyword(section, keyword)
      80         9254 :       CALL keyword_release(keyword)
      81              : 
      82              :       CALL keyword_create( &
      83              :          keyword, __LOCATION__, name="QT_FORMALISM", &
      84              :          description="Preferred quantum transport formalism to compute the current and density.", &
      85              :          usage="QT_FORMALISM <method>", &
      86              :          default_i_val=rho_qtbm, &
      87              :          enum_c_vals=s2a("NEGF", "QTBM"), &
      88              :          enum_desc=s2a("The non-equilibrium Green's function formalism.", &
      89              :                        "The quantum transmitting boundary method / wave-function formalism."), &
      90         9254 :          enum_i_vals=(/rho_negf, rho_qtbm/))
      91         9254 :       CALL section_add_keyword(section, keyword)
      92         9254 :       CALL keyword_release(keyword)
      93              : 
      94              :       CALL keyword_create(keyword, __LOCATION__, name="NUM_POLE", &
      95              :                           description="The number of terms in the PEXSI's pole expansion method.", &
      96         9254 :                           usage="NUM_POLE <integer>", default_i_val=64)
      97         9254 :       CALL section_add_keyword(section, keyword)
      98         9254 :       CALL keyword_release(keyword)
      99              : 
     100              :       CALL keyword_create(keyword, __LOCATION__, name="N_KPOINTS", &
     101              :                           description="The number of k points for determination of the singularities.", &
     102         9254 :                           usage="N_KPOINTS <integer>", default_i_val=64)
     103         9254 :       CALL section_add_keyword(section, keyword)
     104         9254 :       CALL keyword_release(keyword)
     105              : 
     106              :       CALL keyword_create(keyword, __LOCATION__, name="NUM_INTERVAL", &
     107              :                           description="Max number of energy points per small interval.", &
     108         9254 :                           usage="NUM_INTERVAL <integer>", default_i_val=10)
     109         9254 :       CALL section_add_keyword(section, keyword)
     110         9254 :       CALL keyword_release(keyword)
     111              : 
     112              :       CALL keyword_create(keyword, __LOCATION__, name="TASKS_PER_ENERGY_POINT", &
     113              :                           description="Number of tasks per energy point. The value should be a divisor of the total "// &
     114              :                           "number of MPI ranks.", &
     115         9254 :                           usage="TASKS_PER_ENERGY_POINT <integer>", default_i_val=1)
     116         9254 :       CALL section_add_keyword(section, keyword)
     117         9254 :       CALL keyword_release(keyword)
     118              : 
     119              :       CALL keyword_create(keyword, __LOCATION__, name="TASKS_PER_POLE", &
     120              :                           description="Number of tasks per pole in the pole expansion method. The value should be a "// &
     121              :                           "divisor of the total number of MPI ranks.", &
     122         9254 :                           usage="TASKS_PER_POLE <integer>", default_i_val=1)
     123         9254 :       CALL section_add_keyword(section, keyword)
     124         9254 :       CALL keyword_release(keyword)
     125              : 
     126              :       CALL keyword_create(keyword, __LOCATION__, name="GPUS_PER_POINT", &
     127              :                           description="Number of GPUs per energy point for SplitSolve. Needs to be a power of two", &
     128         9254 :                           usage="GPUS_PER_POINT <integer>", default_i_val=2)
     129         9254 :       CALL section_add_keyword(section, keyword)
     130         9254 :       CALL keyword_release(keyword)
     131              : 
     132              :       CALL keyword_create(keyword, __LOCATION__, name="COLZERO_THRESHOLD", &
     133              :                           description="The smallest number that is not zero in the full diagonalization part.", &
     134         9254 :                           usage="COLZERO_THRESHOLD <real>", default_r_val=1.0E-12_dp)
     135         9254 :       CALL section_add_keyword(section, keyword)
     136         9254 :       CALL keyword_release(keyword)
     137              : 
     138              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_LIMIT", &
     139              :                           description="The smallest eigenvalue that is kept.", &
     140         9254 :                           usage="EPS_LIMIT <real>", default_r_val=1.0E-4_dp)
     141         9254 :       CALL section_add_keyword(section, keyword)
     142         9254 :       CALL keyword_release(keyword)
     143              : 
     144              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_LIMIT_CC", &
     145              :                           description="The smallest eigenvalue that is kept on the complex contour.", &
     146         9254 :                           usage="EPS_LIMIT_CC <real>", default_r_val=1.0E-6_dp)
     147         9254 :       CALL section_add_keyword(section, keyword)
     148         9254 :       CALL keyword_release(keyword)
     149              : 
     150              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_DECAY", &
     151              :                           description="The smallest imaginary part that a decaying eigenvalue may have not to be "// &
     152              :                           "considered as propagating.", &
     153         9254 :                           usage="EPS_DECAY <real>", default_r_val=1.0E-4_dp)
     154         9254 :       CALL section_add_keyword(section, keyword)
     155         9254 :       CALL keyword_release(keyword)
     156              : 
     157              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_SINGULARITY_CURVATURES", &
     158              :                           description="Filter for degenerate bands in the bandstructure.", &
     159         9254 :                           usage="EPS_SINGULARITY_CURVATURES <real>", default_r_val=1.0E-12_dp)
     160         9254 :       CALL section_add_keyword(section, keyword)
     161         9254 :       CALL keyword_release(keyword)
     162              : 
     163              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_MU", &
     164              :                           description="Accuracy to which the Fermi level should be determined.", &
     165         9254 :                           usage="EPS_MU <real>", default_r_val=1.0E-6_dp)
     166         9254 :       CALL section_add_keyword(section, keyword)
     167         9254 :       CALL keyword_release(keyword)
     168              : 
     169              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_EIGVAL_DEGEN", &
     170              :                           description="Filter for degenerate bands in the injection vector.", &
     171         9254 :                           usage="EPS_EIGVAL_DEGEN <real>", default_r_val=1.0E-6_dp)
     172         9254 :       CALL section_add_keyword(section, keyword)
     173         9254 :       CALL keyword_release(keyword)
     174              : 
     175              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FERMI", &
     176              :                           description="Cutoff for the tail of the Fermi function.", &
     177         9254 :                           usage="EPS_FERMI <real>", default_r_val=0.0_dp)
     178         9254 :       CALL section_add_keyword(section, keyword)
     179         9254 :       CALL keyword_release(keyword)
     180              : 
     181              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_INTERVAL", &
     182              :                           description="Distance between energy points in eV.", &
     183         9254 :                           usage="ENERGY_INTERVAL <real>", default_r_val=1.0E-3_dp)
     184         9254 :       CALL section_add_keyword(section, keyword)
     185         9254 :       CALL keyword_release(keyword)
     186              : 
     187              :       CALL keyword_create(keyword, __LOCATION__, name="MIN_INTERVAL", &
     188              :                           description="Smallest enery distance in energy vector.", &
     189         9254 :                           usage="MIN_INTERVAL <real>", default_r_val=1.0E-4_dp)
     190         9254 :       CALL section_add_keyword(section, keyword)
     191         9254 :       CALL keyword_release(keyword)
     192              : 
     193              :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
     194              :                           description="Temperature.", &
     195              :                           usage="TEMPERATURE [K] 300.0", &
     196              :                           default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
     197         9254 :                           unit_str="K")
     198         9254 :       CALL section_add_keyword(section, keyword)
     199         9254 :       CALL keyword_release(keyword)
     200              : 
     201              :       CALL keyword_create(keyword, __LOCATION__, name="CSR_SCREENING", &
     202              :                           description="Whether distance screening should be applied to improve sparsity of CSR matrices.", &
     203         9254 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     204         9254 :       CALL section_add_keyword(section, keyword)
     205         9254 :       CALL keyword_release(keyword)
     206              : 
     207              :       CALL keyword_create( &
     208              :          keyword, __LOCATION__, name="LINEAR_SOLVER", &
     209              :          description="Preferred solver for solving the linear system of equations.", &
     210              :          usage="LINEAR_SOLVER <solver>", &
     211              :          default_i_val=linsolver_full, &
     212              :          enum_c_vals=s2a("SplitSolve", "SuperLU", "MUMPS", "Full", "Banded", "PARDISO", "UMFPACK"), &
     213              :          enum_i_vals=(/linsolver_splitsolve, linsolver_superlu, linsolver_mumps, linsolver_full, linsolver_banded, &
     214         9254 :                        linsolver_pardiso, linsolver_umfpack/))
     215         9254 :       CALL section_add_keyword(section, keyword)
     216         9254 :       CALL keyword_release(keyword)
     217              : 
     218              :       CALL keyword_create( &
     219              :          keyword, __LOCATION__, name="MATRIX_INVERSION_METHOD", &
     220              :          description="Preferred matrix inversion method.", &
     221              :          usage="MATRIX_INVERSION_METHOD <solver>", &
     222              :          default_i_val=matrixinv_full, &
     223              :          enum_c_vals=s2a("Full", "PEXSI", "PARDISO", "RGF"), &
     224         9254 :          enum_i_vals=(/matrixinv_full, matrixinv_pexsi, matrixinv_pardiso, matrixinv_rgf/))
     225         9254 :       CALL section_add_keyword(section, keyword)
     226         9254 :       CALL keyword_release(keyword)
     227              : 
     228              :       CALL keyword_create(keyword, __LOCATION__, name="INJECTION_METHOD", &
     229              :                           description="Method to solve the eigenvalue problem for the open boundary conditions.", &
     230              :                           usage="INJECTION_METHOD <method>", &
     231              :                           default_i_val=injmethod_beyn, &
     232              :                           enum_c_vals=s2a("EVP", "BEYN"), &
     233              :                           enum_desc=s2a("Full eigenvalue solver.", &
     234              :                                         "Beyn eigenvalue solver."), &
     235         9254 :                           enum_i_vals=(/injmethod_evp, injmethod_beyn/))
     236         9254 :       CALL section_add_keyword(section, keyword)
     237         9254 :       CALL keyword_release(keyword)
     238              : 
     239              :       CALL keyword_create( &
     240              :          keyword, __LOCATION__, name="CUTOUT", &
     241              :          description="The number of atoms at the beginning and the end of the structure where the density should "// &
     242              :          "not be changed.", &
     243              :          usage="CUTOUT <integer> <integer>", &
     244         9254 :          n_var=2, default_i_vals=(/0, 0/))
     245         9254 :       CALL section_add_keyword(section, keyword)
     246         9254 :       CALL keyword_release(keyword)
     247              : 
     248              :       CALL keyword_create(keyword, __LOCATION__, name="REAL_AXIS_INTEGRATION_METHOD", &
     249              :                           description="Integration method for the real axis.", &
     250              :                           usage="REAL_AXIS_INTEGRATION_METHOD <method>", &
     251              :                           default_i_val=rlaxisint_GaussChebyshev, &
     252              :                           enum_c_vals=s2a("Gauss_Chebyshev", "Trapezoidal_rule", "Read"), &
     253              :                           enum_desc=s2a("Gauss-Chebyshev integration between singularity points.", &
     254              :                                         "Trapezoidal rule on the total range.", &
     255              :                                         "Read integration points from a file (named E.dat)."), &
     256         9254 :                           enum_i_vals=(/rlaxisint_GaussChebyshev, rlaxisint_trapezoidal, rlaxisint_readfromfile/))
     257         9254 :       CALL section_add_keyword(section, keyword)
     258         9254 :       CALL keyword_release(keyword)
     259              : 
     260              :       CALL keyword_create(keyword, __LOCATION__, name="N_POINTS_INV", &
     261              :                           description="Number of integration points for the sigma solver on the complex contour.", &
     262         9254 :                           usage="N_POINTS_INV <integer>", default_i_val=64)
     263         9254 :       CALL section_add_keyword(section, keyword)
     264         9254 :       CALL keyword_release(keyword)
     265              : 
     266              :       CALL keyword_create(keyword, __LOCATION__, name="OBC_EQUILIBRIUM", &
     267              :                           description="Compute the equilibrium density with open boundary conditions.", &
     268         9254 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     269         9254 :       CALL section_add_keyword(section, keyword)
     270         9254 :       CALL keyword_release(keyword)
     271              : 
     272              :       CALL keyword_create(keyword, __LOCATION__, name="CONTACT_FILLING", &
     273              :                           description="Determination of the contact Fermi levels. Note that this keyword "// &
     274              :                           "only works when the TRANSPORT_METHOD is specified as TRANSPORT.", &
     275              :                           default_i_val=neutlead_bs, &
     276              :                           enum_c_vals=s2a("BAND_STRUCTURE", "DOS"), &
     277              :                           enum_desc=s2a("Determine the Fermi levels from the band structure.", &
     278              :                                         "Determine the Fermi levels from the density of states."), &
     279         9254 :                           enum_i_vals=(/neutlead_bs, neutlead_dos/))
     280         9254 :       CALL section_add_keyword(section, keyword)
     281         9254 :       CALL keyword_release(keyword)
     282              : 
     283              :       CALL keyword_create(keyword, __LOCATION__, name="DENSITY_MIXING", &
     284              :                           description="Mixing parameter for a density mixing in OMEN.", &
     285         9254 :                           usage="DENSITY_MIXING <real>", default_r_val=1.0_dp)
     286         9254 :       CALL section_add_keyword(section, keyword)
     287         9254 :       CALL keyword_release(keyword)
     288              : 
     289         9254 :       NULLIFY (subsection)
     290              : 
     291         9254 :       CALL create_contact_section(subsection)
     292         9254 :       CALL section_add_subsection(section, subsection)
     293         9254 :       CALL section_release(subsection)
     294              : 
     295         9254 :       CALL create_beyn_section(subsection)
     296         9254 :       CALL section_add_subsection(section, subsection)
     297         9254 :       CALL section_release(subsection)
     298              : 
     299         9254 :       CALL create_pexsi_section(subsection)
     300         9254 :       CALL section_add_subsection(section, subsection)
     301         9254 :       CALL section_release(subsection)
     302              : 
     303         9254 :       CALL create_transport_print_section(subsection)
     304         9254 :       CALL section_add_subsection(section, subsection)
     305         9254 :       CALL section_release(subsection)
     306              : 
     307         9254 :    END SUBROUTINE create_transport_section
     308              : 
     309              : ! **************************************************************************************************
     310              : !> \brief Creates the section for creating contacts.
     311              : !> \param[inout] section the section to be created
     312              : ! **************************************************************************************************
     313         9254 :    SUBROUTINE create_contact_section(section)
     314              :       TYPE(section_type), POINTER                        :: section
     315              : 
     316              :       TYPE(keyword_type), POINTER                        :: keyword
     317              : 
     318         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     319              :       CALL section_create(section, __LOCATION__, name="CONTACT", &
     320              :                           description="Parameters for defining device contacts.", &
     321         9254 :                           n_keywords=5, n_subsections=0, repeats=.TRUE.)
     322              : 
     323         9254 :       NULLIFY (keyword)
     324              : 
     325              :       CALL keyword_create(keyword, __LOCATION__, name="BANDWIDTH", &
     326              :                           description="The number of neighboring unit cells that one unit cell interacts with.", &
     327         9254 :                           usage="BANDWIDTH <integer>", default_i_val=0)
     328         9254 :       CALL section_add_keyword(section, keyword)
     329         9254 :       CALL keyword_release(keyword)
     330              : 
     331              :       CALL keyword_create(keyword, __LOCATION__, name="START", &
     332              :                           description="Index of the first atom in the contact unit cell. Set to 0 to define the contact "// &
     333              :                           "unit cell as the first/last N_ATOMS of the structure (after cutout)", &
     334         9254 :                           usage="START <integer>", default_i_val=0)
     335         9254 :       CALL section_add_keyword(section, keyword)
     336         9254 :       CALL keyword_release(keyword)
     337              : 
     338              :       CALL keyword_create(keyword, __LOCATION__, name="N_ATOMS", &
     339              :                           description="Number of atoms in the contact unit cell.", &
     340         9254 :                           usage="N_ATOMS <integer>", default_i_val=0)
     341         9254 :       CALL section_add_keyword(section, keyword)
     342         9254 :       CALL keyword_release(keyword)
     343              : 
     344              :       CALL keyword_create(keyword, __LOCATION__, name="INJECTION_SIGN", &
     345              :                           description="Contact unit cell interacts with unit cells to the right (positive) or "// &
     346              :                           "to the left (negative).", &
     347              :                           usage="INJECTION_SIGN <integer>", &
     348              :                           default_i_val=injsign_positive, &
     349              :                           enum_c_vals=s2a("POSITIVE", "NEGATIVE"), &
     350              :                           enum_desc=s2a("When the contact unit cell is at the upper left corner of the Hamiltonian.", &
     351              :                                         "When the contact unit cell is at the lower right corner of the Hamiltonian."), &
     352         9254 :                           enum_i_vals=(/injsign_positive, injsign_negative/))
     353         9254 :       CALL section_add_keyword(section, keyword)
     354         9254 :       CALL keyword_release(keyword)
     355              : 
     356              :       CALL keyword_create(keyword, __LOCATION__, name="INJECTING_CONTACT", &
     357              :                           description="whether or not the contact can inject electrons.", &
     358         9254 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     359         9254 :       CALL section_add_keyword(section, keyword)
     360         9254 :       CALL keyword_release(keyword)
     361              : 
     362         9254 :    END SUBROUTINE create_contact_section
     363              : 
     364              : ! **************************************************************************************************
     365              : !> \brief Creates the section for the Beyn eigenvalue solver.
     366              : !> \param[inout] section the section to be created
     367              : ! **************************************************************************************************
     368         9254 :    SUBROUTINE create_beyn_section(section)
     369              :       TYPE(section_type), POINTER                        :: section
     370              : 
     371              :       TYPE(keyword_type), POINTER                        :: keyword
     372              : 
     373         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     374              :       CALL section_create(section, __LOCATION__, name="BEYN", &
     375              :                           description="Parameters for the Beyn eigenvalue solver.", &
     376         9254 :                           n_keywords=6, n_subsections=0, repeats=.FALSE.)
     377              : 
     378         9254 :       NULLIFY (keyword)
     379              : 
     380              :       CALL keyword_create(keyword, __LOCATION__, name="N_RAND", &
     381              :                           description="Number of random vectors as a fraction of the size of the unit cell.", &
     382         9254 :                           usage="N_RAND <real>", default_r_val=1.0_dp)
     383         9254 :       CALL section_add_keyword(section, keyword)
     384         9254 :       CALL keyword_release(keyword)
     385              : 
     386              :       CALL keyword_create(keyword, __LOCATION__, name="N_RAND_CC", &
     387              :                           description="Number of random vectors as a fraction of the size of the unit cell "// &
     388              :                           "for the complex contour.", &
     389         9254 :                           usage="N_RAND_CC <real>", default_r_val=1.0_dp)
     390         9254 :       CALL section_add_keyword(section, keyword)
     391         9254 :       CALL keyword_release(keyword)
     392              : 
     393              :       CALL keyword_create(keyword, __LOCATION__, name="SVD_CUTOFF", &
     394              :                           description="Cutoff for the singular values in the Beyn solver.", &
     395         9254 :                           usage="SVD_CUTOFF <real>", default_r_val=1.0_dp)
     396         9254 :       CALL section_add_keyword(section, keyword)
     397         9254 :       CALL keyword_release(keyword)
     398              : 
     399              :       CALL keyword_create(keyword, __LOCATION__, name="N_POINTS_BEYN", &
     400              :                           description="Number of integration points per circle in the Beyn solver.", &
     401         9254 :                           usage="N_POINTS_BEYN <integer>", default_i_val=32)
     402         9254 :       CALL section_add_keyword(section, keyword)
     403         9254 :       CALL keyword_release(keyword)
     404              : 
     405              :       CALL keyword_create(keyword, __LOCATION__, name="ONE_CIRCLE", &
     406              :                           description="Set to .TRUE. if only one circle instead of two should be used in the Beyn solver.", &
     407         9254 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     408         9254 :       CALL section_add_keyword(section, keyword)
     409         9254 :       CALL keyword_release(keyword)
     410              : 
     411              :       CALL keyword_create(keyword, __LOCATION__, name="TASKS_PER_INTEGRATION_POINT", &
     412              :                           description="Number of tasks per integration point.", &
     413         9254 :                           usage="TASKS_PER_INTEGRATION_POINT <integer>", default_i_val=0)
     414         9254 :       CALL section_add_keyword(section, keyword)
     415         9254 :       CALL keyword_release(keyword)
     416              : 
     417         9254 :    END SUBROUTINE create_beyn_section
     418              : 
     419              : ! **************************************************************************************************
     420              : !> \brief Creates the section for the PEXSI solver.
     421              : !> \param[inout] section the section to be created
     422              : ! **************************************************************************************************
     423         9254 :    SUBROUTINE create_pexsi_section(section)
     424              :       TYPE(section_type), POINTER                        :: section
     425              : 
     426              :       TYPE(keyword_type), POINTER                        :: keyword
     427              : 
     428         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     429              :       CALL section_create(section, __LOCATION__, name="PEXSI", &
     430              :                           description="Parameters for the PEXSI solver to be used within OMEN.", &
     431              :                           n_keywords=4, n_subsections=0, repeats=.FALSE., &
     432         9254 :                           deprecation_notice="Support for the PEXSI library is slated for removal.")
     433              : 
     434         9254 :       NULLIFY (keyword)
     435              : 
     436              :       CALL keyword_create(keyword, __LOCATION__, name="ORDERING", &
     437              :                           description="Ordering strategy for factorization and selected inversion.", &
     438              :                           enum_c_vals=s2a("PARALLEL", "SEQUENTIAL", "MULTIPLE_MINIMUM_DEGREE"), &
     439              :                           enum_desc=s2a("Parallel ordering using ParMETIS/PT-SCOTCH (PARMETIS option in SuperLU_DIST)", &
     440              :                                         "Sequential ordering using METIS (METIS_AT_PLUS_A option in SuperLU_DIST)", &
     441              :                                         "Multiple minimum degree ordering (MMD_AT_PLUS_A option in SuperLU_DIST)"), &
     442              :                           enum_i_vals=(/0, 1, 2/), &
     443         9254 :                           usage="ORDERING <integer>", default_i_val=1)
     444         9254 :       CALL section_add_keyword(section, keyword)
     445         9254 :       CALL keyword_release(keyword)
     446              : 
     447              :       CALL keyword_create(keyword, __LOCATION__, name="ROW_ORDERING", &
     448              :                           description="row permutation strategy for factorization and selected inversion.", &
     449              :                           enum_c_vals=s2a("NOROWPERM", "LARGEDIAG"), &
     450              :                           enum_desc=s2a("No row permutation (NOROWPERM option in SuperLU_DIST)", &
     451              :                                         "Make diagonal entry larger than off diagonal (LargeDiag option in SuperLU_DIST)"), &
     452              :                           enum_i_vals=(/0, 1/), &
     453         9254 :                           usage="ROW_ORDERING <integer>", default_i_val=0)
     454         9254 :       CALL section_add_keyword(section, keyword)
     455         9254 :       CALL keyword_release(keyword)
     456              : 
     457              :       CALL keyword_create(keyword, __LOCATION__, name="VERBOSITY", &
     458              :                           description="The level of output information.", &
     459              :                           enum_c_vals=s2a("SILENT", "BASIC", "DETAILED"), &
     460              :                           enum_i_vals=(/0, 1, 2/), &
     461         9254 :                           usage="VERBOSITY <integer>", default_i_val=0)
     462         9254 :       CALL section_add_keyword(section, keyword)
     463         9254 :       CALL keyword_release(keyword)
     464              : 
     465              :       CALL keyword_create(keyword, __LOCATION__, name="NP_SYMB_FACT", &
     466              :                           description="Number of processors for PARMETIS/PT-SCOTCH. Only used if ORDERING is set to PARALLEL. "// &
     467              :                           "If 0, the number of processors for PARMETIS/PT-SCOTCH will be set equal to the number of "// &
     468              :                           "MPI ranks per pole. Note: if more than one processor is used, a segmentation fault may occur in the "// &
     469              :                           "symbolic factorization phase.", &
     470         9254 :                           usage="NP_SYMB_FACT <integer>", default_i_val=1)
     471         9254 :       CALL section_add_keyword(section, keyword)
     472         9254 :       CALL keyword_release(keyword)
     473              : 
     474         9254 :    END SUBROUTINE create_pexsi_section
     475              : 
     476              : !**************************************************************************************************
     477              : !> \brief Creates print section for transport calculations.
     478              : !> \param[inout] section the section to be created
     479              : ! **************************************************************************************************
     480         9254 :    SUBROUTINE create_transport_print_section(section)
     481              :       TYPE(section_type), POINTER                        :: section
     482              : 
     483              :       TYPE(keyword_type), POINTER                        :: keyword
     484              :       TYPE(section_type), POINTER                        :: print_key
     485              : 
     486         9254 :       CPASSERT(.NOT. ASSOCIATED(section))
     487              :       CALL section_create(section, __LOCATION__, name="PRINT", &
     488              :                           description="Section of possible print options for transport calculations.", &
     489         9254 :                           repeats=.FALSE.)
     490              : 
     491         9254 :       NULLIFY (keyword, print_key)
     492              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT", &
     493              :                                        description="Controls the printing of current into cube files.", &
     494         9254 :                                        print_level=high_print_level, filename="current")
     495              : 
     496              :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     497              :                           description="The stride (X,Y,Z) used to write the cube file "// &
     498              :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     499              :                           " 1 number valid for all components.", &
     500         9254 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     501         9254 :       CALL section_add_keyword(print_key, keyword)
     502         9254 :       CALL keyword_release(keyword)
     503              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     504              :                           description="append the cube files when they already exist", &
     505         9254 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     506         9254 :       CALL section_add_keyword(print_key, keyword)
     507         9254 :       CALL keyword_release(keyword)
     508              : 
     509         9254 :       CALL section_add_subsection(section, print_key)
     510         9254 :       CALL section_release(print_key)
     511              : 
     512         9254 :    END SUBROUTINE create_transport_print_section
     513              : 
     514              : END MODULE input_cp2k_transport
        

Generated by: LCOV version 2.0-1