Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 : ! !
5 : ! SPDX-License-Identifier: GPL-2.0-or-later !
6 : !--------------------------------------------------------------------------------------------------!
7 :
8 : ! **************************************************************************************************
9 : !> \brief Functions that build SMEAGOL input section.
10 : !> \author Sergey Chulkov
11 : !> \author Christian Ahart
12 : !> \author Clotilde Cucinotta
13 : ! **************************************************************************************************
14 : MODULE input_cp2k_smeagol
15 : USE bibliography, ONLY: Ahart2024
16 : USE cp_output_handling, ONLY: add_last_numeric, &
17 : cp_print_key_section_create, &
18 : debug_print_level, &
19 : high_print_level, &
20 : low_print_level, &
21 : medium_print_level, &
22 : silent_print_level
23 : USE cp_units, ONLY: cp_unit_to_cp2k
24 : USE input_constants, ONLY: smeagol_bulklead_left, &
25 : smeagol_bulklead_leftright, &
26 : smeagol_bulklead_right, &
27 : smeagol_gridmethod_adaptive, &
28 : smeagol_gridmethod_traditional, &
29 : smeagol_integraltype_gauss_chebyshev, &
30 : smeagol_integraltype_gauss_legendre, &
31 : smeagol_runtype_bulktransport, &
32 : smeagol_runtype_emtransport
33 : USE input_keyword_types, ONLY: keyword_create, &
34 : keyword_release, &
35 : keyword_type
36 : USE input_section_types, ONLY: section_add_keyword, &
37 : section_add_subsection, &
38 : section_create, &
39 : section_release, &
40 : section_type
41 : USE input_val_types, ONLY: char_t, &
42 : integer_t, &
43 : logical_t, &
44 : real_t
45 : USE kinds, ONLY: dp
46 : USE physcon, ONLY: kelvin
47 : USE string_utilities, ONLY: s2a
48 : #include "./base/base_uses.f90"
49 : #:include 'input_cp2k_smeagol.fypp'
50 : IMPLICIT NONE
51 : PRIVATE
52 :
53 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_smeagol'
54 :
55 : PUBLIC :: create_dft_smeagol_section
56 :
57 : CONTAINS
58 :
59 : ! **************************************************************************************************
60 : !> \brief Create SMEAGOL input section.
61 : !> \param section input section
62 : ! **************************************************************************************************
63 8546 : SUBROUTINE create_dft_smeagol_section(section)
64 : TYPE(section_type), POINTER :: section
65 :
66 : TYPE(keyword_type), POINTER :: keyword
67 : TYPE(section_type), POINTER :: subsection
68 :
69 8546 : CPASSERT(.NOT. ASSOCIATED(section))
70 : ! +11 -- explicitly defined keywords
71 : ! _SECTION_PARAMETERS_, BS.SubSystemsDelta, AM.AtomListBS, TEMPERATURE, PROJECT_NAME, RUN_TYPE, REGRESSION_TEST,
72 : ! BulkLead, NIMAGES_IJ, EnergyGridType, TypeOfIntegral
73 : CALL section_create(section, __LOCATION__, name="SMEAGOL", &
74 : description="Parameters for NEGF/SMEAGOL simulation.", &
75 : n_subsections=1, repeats=.FALSE., &
76 17092 : citations=(/Ahart2024/))
77 :
78 8546 : NULLIFY (keyword)
79 :
80 : CALL keyword_create(keyword, __LOCATION__, &
81 : name="_SECTION_PARAMETERS_", &
82 : description="Controls activation of SMEAGOL interface", &
83 : default_l_val=.FALSE., &
84 8546 : lone_keyword_l_val=.TRUE.)
85 8546 : CALL section_add_keyword(section, keyword)
86 8546 : CALL keyword_release(keyword)
87 :
88 : ! +++ reademtr()
89 :
90 : ! BS.SubSystemsBoundaries subsection
91 8546 : NULLIFY (subsection)
92 : CALL section_create(subsection, __LOCATION__, name="BS.SubSystemsBoundaries", &
93 : description="Bound state subsystems' boundaries", &
94 8546 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
95 :
96 : CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
97 : description="BS.Subsystems lines containing two integer numbers", &
98 : usage="lower_bound upper_bound", &
99 8546 : repeats=.TRUE., n_var=-1, type_of_var=integer_t)
100 8546 : CALL section_add_keyword(subsection, keyword)
101 8546 : CALL keyword_release(keyword)
102 :
103 8546 : CALL section_add_subsection(section, subsection)
104 8546 : CALL section_release(subsection)
105 :
106 : ! BS.SubSystemsDelta
107 : CALL keyword_create(keyword, __LOCATION__, name="BS.SubSystemsDelta", &
108 : description="Specifies a list of atoms to include.", &
109 : usage="BS.SubSystemsDelta {real} {real} .. {real}", repeats=.FALSE., &
110 8546 : n_var=-1, type_of_var=real_t)
111 8546 : CALL section_add_keyword(section, keyword)
112 8546 : CALL keyword_release(keyword)
113 :
114 : ! use a list of atomic indices (AM.SpeciesBS) instead of list of atomic kind labels (AM.SpeciesBS)
115 : CALL keyword_create(keyword, __LOCATION__, name="AM.AtomListBS", &
116 : description="Specifies a list of atoms to include.", &
117 : usage="AM.SpeciesBS {integer} {integer} .. {integer}", repeats=.FALSE., &
118 8546 : n_var=-1, type_of_var=integer_t)
119 8546 : CALL section_add_keyword(section, keyword)
120 8546 : CALL keyword_release(keyword)
121 :
122 : ! Electronic temperature of the extended molecule.
123 : CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
124 : description="Electronic temperature of the extended molecule."// &
125 : " Temperature of semi-infinite leads are taken from SMEAR / ELECTRONIC_TEMPERATURE"// &
126 : " keyword of relevant bulk-transport calculations.", &
127 : n_var=1, type_of_var=real_t, unit_str="K", &
128 8546 : default_r_val=300.0_dp/kelvin)
129 8546 : CALL section_add_keyword(section, keyword)
130 8546 : CALL keyword_release(keyword)
131 :
132 : CALL keyword_create(keyword, __LOCATION__, name="PROJECT_NAME", &
133 : description="Name of this SMEAGOL project. SMEAGOL writes certain quantities into files named as "// &
134 : "smeagol_project.EXTENSION. The length of the project name should not exceed 20 characters.", &
135 8546 : n_var=1, type_of_var=char_t, default_c_val="smeagol_project")
136 8546 : CALL section_add_keyword(section, keyword)
137 8546 : CALL keyword_release(keyword)
138 :
139 : ! reademtr() enum keywords
140 :
141 : CALL keyword_create(keyword, __LOCATION__, name="RUN_TYPE", &
142 : description="Type of SMEAGOL calculation", &
143 : default_i_val=smeagol_runtype_bulktransport, &
144 : enum_c_vals=s2a("BulkTransport", "EMTransport"), &
145 : enum_desc=s2a( &
146 : "Save Kohn-Sham and density matrices of semi-infinite leads.", &
147 : "Run transport calculation for the extended molecule."), &
148 8546 : enum_i_vals=(/smeagol_runtype_bulktransport, smeagol_runtype_emtransport/))
149 8546 : CALL section_add_keyword(section, keyword)
150 8546 : CALL keyword_release(keyword)
151 :
152 : CALL keyword_create(keyword, __LOCATION__, name="REGRESSION_TEST", &
153 : description="Enables regression test mode. "// &
154 : "Kohn-Sham and density matrices of semi-infinite leads are not written down.", &
155 : n_var=1, type_of_var=logical_t, default_l_val=.FALSE., &
156 8546 : lone_keyword_l_val=.TRUE.)
157 8546 : CALL section_add_keyword(section, keyword)
158 8546 : CALL keyword_release(keyword)
159 :
160 : CALL keyword_create(keyword, __LOCATION__, name="BulkLead", &
161 : description="Lead label for bulk transport calculation", &
162 : default_i_val=smeagol_bulklead_leftright, &
163 : enum_c_vals=s2a("LR", "L", "R"), &
164 : enum_desc=s2a( &
165 : "Identical left and right leads.", &
166 : "Left bulk lead.", &
167 : "Right bulk lead."), &
168 8546 : enum_i_vals=(/smeagol_bulklead_leftright, smeagol_bulklead_left, smeagol_bulklead_right/))
169 8546 : CALL section_add_keyword(section, keyword)
170 8546 : CALL keyword_release(keyword)
171 :
172 : ! force the number of cell images along i and j cell vectors
173 : CALL keyword_create(keyword, __LOCATION__, name="NIMAGES_IJ", &
174 : description="Number of cell images along i and j cell vectors. "// &
175 : "If missing, determine the number of images based on sparsity pattern of the overlap matrix.", &
176 : usage="NIMAGES_IJ 3 3", &
177 8546 : n_var=2, type_of_var=integer_t, default_i_vals=(/0, 0/))
178 8546 : CALL section_add_keyword(section, keyword)
179 8546 : CALL keyword_release(keyword)
180 :
181 : ! reademtr() logical keywords
182 : #:for name1, keyword1, val1 in reademtr_local_llist
183 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
184 : description="${keyword1}$", &
185 : n_var=1, type_of_var=logical_t, default_l_val=${val1}$, &
186 25638 : lone_keyword_l_val=.TRUE.)
187 25638 : CALL section_add_keyword(section, keyword)
188 25638 : CALL keyword_release(keyword)
189 : #:endfor
190 :
191 : #:for name1, keyword1, val1 in reademtr_negfmod_llist
192 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
193 : description="${keyword1}$", &
194 : n_var=1, type_of_var=logical_t, default_l_val=${val1}$, &
195 17092 : lone_keyword_l_val=.TRUE.)
196 17092 : CALL section_add_keyword(section, keyword)
197 17092 : CALL keyword_release(keyword)
198 : #:endfor
199 :
200 : #:for name1, keyword1, val1 in reademtr_negfcoop_llist
201 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
202 : description="${keyword1}$", &
203 : n_var=1, type_of_var=logical_t, default_l_val=${val1}$, &
204 8546 : lone_keyword_l_val=.TRUE.)
205 8546 : CALL section_add_keyword(section, keyword)
206 8546 : CALL keyword_release(keyword)
207 : #:endfor
208 :
209 : ! reademtr() integer keywords
210 : #:for name1, keyword1, val1 in reademtr_local_ilist
211 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
212 : description="${keyword1}$", &
213 94006 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
214 94006 : CALL section_add_keyword(section, keyword)
215 94006 : CALL keyword_release(keyword)
216 : #:endfor
217 :
218 : #:for name1, keyword1, val1 in reademtr_negfmod_ilist
219 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
220 : description="${keyword1}$", &
221 42730 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
222 42730 : CALL section_add_keyword(section, keyword)
223 42730 : CALL keyword_release(keyword)
224 : #:endfor
225 :
226 : #:for name1, keyword1, val1 in reademtr_negfcoop_ilist
227 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
228 : description="${keyword1}$", &
229 8546 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
230 8546 : CALL section_add_keyword(section, keyword)
231 8546 : CALL keyword_release(keyword)
232 : #:endfor
233 :
234 : ! reademtr() real-valued keywords
235 : #:for name1, keyword1, val1 in reademtr_local_rlist
236 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
237 : description="${keyword1}$", &
238 8546 : n_var=1, type_of_var=real_t, default_r_val=${val1}$)
239 8546 : CALL section_add_keyword(section, keyword)
240 8546 : CALL keyword_release(keyword)
241 : #:endfor
242 :
243 : #:for name1, keyword1, val1 in reademtr_negfmod_rlist
244 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
245 : description="${keyword1}$", &
246 8546 : n_var=1, type_of_var=real_t, default_r_val=${val1}$)
247 8546 : CALL section_add_keyword(section, keyword)
248 8546 : CALL keyword_release(keyword)
249 : #:endfor
250 :
251 : ! reademtr() physical-valued keywords
252 : #:for name1, keyword1, val1, unit1 in reademtr_local_plist
253 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
254 : description="${keyword1}$", &
255 : n_var=1, type_of_var=real_t, &
256 25638 : unit_str="${unit1}$", default_r_val=${val1}$)
257 25638 : CALL section_add_keyword(section, keyword)
258 25638 : CALL keyword_release(keyword)
259 : #:endfor
260 :
261 : #:for name1, keyword1, val1, unit1 in reademtr_local_explicit_plist
262 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
263 : description="${keyword1}$", &
264 : n_var=1, type_of_var=real_t, &
265 8546 : unit_str="${unit1}$", default_r_val=${val1}$)
266 8546 : CALL section_add_keyword(section, keyword)
267 8546 : CALL keyword_release(keyword)
268 : #:endfor
269 :
270 : #:for name1, keyword1, val1, unit1 in reademtr_negfmod_rydberg_plist
271 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
272 : description="${keyword1}$", &
273 : n_var=1, type_of_var=real_t, &
274 25638 : unit_str="${unit1}$", default_r_val=${val1}$)
275 25638 : CALL section_add_keyword(section, keyword)
276 25638 : CALL keyword_release(keyword)
277 : #:endfor
278 :
279 : #:for name1, keyword1, val1, unit1 in reademtr_negfmod_plist
280 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
281 : description="${keyword1}$", &
282 : n_var=1, type_of_var=real_t, &
283 25638 : unit_str="${unit1}$", default_r_val=${val1}$)
284 25638 : CALL section_add_keyword(section, keyword)
285 25638 : CALL keyword_release(keyword)
286 : #:endfor
287 :
288 : ! +++ ReadOptionsNEGF_DFT()
289 :
290 : ! ReadOptionsNEGF_DFT() logical keywords
291 : #:for name1, keyword1, val1 in readoptsnegf_negfmod_llist
292 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
293 : description="${keyword1}$", &
294 : n_var=1, type_of_var=logical_t, default_l_val=${val1}$, &
295 59822 : lone_keyword_l_val=.TRUE.)
296 59822 : CALL section_add_keyword(section, keyword)
297 59822 : CALL keyword_release(keyword)
298 : #:endfor
299 :
300 : ! ReadOptionsNEGF_DFT() integer keywords
301 : #:for name1, keyword1, val1 in readoptsnegf_negfmod_ilist
302 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
303 : description="${keyword1}$", &
304 8546 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
305 8546 : CALL section_add_keyword(section, keyword)
306 8546 : CALL keyword_release(keyword)
307 : #:endfor
308 :
309 : ! ReadOptionsNEGF_DFT() real-valued keywords
310 : #:for name1, keyword1, val1 in readoptsnegf_negfmod_rlist
311 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
312 : description="${keyword1}$", &
313 8546 : n_var=1, type_of_var=real_t, default_r_val=${val1}$)
314 8546 : CALL section_add_keyword(section, keyword)
315 8546 : CALL keyword_release(keyword)
316 : #:endfor
317 :
318 : ! ReadOptionsNEGF_DFT() physical-valued keywords
319 : #:for name1, keyword1, val1, unit1 in readoptsnegf_negfmod_explicit_plist
320 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
321 : description="${keyword1}$", &
322 : n_var=1, type_of_var=real_t, &
323 51276 : unit_str="${unit1}$", default_r_val=${val1}$)
324 51276 : CALL section_add_keyword(section, keyword)
325 51276 : CALL keyword_release(keyword)
326 : #:endfor
327 :
328 : #:for name1, keyword1, val1, unit1 in readoptsnegf_bfield_rydberg_plist
329 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
330 : description="${keyword1}$", &
331 : n_var=1, type_of_var=real_t, &
332 25638 : unit_str="${unit1}$", default_r_val=${val1}$)
333 25638 : CALL section_add_keyword(section, keyword)
334 25638 : CALL keyword_release(keyword)
335 : #:endfor
336 :
337 : ! +++ emtrans_options()
338 :
339 : ! emtrans_options() enum keywords
340 : CALL keyword_create(keyword, __LOCATION__, name="EnergyGridType", &
341 : description="Type of energy grid", &
342 : default_i_val=smeagol_gridmethod_traditional, &
343 : enum_c_vals=s2a("TRADITIONAL", "ADAPTIVEGRID"), &
344 : enum_desc=s2a( &
345 : "Traditional grid.", &
346 : "Adaptive grid."), &
347 8546 : enum_i_vals=(/smeagol_gridmethod_traditional, smeagol_gridmethod_adaptive/))
348 8546 : CALL section_add_keyword(section, keyword)
349 8546 : CALL keyword_release(keyword)
350 :
351 : CALL keyword_create(keyword, __LOCATION__, name="TypeOfIntegral", &
352 : description="Method to integrate Green's functions", &
353 : default_i_val=smeagol_integraltype_gauss_legendre, &
354 : enum_c_vals=s2a("GAUSS-LEGENDRE", "GAUSS-CHEBYSHEV"), &
355 : enum_desc=s2a( &
356 : "Gauss-Legendre quadrature method.", &
357 : "Gauss-Chebyshev quadrature method."), &
358 8546 : enum_i_vals=(/smeagol_integraltype_gauss_legendre, smeagol_integraltype_gauss_chebyshev/))
359 8546 : CALL section_add_keyword(section, keyword)
360 8546 : CALL keyword_release(keyword)
361 :
362 : ! emtrans_options() logical keywords
363 : #:for name1, keyword1, val1 in emtoptions_negfmod_llist
364 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
365 : description="${keyword1}$", &
366 : n_var=1, type_of_var=logical_t, default_l_val=${val1}$, &
367 495668 : lone_keyword_l_val=.TRUE.)
368 495668 : CALL section_add_keyword(section, keyword)
369 495668 : CALL keyword_release(keyword)
370 : #:endfor
371 :
372 : #:for name1, keyword1, val1 in emtoptions_local_ilist
373 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
374 : description="${keyword1}$", &
375 25638 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
376 25638 : CALL section_add_keyword(section, keyword)
377 25638 : CALL keyword_release(keyword)
378 : #:endfor
379 :
380 : #:for name1, keyword1, val1 in emtoptions_local_explicit_ilist
381 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
382 : description="${keyword1}$", &
383 42730 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
384 42730 : CALL section_add_keyword(section, keyword)
385 42730 : CALL keyword_release(keyword)
386 : #:endfor
387 :
388 : #:for name1, keyword1, val1 in emtoptions_negfmod_ilist
389 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
390 : description="${keyword1}$", &
391 213650 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
392 213650 : CALL section_add_keyword(section, keyword)
393 213650 : CALL keyword_release(keyword)
394 : #:endfor
395 :
396 : #:for name1, keyword1, val1 in emtoptions_negfmod_explicit_ilist
397 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
398 : description="${keyword1}$", &
399 8546 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
400 8546 : CALL section_add_keyword(section, keyword)
401 8546 : CALL keyword_release(keyword)
402 : #:endfor
403 :
404 : #:for name1, keyword1, val1 in emtoptions_sigma_ilist
405 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
406 : description="${keyword1}$", &
407 8546 : n_var=1, type_of_var=integer_t, default_i_val=${val1}$)
408 8546 : CALL section_add_keyword(section, keyword)
409 8546 : CALL keyword_release(keyword)
410 : #:endfor
411 :
412 : ! emtrans_options() real-valued keywords
413 : #:for name1, keyword1, val1 in emtoptions_negfmod_rlist
414 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
415 : description="${keyword1}$", &
416 264926 : n_var=1, type_of_var=real_t, default_r_val=${val1}$)
417 264926 : CALL section_add_keyword(section, keyword)
418 264926 : CALL keyword_release(keyword)
419 : #:endfor
420 :
421 : #:for name1, keyword1, val1 in emtoptions_negfmod_explicit_rlist
422 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
423 : description="${keyword1}$", &
424 8546 : n_var=1, type_of_var=real_t, default_r_val=${val1}$)
425 8546 : CALL section_add_keyword(section, keyword)
426 8546 : CALL keyword_release(keyword)
427 : #:endfor
428 :
429 : ! emtrans_options() physical-valued keywords
430 : #:for name1, keyword1, val1, unit1 in emtoptions_negfmod_rydberg_plist
431 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
432 : description="${keyword1}$", &
433 : n_var=1, type_of_var=real_t, &
434 17092 : unit_str="${unit1}$", default_r_val=${val1}$)
435 17092 : CALL section_add_keyword(section, keyword)
436 17092 : CALL keyword_release(keyword)
437 : #:endfor
438 :
439 : ! interface physical-valued keywords
440 : #:for name1, keyword1, val1, unit1 in smeagol_interface_local_plist
441 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
442 : description="${keyword1}$", &
443 : n_var=1, type_of_var=real_t, &
444 17092 : unit_str="${unit1}$", default_r_val=${val1}$)
445 17092 : CALL section_add_keyword(section, keyword)
446 17092 : CALL keyword_release(keyword)
447 : #:endfor
448 :
449 : #:for name1, keyword1, val1, unit1 in smeagol_interface_local_explicit_plist
450 : CALL keyword_create(keyword, __LOCATION__, name="${keyword1}$", &
451 : description="${keyword1}$", &
452 : n_var=1, type_of_var=real_t, &
453 8546 : unit_str="${unit1}$", default_r_val=${val1}$)
454 8546 : CALL section_add_keyword(section, keyword)
455 8546 : CALL keyword_release(keyword)
456 : #:endfor
457 :
458 8546 : END SUBROUTINE create_dft_smeagol_section
459 :
460 : END MODULE input_cp2k_smeagol
|