40#include "./base/base_uses.f90"
45 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_negf'
63 cpassert(.NOT.
ASSOCIATED(section))
65 description=
"Parameters which control quantum transport calculation"// &
66 " based on Non-Equilibrium Green Function method.", &
68 n_keywords=18, n_subsections=6, repeats=.false.)
70 NULLIFY (keyword, print_key, subsection)
72 CALL create_contact_section(subsection)
76 CALL create_scattering_region_section(subsection)
86 description=
"Do not keep contact self-energy matrices for future reuse", &
87 default_l_val=.false., lone_keyword_l_val=.true.)
93 description=
"Target accuracy for electronic density.", &
94 n_var=1, type_of_var=
real_t, default_r_val=1.0e-5_dp)
99 description=
"Target accuracy for surface Green's functions.", &
100 n_var=1, type_of_var=
real_t, default_r_val=1.0e-5_dp)
105 description=
"Target accuracy for SCF convergence.", &
106 n_var=1, type_of_var=
real_t, default_r_val=1.0e-5_dp)
111 description=
"Accuracy in mapping atoms between different force environments.", &
112 n_var=1, type_of_var=
real_t, unit_str=
"angstrom", &
113 default_r_val=1.0e-6_dp)
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 default_r_val=-5.0_dp)
125 description=
"Infinitesimal offset from the real axis.", &
126 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
127 default_r_val=1.0e-5_dp)
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 default_r_val=0.2_dp)
141 description=
"Number of poles of Fermi function to consider.", &
148 description=
"Offset from the axis (in terms of k*T)"// &
149 " where poles of the Fermi function reside.", &
155 CALL keyword_create(keyword, __location__, name=
"INTEGRATION_METHOD", &
156 description=
"Method to integrate Green's functions along a closed-circuit contour.", &
158 enum_c_vals=
s2a(
"CLENSHAW-CURTIS",
"SIMPSON"), &
160 "Adaptive Clenshaw-Curtis quadrature method. Requires FFTW3 library.", &
161 "Adaptive Simpson method. Works without FFTW3."), &
166 CALL keyword_create(keyword, __location__, name=
"INTEGRATION_MIN_POINTS", &
167 description=
"Initial (minimal) number of grid point for adaptive numerical integration.", &
173 CALL keyword_create(keyword, __location__, name=
"INTEGRATION_MAX_POINTS", &
174 description=
"Maximal number of grid point for adaptive numerical integration.", &
181 description=
"Maximum number of SCF iterations to be performed.", &
188 description=
"Number of MPI processes to be used per energy point."// &
189 " Default is to use all processors (0).", &
196 description=
"Initial value of the Hartree potential shift", &
197 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
198 default_r_val=0.0_dp)
202 CALL keyword_create(keyword, __location__, name=
"V_SHIFT_OFFSET", &
203 description=
"Initial offset to determine the optimal shift in Hartree potential.", &
204 n_var=1, type_of_var=
real_t, default_r_val=0.10_dp)
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 n_var=1, type_of_var=
integer_t, default_i_val=30)
215 CALL section_create(subsection, __location__,
"PRINT",
"Printing of information during the NEGF.", &
218 CALL create_print_program_run_info_section(print_key)
222 CALL create_print_dos_section(print_key,
"DOS",
"the Density of States (DOS) in the scattering region")
226 CALL create_print_dos_section(print_key,
"TRANSMISSION",
"the transmission function")
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)."), &
244 description=
"Controls the dumping of the restart files during NEGF SCF."// &
245 " By default keeps a short history of three restarts.", &
247 each_iter_names=
s2a(
"NEGF_SCF"), each_iter_values=[1], &
249 CALL keyword_create(keyword, __location__, name=
"BACKUP_COPIES", &
250 description=
"Specifies the maximum number of backup copies.", &
251 usage=
"BACKUP_COPIES {int}", &
262 CALL section_create(subsection, __location__,
"SCF",
"Additional parameters for an NEGF SCF run.", &
266 description=
"Change the atomic Hamiltonian during NEGF self-consistent cycle."// &
267 " If .FALSE., only the density matrix is updated.", &
268 default_l_val=.true., lone_keyword_l_val=.true.)
273 description=
"Restart SCF from files saved as defined in NEGF%PRINT%RESTART", &
274 default_l_val=.true., lone_keyword_l_val=.true.)
289 SUBROUTINE create_contact_section(section)
293 TYPE(
section_type),
POINTER :: print_key, subsection, subsection2
295 cpassert(.NOT.
ASSOCIATED(section))
298 description=
"Section defining the contact region of NEGF setup.", &
299 n_keywords=5, n_subsections=3, repeats=.true.)
301 NULLIFY (keyword, print_key, subsection, subsection2)
303 CALL create_atomlist_section(subsection,
"BULK_REGION", &
304 "the bulk contact adjacent to the screening region.", .false.)
306 CALL create_atomlist_section(subsection2,
"CELL", &
307 "a single bulk contact unit cell. Bulk Hamiltonian will be contstructed "// &
308 "using two such unit cells instead of performing k-point bulk calculation. "// &
309 "FORCE_EVAL_SECTION must be 0.", .true.)
314 CALL create_atomlist_section(subsection,
"SCREENING_REGION", &
315 "the given contact adjacent to the scattering region.", .false.)
319 CALL keyword_create(keyword, __location__, name=
"FORCE_EVAL_SECTION", &
320 description=
" Index of the FORCE_EVAL section which will be used for bulk calculation.", &
321 n_var=1, type_of_var=
integer_t, default_i_val=0)
325 CALL keyword_create(keyword, __location__, name=
"ELECTRIC_POTENTIAL", &
326 description=
"External electrostatic potential applied to the given contact.", &
327 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
328 default_r_val=0.0_dp)
333 description=
"Contact Fermi level at the given temperature."// &
334 " If this keyword is not given explicitly, the Fermi level"// &
335 " will be automatically computed prior the actual NEGF calculation.", &
336 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
337 default_r_val=0.0_dp)
341 CALL keyword_create(keyword, __location__, name=
"REFINE_FERMI_LEVEL", &
342 description=
"Compute the Fermi level using the value from the FERMI_LEVEL keyword"// &
343 " as a starting point. By default the Fermi level is computed only"// &
344 " when the keyword FERMI_LEVEL is not given explicitly.", &
345 default_l_val=.false., lone_keyword_l_val=.true.)
349 CALL keyword_create(keyword, __location__, name=
"FERMI_LEVEL_SHIFTED", &
350 description=
"Used to shift the zero-energy level of an electrode to the common zero-energy level."// &
351 " If this keyword is specified, the Fermi level,"// &
352 " calculated by standard DFT or NEGF (using the REFINE_FERMI_LEVEL keyword),"// &
353 " or previously specified using the FERMI_LEVEL keyword,"// &
354 " is changed to this value. All diagonal elements of the Hamiltonian are shifted accordingly.", &
355 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
356 default_r_val=0.0_dp)
361 description=
"Electronic temperature.", &
362 n_var=1, type_of_var=
real_t, unit_str=
"K", &
363 default_r_val=300.0_dp/
kelvin)
368 CALL section_create(subsection, __location__,
"PRINT",
"Print properties for the given contact.", &
371 CALL create_print_dos_section(print_key,
"DOS",
"the Density of States (DOS)")
380 "Controls reading and writing of the restart files for the specified contact.", repeats=.false.)
383 description=
' Controls part of the filename for output. '// &
384 ' Use filename to obtain projectname-filename. '// &
385 ' Use ./filename to get filename.'// &
386 ' A middle name (contact number, type of matrix, spin if 2 spins) and extension '// &
387 ' are always added to the filename.', &
388 usage=
"FILENAME ./filename ", &
393 CALL keyword_create(keyword, __location__, name=
"READ_WRITE_HS", &
394 description=
"Requests reading of the electrode Hamiltonian and overlap matrices from a file."// &
395 " If at least one of these files doesn't exist, all Hamiltonian and overlap matrices"// &
396 " are calculated and saved. If no name is specified by FILENAME, the default file names are"// &
397 " projectname-Nn-H00, projectname-Nn-H01, projectname-Nn-S00, projectname-Nn-S01"// &
398 " for restricted calculations with identical spin population, or"// &
399 " projectname-Nn-H00-Ss, projectname-Nn-H01-Ss, projectname-Nn-S00-Ss, projectname-Nn-S01-Ss"// &
400 " for unrestricted calculations with two spin components,"// &
401 " where n is the number of the contact and s is the spin index."// &
402 " Otherwise, projectname is modified. Note that the code does not distinguish"// &
403 " between the files created by a separate electrode or the entire system.", &
404 default_l_val=.false., lone_keyword_l_val=.true.)
411 END SUBROUTINE create_contact_section
419 SUBROUTINE create_scattering_region_section(section)
425 cpassert(.NOT.
ASSOCIATED(section))
427 CALL section_create(section, __location__, name=
"SCATTERING_REGION", &
428 description=
"Section defining the scattering region of NEGF setup.", &
429 n_keywords=2, n_subsections=1, repeats=.false.)
431 NULLIFY (keyword, subsection)
434 description=
"Specifies a list of atoms.", &
435 usage=
"LIST {integer} {integer} .. {integer}", repeats=.true., &
441 description=
"Specifies a list of named molecular fragments.", &
442 usage=
"MOLNAME WAT MEOH", repeats=.true., &
443 n_var=-1, type_of_var=
char_t)
449 "Controls reading and writing of the initial restart files for the scattering region,"// &
450 " including the coupling to the electrodes.", repeats=.false.)
452 description=
' Controls part of the filename. '// &
453 ' Use filename to obtain projectname-filename. '// &
454 ' Use ./filename to get filename.'// &
455 ' A middle name (type of matrix, contact number for coupling matrices, spin if 2 spins)'// &
456 ' and extension are always added to the filename.', &
457 usage=
"FILENAME ./filename ", &
461 CALL keyword_create(keyword, __location__, name=
"READ_WRITE_HS", &
462 description=
"Requests reading of the Hamiltonian and overlap matrices from a file."// &
463 " For the scattering region, including the coupling to the electrodes."// &
464 " If at least one of these files doesn't exist, all Hamiltonian and overlap matrices"// &
465 " are calculated and saved. If no name is specified by FILENAME, the default file names are"// &
466 " projectname-H, projectname-H-Nn, projectname-S, projectname-S-Nn"// &
467 " for restricted calculations with identical spin population, or"// &
468 " projectname-H-Ss, projectname-H-Nn-Ss, projectname-S-Ss, projectname-S-Nn-Ss"// &
469 " for unrestricted calculations with two spin components,"// &
470 " where n is the number of the contact and s is the spin index."// &
471 " Otherwise, projectname is modified.", &
472 default_l_val=.false., lone_keyword_l_val=.true.)
478 END SUBROUTINE create_scattering_region_section
489 SUBROUTINE create_atomlist_section(section, name, description, repeats)
491 CHARACTER(len=*),
INTENT(in) :: name, description
492 LOGICAL,
INTENT(in) :: repeats
496 cpassert(.NOT.
ASSOCIATED(section))
498 CALL section_create(section, __location__, name=trim(adjustl(name)), &
499 description=
"Atoms belonging to "//trim(adjustl(description)), &
500 n_keywords=2, n_subsections=0, repeats=repeats)
505 description=
"Specifies a list of atoms.", &
506 usage=
"LIST {integer} {integer} .. {integer}", repeats=.true., &
512 description=
"Specifies a list of named molecular fragments.", &
513 usage=
"MOLNAME WAT MEOH", repeats=.true., &
514 n_var=-1, type_of_var=
char_t)
517 END SUBROUTINE create_atomlist_section
525 SUBROUTINE create_print_program_run_info_section(section)
532 description=
"Controls the printing of basic information during the NEGF.", &
536 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
537 description=
"Level starting at which this property is printed", &
538 usage=
"_SECTION_PARAMETERS_", &
540 enum_c_vals=
s2a(
"on",
"off",
"silent",
"low",
"medium",
"high",
"debug"), &
548 variants=[
"IOLEVEL"], &
549 description=
"Determines the verbose level for this section "// &
550 "additionally to GLOBAL%PRINT_LEVEL and SECTION_PARAMETERS, "// &
551 "which switch on printing.", &
552 usage=
"PRINT_LEVEL HIGH", &
554 s2a(
"SILENT",
"LOW",
"MEDIUM",
"HIGH",
"DEBUG"), &
555 enum_desc=
s2a(
"No output", &
556 "Little output",
"Quite some output",
"Lots of output", &
557 "Everything is written out, useful for debugging purposes only"), &
563 END SUBROUTINE create_print_program_run_info_section
573 SUBROUTINE create_print_dos_section(section, name, description)
575 CHARACTER(len=*),
INTENT(in) :: name, description
580 description=
"Controls the printing of "//trim(adjustl(description))//
".", &
585 description=
"Energy point to start with.", &
586 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
587 default_r_val=-1.0_dp)
592 description=
"Energy point to end with.", &
593 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
594 default_r_val=1.0_dp)
599 description=
"Number of points to compute.", &
600 n_var=1, type_of_var=
integer_t, default_i_val=201)
603 END SUBROUTINE create_print_dos_section
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public papior2017
integer, save, public bailey2006
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
integer, parameter, public silent_print_level
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
Defines the basic variable types.
integer, parameter, public dp
Definition of physical constants:
real(kind=dp), parameter, public kelvin
module that contains the definitions of the scf types
subroutine, public create_mixing_section(section, ls_scf)
Create CP2K input section for the mixing of the density matrix to be used only with diagonalization m...
Utilities for string manipulations.