39#include "./base/base_uses.f90"
44 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_negf'
62 cpassert(.NOT.
ASSOCIATED(section))
64 description=
"Parameters which control quantum transport calculation"// &
65 " based on Non-Equilibrium Green Function method.", &
67 n_keywords=18, n_subsections=6, repeats=.false.)
69 NULLIFY (keyword, print_key, subsection)
71 CALL create_contact_section(subsection)
75 CALL create_scattering_region_section(subsection)
85 description=
"Do not keep contact self-energy matrices for future reuse", &
86 default_l_val=.false., lone_keyword_l_val=.true.)
92 description=
"Target accuracy for electronic density.", &
93 n_var=1, type_of_var=
real_t, default_r_val=1.0e-5_dp)
98 description=
"Target accuracy for surface Green's functions.", &
99 n_var=1, type_of_var=
real_t, default_r_val=1.0e-5_dp)
104 description=
"Target accuracy for SCF convergence.", &
105 n_var=1, type_of_var=
real_t, default_r_val=1.0e-5_dp)
110 description=
"Accuracy in mapping atoms between different force environments.", &
111 n_var=1, type_of_var=
real_t, unit_str=
"angstrom", &
112 default_r_val=1.0e-6_dp)
116 CALL keyword_create(keyword, __location__, name=
"ENERGY_LBOUND", &
117 description=
"Lower bound energy of the conductance band.", &
118 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
119 default_r_val=-5.0_dp)
124 description=
"Infinitesimal offset from the real axis.", &
125 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
126 default_r_val=1.0e-5_dp)
130 CALL keyword_create(keyword, __location__, name=
"HOMO_LUMO_GAP", &
131 description=
"The gap between the HOMO and some fictitious LUMO. This option is used as"// &
132 " an initial offset to determine the actual Fermi level of bulk contacts."// &
133 " It does not need to be exact HOMO-LUMO gap, just some value to start with.", &
134 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
135 default_r_val=0.2_dp)
140 description=
"Number of poles of Fermi function to consider.", &
147 description=
"Offset from the axis (in terms of k*T)"// &
148 " where poles of the Fermi function reside.", &
154 CALL keyword_create(keyword, __location__, name=
"INTEGRATION_METHOD", &
155 description=
"Method to integrate Green's functions along a closed-circuit contour.", &
157 enum_c_vals=
s2a(
"CLENSHAW-CURTIS",
"SIMPSON"), &
159 "Adaptive Clenshaw-Curtis quadrature method. Requires FFTW3 library.", &
160 "Adaptive Simpson method. Works without FFTW3."), &
165 CALL keyword_create(keyword, __location__, name=
"INTEGRATION_MIN_POINTS", &
166 description=
"Initial (minimal) number of grid point for adaptive numerical integration.", &
172 CALL keyword_create(keyword, __location__, name=
"INTEGRATION_MAX_POINTS", &
173 description=
"Maximal number of grid point for adaptive numerical integration.", &
180 description=
"Maximum number of SCF iterations to be performed.", &
187 description=
"Number of MPI processes to be used per energy point."// &
188 " Default is to use all processors (0).", &
195 description=
"Initial value of the Hartree potential shift", &
196 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
197 default_r_val=0.0_dp)
201 CALL keyword_create(keyword, __location__, name=
"V_SHIFT_OFFSET", &
202 description=
"Initial offset to determine the optimal shift in Hartree potential.", &
203 n_var=1, type_of_var=
real_t, default_r_val=0.10_dp)
207 CALL keyword_create(keyword, __location__, name=
"V_SHIFT_MAX_ITERS", &
208 description=
"Maximal number of iteration to determine the optimal shift in Hartree potential.", &
209 n_var=1, type_of_var=
integer_t, default_i_val=30)
214 CALL section_create(subsection, __location__,
"PRINT",
"Printing of information during the NEGF.", &
217 CALL create_print_program_run_info_section(print_key)
221 CALL create_print_dos_section(print_key,
"DOS",
"the Density of States (DOS) in the scattering region")
225 CALL create_print_dos_section(print_key,
"TRANSMISSION",
"the transmission coefficient")
231 description=
"Controls the dumping of the restart files during NEGF SCF."// &
232 " By default keeps a short history of three restarts.", &
234 each_iter_names=
s2a(
"NEGF_SCF"), each_iter_values=[1], &
236 CALL keyword_create(keyword, __location__, name=
"BACKUP_COPIES", &
237 description=
"Specifies the maximum number of backup copies.", &
238 usage=
"BACKUP_COPIES {int}", &
249 CALL section_create(subsection, __location__,
"SCF",
"Additional parameters for an NEGF SCF run.", &
253 description=
"Change the atomic Hamiltonian during NEGF self-consistent cycle."// &
254 " If .FALSE., only the density matrix is updated.", &
255 default_l_val=.true., lone_keyword_l_val=.true.)
260 description=
"Restart SCF from files saved as defined in NEGF%PRINT%RESTART", &
261 default_l_val=.true., lone_keyword_l_val=.true.)
276 SUBROUTINE create_contact_section(section)
280 TYPE(
section_type),
POINTER :: print_key, subsection, subsection2
282 cpassert(.NOT.
ASSOCIATED(section))
285 description=
"Section defining the contact region of NEGF setup.", &
286 n_keywords=5, n_subsections=3, repeats=.true.)
288 NULLIFY (keyword, print_key, subsection, subsection2)
290 CALL create_atomlist_section(subsection,
"BULK_REGION", &
291 "the bulk contact adjacent to the screening region.", .false.)
293 CALL create_atomlist_section(subsection2,
"CELL", &
294 "a single bulk contact unit cell. Bulk Hamiltonian will be contstructed "// &
295 "using two such unit cells instead of performing k-point bulk calculation. "// &
296 "FORCE_EVAL_SECTION must be 0.", .true.)
301 CALL create_atomlist_section(subsection,
"SCREENING_REGION", &
302 "the given contact adjacent to the scattering region.", .false.)
306 CALL keyword_create(keyword, __location__, name=
"FORCE_EVAL_SECTION", &
307 description=
" Index of the FORCE_EVAL section which will be used for bulk calculation.", &
308 n_var=1, type_of_var=
integer_t, default_i_val=0)
312 CALL keyword_create(keyword, __location__, name=
"ELECTRIC_POTENTIAL", &
313 description=
"External electrostatic potential applied to the given contact.", &
314 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
315 default_r_val=0.0_dp)
320 description=
"Contact Fermi level at the given temperature."// &
321 " If this keyword is not given explicitly, the Fermi level"// &
322 " will be automatically computed prior the actual NEGF calculation.", &
323 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
324 default_r_val=0.0_dp)
328 CALL keyword_create(keyword, __location__, name=
"REFINE_FERMI_LEVEL", &
329 description=
"Compute the Fermi level using the value from the FERMI_LEVEL keyword"// &
330 " as a starting point. By default the Fermi level is computed only"// &
331 " when the keyword FERMI_LEVEL is not given explicitly.", &
332 default_l_val=.false., lone_keyword_l_val=.true.)
336 CALL keyword_create(keyword, __location__, name=
"FERMI_LEVEL_SHIFTED", &
337 description=
"Used to shift the zero-energy level of an electrode to the common zero-energy level."// &
338 " If this keyword is specified, the Fermi level,"// &
339 " calculated by standard DFT or NEGF (using the REFINE_FERMI_LEVEL keyword),"// &
340 " or previously specified using the FERMI_LEVEL keyword,"// &
341 " is changed to this value. All diagonal elements of the Hamiltonian are shifted accordingly.", &
342 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
343 default_r_val=0.0_dp)
348 description=
"Electronic temperature.", &
349 n_var=1, type_of_var=
real_t, unit_str=
"K", &
350 default_r_val=300.0_dp/
kelvin)
355 CALL section_create(subsection, __location__,
"PRINT",
"Print properties for the given contact.", &
358 CALL create_print_dos_section(print_key,
"DOS",
"the Density of States (DOS)")
367 "Controls reading and writing of the restart files for the specified contact.", repeats=.false.)
370 description=
' Controls part of the filename for output. '// &
371 ' Use filename to obtain projectname-filename. '// &
372 ' Use ./filename to get filename.'// &
373 ' A middle name (contact number, type of matrix, spin if 2 spins) and extension '// &
374 ' are always added to the filename.', &
375 usage=
"FILENAME ./filename ", &
380 CALL keyword_create(keyword, __location__, name=
"READ_WRITE_HS", &
381 description=
"Requests reading of the electrode Hamiltonian and overlap matrices from a file."// &
382 " If at least one of these files doesn't exist, all Hamiltonian and overlap matrices"// &
383 " are calculated and saved. If no name is specified by FILENAME, the default file names are"// &
384 " projectname-Nn-H00, projectname-Nn-H01, projectname-Nn-S00, projectname-Nn-S01"// &
385 " for restricted calculations with identical spin population, or"// &
386 " projectname-Nn-H00-Ss, projectname-Nn-H01-Ss, projectname-Nn-S00-Ss, projectname-Nn-S01-Ss"// &
387 " for unrestricted calculations with two spin components,"// &
388 " where n is the number of the contact and s is the spin index."// &
389 " Otherwise, projectname is modified. Note that the code does not distinguish"// &
390 " between the files created by a separate electrode or the entire system.", &
391 default_l_val=.false., lone_keyword_l_val=.true.)
398 END SUBROUTINE create_contact_section
406 SUBROUTINE create_scattering_region_section(section)
412 cpassert(.NOT.
ASSOCIATED(section))
414 CALL section_create(section, __location__, name=
"SCATTERING_REGION", &
415 description=
"Section defining the scattering region of NEGF setup.", &
416 n_keywords=2, n_subsections=1, repeats=.false.)
418 NULLIFY (keyword, subsection)
421 description=
"Specifies a list of atoms.", &
422 usage=
"LIST {integer} {integer} .. {integer}", repeats=.true., &
428 description=
"Specifies a list of named molecular fragments.", &
429 usage=
"MOLNAME WAT MEOH", repeats=.true., &
430 n_var=-1, type_of_var=
char_t)
436 "Controls reading and writing of the initial restart files for the scattering region,"// &
437 " including the coupling to the electrodes.", repeats=.false.)
439 description=
' Controls part of the filename. '// &
440 ' Use filename to obtain projectname-filename. '// &
441 ' Use ./filename to get filename.'// &
442 ' A middle name (type of matrix, contact number for coupling matrices, spin if 2 spins)'// &
443 ' and extension are always added to the filename.', &
444 usage=
"FILENAME ./filename ", &
448 CALL keyword_create(keyword, __location__, name=
"READ_WRITE_HS", &
449 description=
"Requests reading of the Hamiltonian and overlap matrices from a file."// &
450 " For the scattering region, including the coupling to the electrodes."// &
451 " If at least one of these files doesn't exist, all Hamiltonian and overlap matrices"// &
452 " are calculated and saved. If no name is specified by FILENAME, the default file names are"// &
453 " projectname-H, projectname-H-Nn, projectname-S, projectname-S-Nn"// &
454 " for restricted calculations with identical spin population, or"// &
455 " projectname-H-Ss, projectname-H-Nn-Ss, projectname-S-Ss, projectname-S-Nn-Ss"// &
456 " for unrestricted calculations with two spin components,"// &
457 " where n is the number of the contact and s is the spin index."// &
458 " Otherwise, projectname is modified.", &
459 default_l_val=.false., lone_keyword_l_val=.true.)
465 END SUBROUTINE create_scattering_region_section
476 SUBROUTINE create_atomlist_section(section, name, description, repeats)
478 CHARACTER(len=*),
INTENT(in) :: name, description
479 LOGICAL,
INTENT(in) :: repeats
483 cpassert(.NOT.
ASSOCIATED(section))
485 CALL section_create(section, __location__, name=trim(adjustl(name)), &
486 description=
"Atoms belonging to "//trim(adjustl(description)), &
487 n_keywords=2, n_subsections=0, repeats=repeats)
492 description=
"Specifies a list of atoms.", &
493 usage=
"LIST {integer} {integer} .. {integer}", repeats=.true., &
499 description=
"Specifies a list of named molecular fragments.", &
500 usage=
"MOLNAME WAT MEOH", repeats=.true., &
501 n_var=-1, type_of_var=
char_t)
504 END SUBROUTINE create_atomlist_section
512 SUBROUTINE create_print_program_run_info_section(section)
519 description=
"Controls the printing of basic information during the NEGF.", &
523 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
524 description=
"Level starting at which this property is printed", &
525 usage=
"_SECTION_PARAMETERS_", &
527 enum_c_vals=
s2a(
"on",
"off",
"silent",
"low",
"medium",
"high",
"debug"), &
535 variants=[
"IOLEVEL"], &
536 description=
"Determines the verbose level for this section "// &
537 "additionally to GLOBAL%PRINT_LEVEL and SECTION_PARAMETERS, "// &
538 "which switch on printing.", &
539 usage=
"PRINT_LEVEL HIGH", &
541 s2a(
"SILENT",
"LOW",
"MEDIUM",
"HIGH",
"DEBUG"), &
542 enum_desc=
s2a(
"No output", &
543 "Little output",
"Quite some output",
"Lots of output", &
544 "Everything is written out, useful for debugging purposes only"), &
550 END SUBROUTINE create_print_program_run_info_section
560 SUBROUTINE create_print_dos_section(section, name, description)
562 CHARACTER(len=*),
INTENT(in) :: name, description
567 description=
"Controls the printing of "//trim(adjustl(description))//
".", &
572 description=
"Energy point to start with.", &
573 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
574 default_r_val=-1.0_dp)
579 description=
"Energy point to end with.", &
580 n_var=1, type_of_var=
real_t, unit_str=
"hartree", &
581 default_r_val=1.0_dp)
586 description=
"Number of points to compute.", &
587 n_var=1, type_of_var=
integer_t, default_i_val=201)
590 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.