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 : integer_t,&
34 : real_t
35 : USE kinds, ONLY: dp
36 : USE physcon, ONLY: kelvin
37 : USE qs_density_mixing_types, ONLY: create_mixing_section
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_negf'
45 :
46 : PUBLIC :: create_negf_section
47 :
48 : CONTAINS
49 :
50 : ! **************************************************************************************************
51 : !> \brief Create NEGF input section.
52 : !> \param section input section
53 : !> \par History
54 : !> * 02.2017 created [Sergey Chulkov]
55 : ! **************************************************************************************************
56 9562 : SUBROUTINE create_negf_section(section)
57 : TYPE(section_type), POINTER :: section
58 :
59 : TYPE(keyword_type), POINTER :: keyword
60 : TYPE(section_type), POINTER :: print_key, subsection
61 :
62 9562 : CPASSERT(.NOT. ASSOCIATED(section))
63 : CALL section_create(section, __LOCATION__, name="NEGF", &
64 : description="Parameters which control quantum transport calculation"// &
65 : " based on Non-Equilibrium Green Function method.", &
66 : citations=[Bailey2006, Papior2017], &
67 28686 : n_keywords=18, n_subsections=6, repeats=.FALSE.)
68 :
69 9562 : NULLIFY (keyword, print_key, subsection)
70 :
71 9562 : CALL create_contact_section(subsection)
72 9562 : CALL section_add_subsection(section, subsection)
73 9562 : CALL section_release(subsection)
74 :
75 9562 : CALL create_scattering_region_section(subsection)
76 9562 : CALL section_add_subsection(section, subsection)
77 9562 : CALL section_release(subsection)
78 :
79 : ! mixing section
80 9562 : CALL create_mixing_section(subsection, ls_scf=.FALSE.)
81 9562 : CALL section_add_subsection(section, subsection)
82 9562 : CALL section_release(subsection)
83 :
84 : CALL keyword_create(keyword, __LOCATION__, name="DISABLE_CACHE", &
85 : description="Do not keep contact self-energy matrices for future reuse", &
86 9562 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
87 9562 : CALL section_add_keyword(section, keyword)
88 9562 : CALL keyword_release(keyword)
89 :
90 : ! convergence thresholds
91 : CALL keyword_create(keyword, __LOCATION__, name="EPS_DENSITY", &
92 : description="Target accuracy for electronic density.", &
93 9562 : n_var=1, type_of_var=real_t, default_r_val=1.0e-5_dp)
94 9562 : CALL section_add_keyword(section, keyword)
95 9562 : CALL keyword_release(keyword)
96 :
97 : CALL keyword_create(keyword, __LOCATION__, name="EPS_GREEN", &
98 : description="Target accuracy for surface Green's functions.", &
99 9562 : n_var=1, type_of_var=real_t, default_r_val=1.0e-5_dp)
100 9562 : CALL section_add_keyword(section, keyword)
101 9562 : CALL keyword_release(keyword)
102 :
103 : CALL keyword_create(keyword, __LOCATION__, name="EPS_SCF", &
104 : description="Target accuracy for SCF convergence.", &
105 9562 : n_var=1, type_of_var=real_t, default_r_val=1.0e-5_dp)
106 9562 : CALL section_add_keyword(section, keyword)
107 9562 : CALL keyword_release(keyword)
108 :
109 : CALL keyword_create(keyword, __LOCATION__, name="EPS_GEO", &
110 : description="Accuracy in mapping atoms between different force environments.", &
111 : n_var=1, type_of_var=real_t, unit_str="angstrom", &
112 9562 : default_r_val=1.0e-6_dp)
113 9562 : CALL section_add_keyword(section, keyword)
114 9562 : CALL keyword_release(keyword)
115 :
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 9562 : default_r_val=-5.0_dp)
120 9562 : CALL section_add_keyword(section, keyword)
121 9562 : CALL keyword_release(keyword)
122 :
123 : CALL keyword_create(keyword, __LOCATION__, name="ETA", &
124 : description="Infinitesimal offset from the real axis.", &
125 : n_var=1, type_of_var=real_t, unit_str="hartree", &
126 9562 : default_r_val=1.0e-5_dp)
127 9562 : CALL section_add_keyword(section, keyword)
128 9562 : CALL keyword_release(keyword)
129 :
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 9562 : default_r_val=0.2_dp)
136 9562 : CALL section_add_keyword(section, keyword)
137 9562 : CALL keyword_release(keyword)
138 :
139 : CALL keyword_create(keyword, __LOCATION__, name="DELTA_NPOLES", &
140 : description="Number of poles of Fermi function to consider.", &
141 : n_var=1, type_of_var=integer_t, &
142 9562 : default_i_val=4)
143 9562 : CALL section_add_keyword(section, keyword)
144 9562 : CALL keyword_release(keyword)
145 :
146 : CALL keyword_create(keyword, __LOCATION__, name="GAMMA_KT", &
147 : description="Offset from the axis (in terms of k*T)"// &
148 : " where poles of the Fermi function reside.", &
149 : n_var=1, type_of_var=integer_t, &
150 9562 : default_i_val=20)
151 9562 : CALL section_add_keyword(section, keyword)
152 9562 : CALL keyword_release(keyword)
153 :
154 : CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_METHOD", &
155 : description="Method to integrate Green's functions along a closed-circuit contour.", &
156 : default_i_val=negfint_method_cc, &
157 : enum_c_vals=s2a("CLENSHAW-CURTIS", "SIMPSON"), &
158 : enum_desc=s2a( &
159 : "Adaptive Clenshaw-Curtis quadrature method. Requires FFTW3 library.", &
160 : "Adaptive Simpson method. Works without FFTW3."), &
161 9562 : enum_i_vals=[negfint_method_cc, negfint_method_simpson])
162 9562 : CALL section_add_keyword(section, keyword)
163 9562 : CALL keyword_release(keyword)
164 :
165 : CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_MIN_POINTS", &
166 : description="Initial (minimal) number of grid point for adaptive numerical integration.", &
167 : n_var=1, type_of_var=integer_t, &
168 9562 : default_i_val=16)
169 9562 : CALL section_add_keyword(section, keyword)
170 9562 : CALL keyword_release(keyword)
171 :
172 : CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_MAX_POINTS", &
173 : description="Maximal number of grid point for adaptive numerical integration.", &
174 : n_var=1, type_of_var=integer_t, &
175 9562 : default_i_val=512)
176 9562 : CALL section_add_keyword(section, keyword)
177 9562 : CALL keyword_release(keyword)
178 :
179 : CALL keyword_create(keyword, __LOCATION__, name="MAX_SCF", &
180 : description="Maximum number of SCF iterations to be performed.", &
181 : n_var=1, type_of_var=integer_t, &
182 9562 : default_i_val=30)
183 9562 : CALL section_add_keyword(section, keyword)
184 9562 : CALL keyword_release(keyword)
185 :
186 : CALL keyword_create(keyword, __LOCATION__, name="NPROC_POINT", &
187 : description="Number of MPI processes to be used per energy point."// &
188 : " Default is to use all processors (0).", &
189 : n_var=1, type_of_var=integer_t, &
190 9562 : default_i_val=0)
191 9562 : CALL section_add_keyword(section, keyword)
192 9562 : CALL keyword_release(keyword)
193 :
194 : CALL keyword_create(keyword, __LOCATION__, name="V_SHIFT", &
195 : description="Initial value of the Hartree potential shift", &
196 : n_var=1, type_of_var=real_t, unit_str="hartree", &
197 9562 : default_r_val=0.0_dp)
198 9562 : CALL section_add_keyword(section, keyword)
199 9562 : CALL keyword_release(keyword)
200 :
201 : CALL keyword_create(keyword, __LOCATION__, name="V_SHIFT_OFFSET", &
202 : description="Initial offset to determine the optimal shift in Hartree potential.", &
203 9562 : n_var=1, type_of_var=real_t, default_r_val=0.10_dp)
204 9562 : CALL section_add_keyword(section, keyword)
205 9562 : CALL keyword_release(keyword)
206 :
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 9562 : n_var=1, type_of_var=integer_t, default_i_val=30)
210 9562 : CALL section_add_keyword(section, keyword)
211 9562 : CALL keyword_release(keyword)
212 :
213 : ! PRINT subsection
214 : CALL section_create(subsection, __LOCATION__, "PRINT", "Printing of information during the NEGF.", &
215 9562 : repeats=.FALSE.)
216 :
217 9562 : CALL create_print_program_run_info_section(print_key)
218 9562 : CALL section_add_subsection(subsection, print_key)
219 9562 : CALL section_release(print_key)
220 :
221 9562 : CALL create_print_dos_section(print_key, "DOS", "the Density of States (DOS) in the scattering region")
222 9562 : CALL section_add_subsection(subsection, print_key)
223 9562 : CALL section_release(print_key)
224 :
225 9562 : CALL create_print_dos_section(print_key, "TRANSMISSION", "the transmission coefficient")
226 9562 : CALL section_add_subsection(subsection, print_key)
227 9562 : CALL section_release(print_key)
228 :
229 : ! RESTART subsection
230 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
231 : description="Controls the dumping of the restart files during NEGF SCF."// &
232 : " By default keeps a short history of three restarts.", &
233 : print_level=low_print_level, common_iter_levels=3, &
234 : each_iter_names=s2a("NEGF_SCF"), each_iter_values=[1], &
235 9562 : add_last=add_last_numeric, filename="RESTART")
236 : CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
237 : description="Specifies the maximum number of backup copies.", &
238 : usage="BACKUP_COPIES {int}", &
239 9562 : default_i_val=3)
240 9562 : CALL section_add_keyword(print_key, keyword)
241 9562 : CALL keyword_release(keyword)
242 9562 : CALL section_add_subsection(subsection, print_key)
243 9562 : CALL section_release(print_key)
244 :
245 9562 : CALL section_add_subsection(section, subsection)
246 9562 : CALL section_release(subsection)
247 :
248 : ! SCF subsection
249 : CALL section_create(subsection, __LOCATION__, "SCF", "Additional parameters for an NEGF SCF run.", &
250 9562 : repeats=.FALSE.)
251 :
252 : CALL keyword_create(keyword, __LOCATION__, name="UPDATE_HS", &
253 : description="Change the atomic Hamiltonian during NEGF self-consistent cycle."// &
254 : " If .FALSE., only the density matrix is updated.", &
255 9562 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
256 9562 : CALL section_add_keyword(subsection, keyword)
257 9562 : CALL keyword_release(keyword)
258 :
259 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_SCF", &
260 : description="Restart SCF from files saved as defined in NEGF%PRINT%RESTART", &
261 9562 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
262 9562 : CALL section_add_keyword(subsection, keyword)
263 9562 : CALL keyword_release(keyword)
264 :
265 9562 : CALL section_add_subsection(section, subsection)
266 9562 : CALL section_release(subsection)
267 :
268 9562 : END SUBROUTINE create_negf_section
269 :
270 : ! **************************************************************************************************
271 : !> \brief Create NEGF%CONTACT input section.
272 : !> \param section input section
273 : !> \par History
274 : !> * 09.2017 split from create_negf_section() [Sergey Chulkov]
275 : ! **************************************************************************************************
276 9562 : SUBROUTINE create_contact_section(section)
277 : TYPE(section_type), POINTER :: section
278 :
279 : TYPE(keyword_type), POINTER :: keyword
280 : TYPE(section_type), POINTER :: print_key, subsection, subsection2
281 :
282 9562 : CPASSERT(.NOT. ASSOCIATED(section))
283 :
284 : CALL section_create(section, __LOCATION__, name="CONTACT", &
285 : description="Section defining the contact region of NEGF setup.", &
286 9562 : n_keywords=5, n_subsections=3, repeats=.TRUE.)
287 :
288 9562 : NULLIFY (keyword, print_key, subsection, subsection2)
289 :
290 : CALL create_atomlist_section(subsection, "BULK_REGION", &
291 9562 : "the bulk contact adjacent to the screening region.", .FALSE.)
292 9562 : CALL section_add_subsection(section, subsection)
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 9562 : "FORCE_EVAL_SECTION must be 0.", .TRUE.)
297 9562 : CALL section_add_subsection(subsection, subsection2)
298 9562 : CALL section_release(subsection2)
299 9562 : CALL section_release(subsection)
300 :
301 : CALL create_atomlist_section(subsection, "SCREENING_REGION", &
302 9562 : "the given contact adjacent to the scattering region.", .FALSE.)
303 9562 : CALL section_add_subsection(section, subsection)
304 9562 : CALL section_release(subsection)
305 :
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 9562 : n_var=1, type_of_var=integer_t, default_i_val=0)
309 9562 : CALL section_add_keyword(section, keyword)
310 9562 : CALL keyword_release(keyword)
311 :
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 9562 : default_r_val=0.0_dp)
316 9562 : CALL section_add_keyword(section, keyword)
317 9562 : CALL keyword_release(keyword)
318 :
319 : CALL keyword_create(keyword, __LOCATION__, name="FERMI_LEVEL", &
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 9562 : default_r_val=0.0_dp)
325 9562 : CALL section_add_keyword(section, keyword)
326 9562 : CALL keyword_release(keyword)
327 :
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 9562 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
333 9562 : CALL section_add_keyword(section, keyword)
334 9562 : CALL keyword_release(keyword)
335 :
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 9562 : default_r_val=0.0_dp)
344 9562 : CALL section_add_keyword(section, keyword)
345 9562 : CALL keyword_release(keyword)
346 :
347 : CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
348 : description="Electronic temperature.", &
349 : n_var=1, type_of_var=real_t, unit_str="K", &
350 9562 : default_r_val=300.0_dp/kelvin)
351 9562 : CALL section_add_keyword(section, keyword)
352 9562 : CALL keyword_release(keyword)
353 :
354 : ! PRINT subsection
355 : CALL section_create(subsection, __LOCATION__, "PRINT", "Print properties for the given contact.", &
356 9562 : repeats=.FALSE.)
357 :
358 9562 : CALL create_print_dos_section(print_key, "DOS", "the Density of States (DOS)")
359 9562 : CALL section_add_subsection(subsection, print_key)
360 9562 : CALL section_release(print_key)
361 :
362 9562 : CALL section_add_subsection(section, subsection)
363 9562 : CALL section_release(subsection)
364 :
365 : ! RESTART subsection
366 : CALL section_create(subsection, __LOCATION__, "RESTART", &
367 9562 : "Controls reading and writing of the restart files for the specified contact.", repeats=.FALSE.)
368 :
369 : CALL keyword_create(keyword, __LOCATION__, name="FILENAME", &
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 ", &
376 9562 : default_lc_val="")
377 9562 : CALL section_add_keyword(subsection, keyword)
378 9562 : CALL keyword_release(keyword)
379 :
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 9562 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
392 9562 : CALL section_add_keyword(subsection, keyword)
393 9562 : CALL keyword_release(keyword)
394 :
395 9562 : CALL section_add_subsection(section, subsection)
396 9562 : CALL section_release(subsection)
397 :
398 9562 : END SUBROUTINE create_contact_section
399 :
400 : ! **************************************************************************************************
401 : !> \brief Create a scattering region section.
402 : !> \param section NEGF section
403 : !> \par History
404 : !> * 02.2026 created [Dmitry Ryndyk]
405 : ! **************************************************************************************************
406 9562 : SUBROUTINE create_scattering_region_section(section)
407 : TYPE(section_type), POINTER :: section
408 :
409 : TYPE(keyword_type), POINTER :: keyword
410 : TYPE(section_type), POINTER :: subsection
411 :
412 9562 : CPASSERT(.NOT. ASSOCIATED(section))
413 :
414 : CALL section_create(section, __LOCATION__, name="SCATTERING_REGION", &
415 : description="Section defining the scattering region of NEGF setup.", &
416 9562 : n_keywords=2, n_subsections=1, repeats=.FALSE.)
417 :
418 9562 : NULLIFY (keyword, subsection)
419 :
420 : CALL keyword_create(keyword, __LOCATION__, name="LIST", &
421 : description="Specifies a list of atoms.", &
422 : usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
423 9562 : n_var=-1, type_of_var=integer_t)
424 9562 : CALL section_add_keyword(section, keyword)
425 9562 : CALL keyword_release(keyword)
426 :
427 : CALL keyword_create(keyword, __LOCATION__, name="MOLNAME", &
428 : description="Specifies a list of named molecular fragments.", &
429 : usage="MOLNAME WAT MEOH", repeats=.TRUE., &
430 9562 : n_var=-1, type_of_var=char_t)
431 9562 : CALL section_add_keyword(section, keyword)
432 9562 : CALL keyword_release(keyword)
433 :
434 : ! RESTART subsection
435 : CALL section_create(subsection, __LOCATION__, "RESTART", &
436 : "Controls reading and writing of the initial restart files for the scattering region,"// &
437 9562 : " including the coupling to the electrodes.", repeats=.FALSE.)
438 : CALL keyword_create(keyword, __LOCATION__, name="FILENAME", &
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 ", &
445 9562 : default_lc_val="")
446 9562 : CALL section_add_keyword(subsection, keyword)
447 9562 : CALL keyword_release(keyword)
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 9562 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
460 9562 : CALL section_add_keyword(subsection, keyword)
461 9562 : CALL keyword_release(keyword)
462 9562 : CALL section_add_subsection(section, subsection)
463 9562 : CALL section_release(subsection)
464 :
465 9562 : END SUBROUTINE create_scattering_region_section
466 :
467 : ! **************************************************************************************************
468 : !> \brief Create an atomic list section.
469 : !> \param section NEGF section
470 : !> \param name name of the new section
471 : !> \param description section description
472 : !> \param repeats whether the section can be repeated
473 : !> \par History
474 : !> * 02.2017 created [Sergey Chulkov]
475 : ! **************************************************************************************************
476 28686 : SUBROUTINE create_atomlist_section(section, name, description, repeats)
477 : TYPE(section_type), POINTER :: section
478 : CHARACTER(len=*), INTENT(in) :: name, description
479 : LOGICAL, INTENT(in) :: repeats
480 :
481 : TYPE(keyword_type), POINTER :: keyword
482 :
483 0 : CPASSERT(.NOT. ASSOCIATED(section))
484 :
485 : CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(name)), &
486 : description="Atoms belonging to "//TRIM(ADJUSTL(description)), &
487 28686 : n_keywords=2, n_subsections=0, repeats=repeats)
488 :
489 28686 : NULLIFY (keyword)
490 :
491 : CALL keyword_create(keyword, __LOCATION__, name="LIST", &
492 : description="Specifies a list of atoms.", &
493 : usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
494 28686 : n_var=-1, type_of_var=integer_t)
495 28686 : CALL section_add_keyword(section, keyword)
496 28686 : CALL keyword_release(keyword)
497 :
498 : CALL keyword_create(keyword, __LOCATION__, name="MOLNAME", &
499 : description="Specifies a list of named molecular fragments.", &
500 : usage="MOLNAME WAT MEOH", repeats=.TRUE., &
501 28686 : n_var=-1, type_of_var=char_t)
502 28686 : CALL section_add_keyword(section, keyword)
503 28686 : CALL keyword_release(keyword)
504 28686 : END SUBROUTINE create_atomlist_section
505 :
506 : ! **************************************************************************************************
507 : !> \brief Create the PROGRAM_RUN_INFO print section.
508 : !> \param section section to create
509 : !> \par History
510 : !> * 11.2020 created [Dmitry Ryndyk]
511 : ! **************************************************************************************************
512 9562 : SUBROUTINE create_print_program_run_info_section(section)
513 :
514 : TYPE(section_type), POINTER :: section
515 :
516 : TYPE(keyword_type), POINTER :: keyword
517 :
518 : CALL cp_print_key_section_create(section, __LOCATION__, "PROGRAM_RUN_INFO", &
519 : description="Controls the printing of basic information during the NEGF.", &
520 9562 : print_level=low_print_level, filename="__STD_OUT__")
521 9562 : NULLIFY (keyword)
522 :
523 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
524 : description="Level starting at which this property is printed", &
525 : usage="_SECTION_PARAMETERS_", &
526 : default_i_val=low_print_level, lone_keyword_i_val=low_print_level, &
527 : enum_c_vals=s2a("on", "off", "silent", "low", "medium", "high", "debug"), &
528 : enum_i_vals=[silent_print_level - 1, debug_print_level + 1, &
529 : silent_print_level, low_print_level, &
530 9562 : medium_print_level, high_print_level, debug_print_level])
531 9562 : CALL section_add_keyword(section, keyword)
532 9562 : CALL keyword_release(keyword)
533 :
534 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_LEVEL", &
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", &
540 : default_i_val=low_print_level, enum_c_vals= &
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"), &
545 : enum_i_vals=[silent_print_level, low_print_level, medium_print_level, &
546 19124 : high_print_level, debug_print_level])
547 9562 : CALL section_add_keyword(section, keyword)
548 9562 : CALL keyword_release(keyword)
549 :
550 9562 : END SUBROUTINE create_print_program_run_info_section
551 :
552 : ! **************************************************************************************************
553 : !> \brief Create the DOS/TRANSMISSION print section.
554 : !> \param section section to create
555 : !> \param name name of the new section
556 : !> \param description section description
557 : !> \par History
558 : !> * 11.2017 created [Sergey Chulkov]
559 : ! **************************************************************************************************
560 28686 : SUBROUTINE create_print_dos_section(section, name, description)
561 : TYPE(section_type), POINTER :: section
562 : CHARACTER(len=*), INTENT(in) :: name, description
563 :
564 : TYPE(keyword_type), POINTER :: keyword
565 :
566 : CALL cp_print_key_section_create(section, __LOCATION__, TRIM(ADJUSTL(name)), &
567 : description="Controls the printing of "//TRIM(ADJUSTL(description))//".", &
568 28686 : print_level=high_print_level, filename="__STD_OUT__")
569 28686 : NULLIFY (keyword)
570 :
571 : CALL keyword_create(keyword, __LOCATION__, name="FROM_ENERGY", &
572 : description="Energy point to start with.", &
573 : n_var=1, type_of_var=real_t, unit_str="hartree", &
574 28686 : default_r_val=-1.0_dp)
575 28686 : CALL section_add_keyword(section, keyword)
576 28686 : CALL keyword_release(keyword)
577 :
578 : CALL keyword_create(keyword, __LOCATION__, name="TILL_ENERGY", &
579 : description="Energy point to end with.", &
580 : n_var=1, type_of_var=real_t, unit_str="hartree", &
581 28686 : default_r_val=1.0_dp)
582 28686 : CALL section_add_keyword(section, keyword)
583 28686 : CALL keyword_release(keyword)
584 :
585 : CALL keyword_create(keyword, __LOCATION__, name="N_GRIDPOINTS", &
586 : description="Number of points to compute.", &
587 28686 : n_var=1, type_of_var=integer_t, default_i_val=201)
588 28686 : CALL section_add_keyword(section, keyword)
589 28686 : CALL keyword_release(keyword)
590 28686 : END SUBROUTINE create_print_dos_section
591 : END MODULE input_cp2k_negf
|