(git:c09f6e5)
Loading...
Searching...
No Matches
cp_control_utils.F
Go to the documentation of this file.
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 Utilities to set up the control types
10! **************************************************************************************************
12 USE bibliography, ONLY: &
18 USE cp_control_types, ONLY: &
23 USE cp_files, ONLY: close_file,&
34 USE cp_units, ONLY: cp_unit_from_cp2k,&
36 USE eeq_input, ONLY: read_eeq_param
38 USE input_constants, ONLY: &
67 USE input_section_types, ONLY: &
70 USE kinds, ONLY: default_path_length,&
72 dp
73 USE mathconstants, ONLY: fourpi
79 USE util, ONLY: sort
84 USE xc_write_output, ONLY: xc_write
85#include "./base/base_uses.f90"
86
87 IMPLICIT NONE
88
89 PRIVATE
90
91 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_control_utils'
92
93 PUBLIC :: read_dft_control, &
102CONTAINS
103
104! **************************************************************************************************
105!> \brief ...
106!> \param dft_control ...
107!> \param dft_section ...
108! **************************************************************************************************
109 SUBROUTINE read_dft_control(dft_control, dft_section)
110 TYPE(dft_control_type), POINTER :: dft_control
111 TYPE(section_vals_type), POINTER :: dft_section
112
113 CHARACTER(len=default_path_length) :: basis_set_file_name, &
114 intensities_file_name, &
115 potential_file_name
116 CHARACTER(LEN=default_string_length), &
117 DIMENSION(:), POINTER :: tmpstringlist
118 INTEGER :: admmtype, irep, isize, method_id, nrep, &
119 xc_deriv_method_id
120 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, &
121 do_rtp, exopt1, exopt2, exopt3, &
122 explicit, is_present, l_param, not_se, &
123 was_present
124 REAL(kind=dp) :: density_cut, gradient_cut, tau_cut
125 REAL(kind=dp), DIMENSION(:), POINTER :: pol
126 TYPE(cp_logger_type), POINTER :: logger
127 TYPE(cp_parser_type) :: parser
128 TYPE(section_vals_type), POINTER :: hairy_probes_section, hfx_section, maxwell_section, &
129 sccs_section, scf_section, tmp_section, xc_fun_section, xc_section
130
131 was_present = .false.
132
133 logger => cp_get_default_logger()
134
135 NULLIFY (tmp_section, xc_fun_section, xc_section)
136 ALLOCATE (dft_control)
137 CALL dft_control_create(dft_control)
138 ! determine wheather this is a semiempirical or DFTB run
139 ! --> (no XC section needs to be provided)
140 not_se = .true.
141 CALL section_vals_val_get(dft_section, "QS%METHOD", i_val=method_id)
142 SELECT CASE (method_id)
145 not_se = .false.
146 END SELECT
147 ! Check for XC section and XC_FUNCTIONAL section
148 xc_section => section_vals_get_subs_vals(dft_section, "XC")
149 CALL section_vals_get(xc_section, explicit=is_present)
150 IF (.NOT. is_present .AND. not_se) THEN
151 cpabort("XC section missing.")
152 END IF
153 IF (is_present) THEN
154 CALL section_vals_val_get(xc_section, "density_cutoff", r_val=density_cut)
155 CALL section_vals_val_get(xc_section, "gradient_cutoff", r_val=gradient_cut)
156 CALL section_vals_val_get(xc_section, "tau_cutoff", r_val=tau_cut)
157 ! Perform numerical stability checks and possibly correct the issues
158 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
159 CALL cp_warn(__location__, &
160 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
161 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
162 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
163 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
164 CALL cp_warn(__location__, &
165 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
166 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
167 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
168 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
169 CALL cp_warn(__location__, &
170 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
171 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
172 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
173 CALL section_vals_val_set(xc_section, "density_cutoff", r_val=density_cut)
174 CALL section_vals_val_set(xc_section, "gradient_cutoff", r_val=gradient_cut)
175 CALL section_vals_val_set(xc_section, "tau_cutoff", r_val=tau_cut)
176 END IF
177 xc_fun_section => section_vals_get_subs_vals(xc_section, "XC_FUNCTIONAL")
178 CALL section_vals_get(xc_fun_section, explicit=is_present)
179 IF (.NOT. is_present .AND. not_se) THEN
180 cpabort("XC_FUNCTIONAL section missing.")
181 END IF
182 scf_section => section_vals_get_subs_vals(dft_section, "SCF")
183 CALL section_vals_val_get(dft_section, "UKS", l_val=dft_control%uks)
184 CALL section_vals_val_get(dft_section, "ROKS", l_val=dft_control%roks)
185 IF (dft_control%uks .OR. dft_control%roks) THEN
186 dft_control%nspins = 2
187 ELSE
188 dft_control%nspins = 1
189 END IF
190
191 dft_control%lsd = (dft_control%nspins > 1)
192 dft_control%use_kinetic_energy_density = xc_uses_kinetic_energy_density(xc_fun_section, dft_control%lsd)
193
194 xc_deriv_method_id = section_get_ival(xc_section, "XC_GRID%XC_DERIV")
195 dft_control%drho_by_collocation = (xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
196 .AND. (xc_deriv_method_id == xc_deriv_collocate))
197 IF (dft_control%drho_by_collocation) THEN
198 cpabort("derivatives by collocation not implemented")
199 END IF
200
201 ! Automatic auxiliary basis set generation
202 CALL section_vals_val_get(dft_section, "AUTO_BASIS", n_rep_val=nrep)
203 DO irep = 1, nrep
204 CALL section_vals_val_get(dft_section, "AUTO_BASIS", i_rep_val=irep, c_vals=tmpstringlist)
205 IF (SIZE(tmpstringlist) == 2) THEN
206 CALL uppercase(tmpstringlist(2))
207 SELECT CASE (tmpstringlist(2))
208 CASE ("X")
209 isize = -1
210 CASE ("SMALL")
211 isize = 0
212 CASE ("MEDIUM")
213 isize = 1
214 CASE ("LARGE")
215 isize = 2
216 CASE ("HUGE")
217 isize = 3
218 CASE DEFAULT
219 cpwarn("Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
220 END SELECT
221 !
222 SELECT CASE (tmpstringlist(1))
223 CASE ("X")
224 CASE ("RI_AUX")
225 dft_control%auto_basis_ri_aux = isize
226 CASE ("AUX_FIT")
227 dft_control%auto_basis_aux_fit = isize
228 CASE ("LRI_AUX")
229 dft_control%auto_basis_lri_aux = isize
230 CASE ("P_LRI_AUX")
231 dft_control%auto_basis_p_lri_aux = isize
232 CASE ("RI_HXC")
233 dft_control%auto_basis_ri_hxc = isize
234 CASE ("RI_XAS")
235 dft_control%auto_basis_ri_xas = isize
236 CASE ("RI_HFX")
237 dft_control%auto_basis_ri_hfx = isize
238 CASE DEFAULT
239 cpwarn("Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
240 END SELECT
241 ELSE
242 CALL cp_abort(__location__, &
243 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
244 END IF
245 END DO
246
247 !! check if we do wavefunction fitting
248 tmp_section => section_vals_get_subs_vals(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD")
249 CALL section_vals_get(tmp_section, explicit=is_present)
250 !
251 hfx_section => section_vals_get_subs_vals(xc_section, "HF")
252 CALL section_vals_get(hfx_section, explicit=do_hfx)
253 CALL section_vals_val_get(xc_section, "WF_CORRELATION%RI_RPA%ADMM", l_val=do_rpa_admm)
254 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
255 !
256 dft_control%do_admm = is_present
257 dft_control%do_admm_mo = .false.
258 dft_control%do_admm_dm = .false.
259 IF (is_present) THEN
260 do_ot = .false.
261 CALL section_vals_val_get(scf_section, "OT%_SECTION_PARAMETERS_", l_val=do_ot)
262 CALL admm_control_create(dft_control%admm_control)
263
264 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
265 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
266 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
267 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
268 dft_control%admm_control%admm_type = admmtype
269 SELECT CASE (admmtype)
270 CASE (no_admm_type)
271 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
272 dft_control%admm_control%purification_method = method_id
273 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
274 dft_control%admm_control%method = method_id
275 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
276 dft_control%admm_control%scaling_model = method_id
277 CASE (admm1_type)
278 ! METHOD BASIS_PROJECTION
279 ! ADMM_PURIFICATION_METHOD choose
280 ! EXCH_SCALING_MODEL NONE
281 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
282 dft_control%admm_control%purification_method = method_id
283 dft_control%admm_control%method = do_admm_basis_projection
284 dft_control%admm_control%scaling_model = do_admm_exch_scaling_none
285 CASE (admm2_type)
286 ! METHOD BASIS_PROJECTION
287 ! ADMM_PURIFICATION_METHOD NONE
288 ! EXCH_SCALING_MODEL NONE
289 dft_control%admm_control%purification_method = do_admm_purify_none
290 dft_control%admm_control%method = do_admm_basis_projection
291 dft_control%admm_control%scaling_model = do_admm_exch_scaling_none
292 CASE (admms_type)
293 ! ADMM_PURIFICATION_METHOD NONE
294 ! METHOD CHARGE_CONSTRAINED_PROJECTION
295 ! EXCH_SCALING_MODEL MERLOT
296 dft_control%admm_control%purification_method = do_admm_purify_none
297 dft_control%admm_control%method = do_admm_charge_constrained_projection
298 dft_control%admm_control%scaling_model = do_admm_exch_scaling_merlot
299 CASE (admmp_type)
300 ! ADMM_PURIFICATION_METHOD NONE
301 ! METHOD BASIS_PROJECTION
302 ! EXCH_SCALING_MODEL MERLOT
303 dft_control%admm_control%purification_method = do_admm_purify_none
304 dft_control%admm_control%method = do_admm_basis_projection
305 dft_control%admm_control%scaling_model = do_admm_exch_scaling_merlot
306 CASE (admmq_type)
307 ! ADMM_PURIFICATION_METHOD NONE
308 ! METHOD CHARGE_CONSTRAINED_PROJECTION
309 ! EXCH_SCALING_MODEL NONE
310 dft_control%admm_control%purification_method = do_admm_purify_none
311 dft_control%admm_control%method = do_admm_charge_constrained_projection
312 dft_control%admm_control%scaling_model = do_admm_exch_scaling_none
313 CASE DEFAULT
314 CALL cp_abort(__location__, &
315 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
316 END SELECT
317
318 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%EPS_FILTER", &
319 r_val=dft_control%admm_control%eps_filter)
320
321 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
322 dft_control%admm_control%aux_exch_func = method_id
323
324 ! parameters for X functional
325 dft_control%admm_control%aux_exch_func_param = .false.
326 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
327 r_val=dft_control%admm_control%aux_x_param(1))
328 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
329 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
330 r_val=dft_control%admm_control%aux_x_param(2))
331 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
332 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
333 r_val=dft_control%admm_control%aux_x_param(3))
334 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
335
336 CALL read_admm_block_list(dft_control%admm_control, dft_section)
337
338 ! check for double assignments
339 SELECT CASE (admmtype)
340 CASE (admm2_type)
341 IF (exopt2) CALL cp_warn(__location__, &
342 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
343 IF (exopt3) CALL cp_warn(__location__, &
344 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
346 IF (exopt1) CALL cp_warn(__location__, &
347 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
348 IF (exopt2) CALL cp_warn(__location__, &
349 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
350 IF (exopt3) CALL cp_warn(__location__, &
351 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
352 END SELECT
353
354 ! In the case of charge-constrained projection (e.g. according to Merlot),
355 ! there is no purification needed and hence, do_admm_purify_none has to be set.
356
357 IF ((dft_control%admm_control%method == do_admm_blocking_purify_full .OR. &
358 dft_control%admm_control%method == do_admm_blocked_projection) &
359 .AND. dft_control%admm_control%scaling_model == do_admm_exch_scaling_merlot) THEN
360 cpabort("ADMM: Blocking and Merlot scaling are mutually exclusive.")
361 END IF
362
363 IF (dft_control%admm_control%method == do_admm_charge_constrained_projection .AND. &
364 dft_control%admm_control%purification_method /= do_admm_purify_none) THEN
365 CALL cp_abort(__location__, &
366 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
367 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
368 END IF
369
370 IF (dft_control%admm_control%purification_method == do_admm_purify_mo_diag .OR. &
371 dft_control%admm_control%purification_method == do_admm_purify_mo_no_diag) THEN
372 IF (dft_control%admm_control%method /= do_admm_basis_projection) &
373 cpabort("ADMM: Chosen purification requires BASIS_PROJECTION")
374
375 IF (.NOT. do_ot) cpabort("ADMM: MO-based purification requires OT.")
376 END IF
377
378 IF (dft_control%admm_control%purification_method == do_admm_purify_none_dm .OR. &
379 dft_control%admm_control%purification_method == do_admm_purify_mcweeny) THEN
380 dft_control%do_admm_dm = .true.
381 ELSE
382 dft_control%do_admm_mo = .true.
383 END IF
384 END IF
385
386 ! Set restricted to true, if both OT and ROKS are requested
387 !MK in principle dft_control%restricted could be dropped completely like the
388 !MK input key by using only dft_control%roks now
389 CALL section_vals_val_get(scf_section, "OT%_SECTION_PARAMETERS_", l_val=l_param)
390 dft_control%restricted = (dft_control%roks .AND. l_param)
391
392 CALL section_vals_val_get(dft_section, "CHARGE", i_val=dft_control%charge)
393 CALL section_vals_val_get(dft_section, "MULTIPLICITY", i_val=dft_control%multiplicity)
394 CALL section_vals_val_get(dft_section, "RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
395 IF (dft_control%relax_multiplicity > 0.0_dp) THEN
396 IF (.NOT. dft_control%uks) &
397 CALL cp_abort(__location__, "The option RELAX_MULTIPLICITY is only valid for "// &
398 "unrestricted Kohn-Sham (UKS) calculations")
399 END IF
400
401 !Read the HAIR PROBES input section if present
402 hairy_probes_section => section_vals_get_subs_vals(dft_section, "HAIRY_PROBES")
403 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
404
405 IF (is_present) THEN
406 dft_control%hairy_probes = .true.
407 ALLOCATE (dft_control%probe(nrep))
408 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
409 END IF
410
411 ! check for the presence of the low spin roks section
412 tmp_section => section_vals_get_subs_vals(dft_section, "LOW_SPIN_ROKS")
413 CALL section_vals_get(tmp_section, explicit=dft_control%low_spin_roks)
414
415 dft_control%sic_method_id = sic_none
416 dft_control%sic_scaling_a = 1.0_dp
417 dft_control%sic_scaling_b = 1.0_dp
418
419 ! DFT+U
420 dft_control%dft_plus_u = .false.
421 CALL section_vals_val_get(dft_section, "PLUS_U_METHOD", i_val=method_id)
422 dft_control%plus_u_method_id = method_id
423
424 ! Smearing in use
425 dft_control%smear = .false.
426
427 ! Surface dipole correction
428 dft_control%correct_surf_dip = .false.
429 CALL section_vals_val_get(dft_section, "SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
430 CALL section_vals_val_get(dft_section, "SURF_DIP_DIR", i_val=dft_control%dir_surf_dip)
431 dft_control%pos_dir_surf_dip = -1.0_dp
432 CALL section_vals_val_get(dft_section, "SURF_DIP_POS", r_val=dft_control%pos_dir_surf_dip)
433 ! another logical variable, surf_dip_correct_switch, is introduced for
434 ! implementation of "SURF_DIP_SWITCH" [SGh]
435 dft_control%switch_surf_dip = .false.
436 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
437 CALL section_vals_val_get(dft_section, "SURF_DIP_SWITCH", l_val=dft_control%switch_surf_dip)
438 dft_control%correct_el_density_dip = .false.
439 CALL section_vals_val_get(dft_section, "CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
440 IF (dft_control%correct_el_density_dip) THEN
441 IF (dft_control%correct_surf_dip) THEN
442 ! Do nothing, move on
443 ELSE
444 dft_control%correct_el_density_dip = .false.
445 cpwarn("CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
446 END IF
447 END IF
448
449 CALL section_vals_val_get(dft_section, "BASIS_SET_FILE_NAME", &
450 c_val=basis_set_file_name)
451 CALL section_vals_val_get(dft_section, "POTENTIAL_FILE_NAME", &
452 c_val=potential_file_name)
453
454 ! Read the input section
455 tmp_section => section_vals_get_subs_vals(dft_section, "sic")
456 CALL section_vals_val_get(tmp_section, "SIC_METHOD", &
457 i_val=dft_control%sic_method_id)
458 CALL section_vals_val_get(tmp_section, "ORBITAL_SET", &
459 i_val=dft_control%sic_list_id)
460 CALL section_vals_val_get(tmp_section, "SIC_SCALING_A", &
461 r_val=dft_control%sic_scaling_a)
462 CALL section_vals_val_get(tmp_section, "SIC_SCALING_B", &
463 r_val=dft_control%sic_scaling_b)
464
465 do_rtp = .false.
466 tmp_section => section_vals_get_subs_vals(dft_section, "REAL_TIME_PROPAGATION")
467 CALL section_vals_get(tmp_section, explicit=is_present)
468 IF (is_present) THEN
469 CALL read_rtp_section(dft_control, tmp_section)
470 do_rtp = .true.
471 END IF
472
473 ! Read the input section
474 tmp_section => section_vals_get_subs_vals(dft_section, "XAS")
475 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_calculation)
476 IF (dft_control%do_xas_calculation) THEN
477 ! Override with section parameter
478 CALL section_vals_val_get(tmp_section, "_SECTION_PARAMETERS_", &
479 l_val=dft_control%do_xas_calculation)
480 END IF
481
482 tmp_section => section_vals_get_subs_vals(dft_section, "XAS_TDP")
483 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
484 IF (dft_control%do_xas_tdp_calculation) THEN
485 ! Override with section parameter
486 CALL section_vals_val_get(tmp_section, "_SECTION_PARAMETERS_", &
487 l_val=dft_control%do_xas_tdp_calculation)
488 END IF
489
490 ! Read the finite field input section
491 dft_control%apply_efield = .false.
492 dft_control%apply_efield_field = .false. !this is for RTP
493 dft_control%apply_vector_potential = .false. !this is for RTP
494 tmp_section => section_vals_get_subs_vals(dft_section, "EFIELD")
495 CALL section_vals_get(tmp_section, n_repetition=nrep, explicit=is_present)
496 IF (is_present) THEN
497 ALLOCATE (dft_control%efield_fields(nrep))
498 CALL read_efield_sections(dft_control, tmp_section)
499 IF (do_rtp) THEN
500 IF (.NOT. dft_control%rtp_control%velocity_gauge) THEN
501 dft_control%apply_efield_field = .true.
502 ELSE
503 dft_control%apply_vector_potential = .true.
504 ! Use this input value of vector potential to (re)start RTP
505 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
506 END IF
507 ELSE
508 dft_control%apply_efield = .true.
509 cpassert(nrep == 1)
510 END IF
511 END IF
512
513 ! Read the finite field input section for periodic fields
514 tmp_section => section_vals_get_subs_vals(dft_section, "PERIODIC_EFIELD")
515 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
516 IF (dft_control%apply_period_efield) THEN
517 ALLOCATE (dft_control%period_efield)
518 CALL section_vals_val_get(tmp_section, "POLARISATION", r_vals=pol)
519 dft_control%period_efield%polarisation(1:3) = pol(1:3)
520 CALL section_vals_val_get(tmp_section, "D_FILTER", r_vals=pol)
521 dft_control%period_efield%d_filter(1:3) = pol(1:3)
522 CALL section_vals_val_get(tmp_section, "INTENSITY", &
523 r_val=dft_control%period_efield%strength)
524 dft_control%period_efield%displacement_field = .false.
525 CALL section_vals_val_get(tmp_section, "DISPLACEMENT_FIELD", &
526 l_val=dft_control%period_efield%displacement_field)
527
528 CALL section_vals_val_get(tmp_section, "INTENSITY_LIST", r_vals=pol)
529
530 CALL section_vals_val_get(tmp_section, "INTENSITIES_FILE_NAME", c_val=intensities_file_name)
531
532 IF (SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp) THEN
533 ! if INTENSITY_LIST is present, INTENSITY and INTENSITIES_FILE_NAME must not be present
534 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /= "") THEN
535 CALL cp_abort(__location__, "[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
536 "or INTENSITIES_FILE_NAME can be specified.")
537 END IF
538
539 ALLOCATE (dft_control%period_efield%strength_list(SIZE(pol)))
540 dft_control%period_efield%strength_list(1:SIZE(pol)) = pol(1:SIZE(pol))
541 END IF
542
543 IF (intensities_file_name /= "") THEN
544 ! if INTENSITIES_FILE_NAME is present, INTENSITY must not be present
545 IF (dft_control%period_efield%strength /= 0.0_dp) THEN
546 CALL cp_abort(__location__, "[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
547 "or INTENSITIES_FILE_NAME can be specified.")
548 END IF
549
550 CALL parser_create(parser, intensities_file_name)
551
552 nrep = 0
553 DO WHILE (.true.)
554 CALL parser_read_line(parser, 1, at_end)
555 IF (at_end) EXIT
556 nrep = nrep + 1
557 END DO
558
559 IF (nrep == 0) THEN
560 cpabort("[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
561 END IF
562
563 ALLOCATE (dft_control%period_efield%strength_list(nrep))
564
565 CALL parser_reset(parser)
566 DO irep = 1, nrep
567 CALL parser_read_line(parser, 1)
568 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
569 END DO
570
571 CALL parser_release(parser)
572 END IF
573
574 CALL section_vals_val_get(tmp_section, "START_FRAME", &
575 i_val=dft_control%period_efield%start_frame)
576 CALL section_vals_val_get(tmp_section, "END_FRAME", &
577 i_val=dft_control%period_efield%end_frame)
578
579 IF (dft_control%period_efield%end_frame /= -1) THEN
580 ! check if valid bounds are given
581 ! if an end frame is given, the number of active frames must be a
582 ! multiple of the number of intensities
583 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame) THEN
584 cpabort("[PERIODIC FIELD] START_FRAME > END_FRAME")
585 ELSE IF (dft_control%period_efield%start_frame < 1) THEN
586 cpabort("[PERIODIC FIELD] START_FRAME < 1")
587 ELSE IF (mod(dft_control%period_efield%end_frame - &
588 dft_control%period_efield%start_frame + 1, SIZE(pol)) /= 0) THEN
589 CALL cp_abort(__location__, &
590 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
591 END IF
592 END IF
593
594 ! periodic fields don't work with RTP
595 cpassert(.NOT. do_rtp)
596 IF (dft_control%period_efield%displacement_field) THEN
597 CALL cite_reference(stengel2009)
598 ELSE
599 CALL cite_reference(souza2002)
600 CALL cite_reference(umari2002)
601 END IF
602 END IF
603
604 ! Read the external potential input section
605 tmp_section => section_vals_get_subs_vals(dft_section, "EXTERNAL_POTENTIAL")
606 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
607 IF (dft_control%apply_external_potential) THEN
608 CALL expot_control_create(dft_control%expot_control)
609 CALL section_vals_val_get(tmp_section, "READ_FROM_CUBE", &
610 l_val=dft_control%expot_control%read_from_cube)
611 CALL section_vals_val_get(tmp_section, "STATIC", &
612 l_val=dft_control%expot_control%static)
613 CALL section_vals_val_get(tmp_section, "SCALING_FACTOR", &
614 r_val=dft_control%expot_control%scaling_factor)
615 ! External potential using Maxwell equation
616 maxwell_section => section_vals_get_subs_vals(tmp_section, "MAXWELL")
617 CALL section_vals_get(maxwell_section, explicit=is_present)
618 IF (is_present) THEN
619 dft_control%expot_control%maxwell_solver = .true.
620 CALL maxwell_control_create(dft_control%maxwell_control)
621 ! read the input values from Maxwell section
622 CALL section_vals_val_get(maxwell_section, "TEST_REAL", &
623 r_val=dft_control%maxwell_control%real_test)
624 CALL section_vals_val_get(maxwell_section, "TEST_INTEGER", &
625 i_val=dft_control%maxwell_control%int_test)
626 CALL section_vals_val_get(maxwell_section, "TEST_LOGICAL", &
627 l_val=dft_control%maxwell_control%log_test)
628 ELSE
629 dft_control%expot_control%maxwell_solver = .false.
630 END IF
631 END IF
632
633 ! Read the SCCS input section if present
634 sccs_section => section_vals_get_subs_vals(dft_section, "SCCS")
635 CALL section_vals_get(sccs_section, explicit=is_present)
636 IF (is_present) THEN
637 ! Check section parameter if SCCS is activated
638 CALL section_vals_val_get(sccs_section, "_SECTION_PARAMETERS_", &
639 l_val=dft_control%do_sccs)
640 IF (dft_control%do_sccs) THEN
641 ALLOCATE (dft_control%sccs_control)
642 CALL section_vals_val_get(sccs_section, "RELATIVE_PERMITTIVITY", &
643 r_val=dft_control%sccs_control%epsilon_solvent)
644 CALL section_vals_val_get(sccs_section, "ALPHA", &
645 r_val=dft_control%sccs_control%alpha_solvent)
646 CALL section_vals_val_get(sccs_section, "BETA", &
647 r_val=dft_control%sccs_control%beta_solvent)
648 CALL section_vals_val_get(sccs_section, "DELTA_RHO", &
649 r_val=dft_control%sccs_control%delta_rho)
650 CALL section_vals_val_get(sccs_section, "DERIVATIVE_METHOD", &
651 i_val=dft_control%sccs_control%derivative_method)
652 CALL section_vals_val_get(sccs_section, "METHOD", &
653 i_val=dft_control%sccs_control%method_id)
654 CALL section_vals_val_get(sccs_section, "EPS_SCCS", &
655 r_val=dft_control%sccs_control%eps_sccs)
656 CALL section_vals_val_get(sccs_section, "EPS_SCF", &
657 r_val=dft_control%sccs_control%eps_scf)
658 CALL section_vals_val_get(sccs_section, "GAMMA", &
659 r_val=dft_control%sccs_control%gamma_solvent)
660 CALL section_vals_val_get(sccs_section, "MAX_ITER", &
661 i_val=dft_control%sccs_control%max_iter)
662 CALL section_vals_val_get(sccs_section, "MIXING", &
663 r_val=dft_control%sccs_control%mixing)
664 SELECT CASE (dft_control%sccs_control%method_id)
665 CASE (sccs_andreussi)
666 tmp_section => section_vals_get_subs_vals(sccs_section, "ANDREUSSI")
667 CALL section_vals_val_get(tmp_section, "RHO_MAX", &
668 r_val=dft_control%sccs_control%rho_max)
669 CALL section_vals_val_get(tmp_section, "RHO_MIN", &
670 r_val=dft_control%sccs_control%rho_min)
671 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min) THEN
672 CALL cp_abort(__location__, &
673 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
674 "Please, check your input!")
675 END IF
676 CALL cite_reference(andreussi2012)
678 tmp_section => section_vals_get_subs_vals(sccs_section, "FATTEBERT-GYGI")
679 CALL section_vals_val_get(tmp_section, "BETA", &
680 r_val=dft_control%sccs_control%beta)
681 IF (dft_control%sccs_control%beta < 0.5_dp) THEN
682 CALL cp_abort(__location__, &
683 "A value smaller than 0.5 for the SCCS parameter beta "// &
684 "causes numerical problems. Please, check your input!")
685 END IF
686 CALL section_vals_val_get(tmp_section, "RHO_ZERO", &
687 r_val=dft_control%sccs_control%rho_zero)
688 CALL cite_reference(fattebert2002)
689 CASE DEFAULT
690 cpabort("Invalid SCCS model specified. Please, check your input!")
691 END SELECT
692 CALL cite_reference(yin2017)
693 END IF
694 END IF
695
696 ! ZMP added input sections
697 ! Read the external density input section
698 tmp_section => section_vals_get_subs_vals(dft_section, "EXTERNAL_DENSITY")
699 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
700
701 ! Read the external vxc input section
702 tmp_section => section_vals_get_subs_vals(dft_section, "EXTERNAL_VXC")
703 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_vxc)
704
705 ! SMEAGOL interface
706 tmp_section => section_vals_get_subs_vals(dft_section, "SMEAGOL")
707 CALL read_smeagol_control(dft_control%smeagol_control, tmp_section)
708
709 END SUBROUTINE read_dft_control
710
711! **************************************************************************************************
712!> \brief Reads the input and stores in the rixs_control_type
713!> \param rixs_control ...
714!> \param rixs_section ...
715!> \param qs_control ...
716! **************************************************************************************************
717 SUBROUTINE read_rixs_control(rixs_control, rixs_section, qs_control)
718 TYPE(rixs_control_type), POINTER :: rixs_control
719 TYPE(section_vals_type), POINTER :: rixs_section
720 TYPE(qs_control_type), POINTER :: qs_control
721
722 TYPE(section_vals_type), POINTER :: td_section, xas_section
723
724 td_section => section_vals_get_subs_vals(rixs_section, "TDDFPT")
725 CALL read_tddfpt2_control(rixs_control%tddfpt2_control, td_section, qs_control)
726
727 xas_section => section_vals_get_subs_vals(rixs_section, "XAS_TDP")
728 CALL read_xas_tdp_control(rixs_control%xas_tdp_control, xas_section)
729
730 END SUBROUTINE read_rixs_control
731
732! **************************************************************************************************
733!> \brief ...
734!> \param qs_control ...
735!> \param dft_section ...
736! **************************************************************************************************
737 SUBROUTINE read_mgrid_section(qs_control, dft_section)
738
739 TYPE(qs_control_type), INTENT(INOUT) :: qs_control
740 TYPE(section_vals_type), POINTER :: dft_section
741
742 CHARACTER(len=*), PARAMETER :: routinen = 'read_mgrid_section'
743
744 INTEGER :: handle, igrid_level, ngrid_level
745 LOGICAL :: explicit, multigrid_set
746 REAL(dp) :: cutoff
747 REAL(dp), DIMENSION(:), POINTER :: cutofflist
748 TYPE(section_vals_type), POINTER :: mgrid_section
749
750 CALL timeset(routinen, handle)
751
752 NULLIFY (mgrid_section, cutofflist)
753 mgrid_section => section_vals_get_subs_vals(dft_section, "MGRID")
754
755 CALL section_vals_val_get(mgrid_section, "NGRIDS", i_val=ngrid_level)
756 CALL section_vals_val_get(mgrid_section, "MULTIGRID_SET", l_val=multigrid_set)
757 CALL section_vals_val_get(mgrid_section, "CUTOFF", r_val=cutoff)
758 CALL section_vals_val_get(mgrid_section, "PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
759 CALL section_vals_val_get(mgrid_section, "COMMENSURATE", l_val=qs_control%commensurate_mgrids)
760 CALL section_vals_val_get(mgrid_section, "REALSPACE", l_val=qs_control%realspace_mgrids)
761 CALL section_vals_val_get(mgrid_section, "REL_CUTOFF", r_val=qs_control%relative_cutoff)
762 CALL section_vals_val_get(mgrid_section, "SKIP_LOAD_BALANCE_DISTRIBUTED", &
763 l_val=qs_control%skip_load_balance_distributed)
764
765 ! For SE and DFTB possibly override with new defaults
766 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb) THEN
767 ngrid_level = 1
768 multigrid_set = .false.
769 ! Override default cutoff value unless user specified an explicit argument..
770 CALL section_vals_val_get(mgrid_section, "CUTOFF", explicit=explicit, r_val=cutoff)
771 IF (.NOT. explicit) cutoff = 1.0_dp
772 END IF
773
774 ALLOCATE (qs_control%e_cutoff(ngrid_level))
775 qs_control%cutoff = cutoff
776
777 IF (multigrid_set) THEN
778 ! Read the values from input
779 IF (qs_control%commensurate_mgrids) THEN
780 cpabort("Do not specify cutoffs for the commensurate grids (NYI)")
781 END IF
782
783 CALL section_vals_val_get(mgrid_section, "MULTIGRID_CUTOFF", r_vals=cutofflist)
784 IF (ASSOCIATED(cutofflist)) THEN
785 IF (SIZE(cutofflist, 1) /= ngrid_level) THEN
786 cpabort("Number of multi-grids requested and number of cutoff values do not match")
787 END IF
788 DO igrid_level = 1, ngrid_level
789 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
790 END DO
791 END IF
792 ! set cutoff to smallest value in multgrid available with >= cutoff
793 DO igrid_level = ngrid_level, 1, -1
794 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level)) THEN
795 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
796 EXIT
797 END IF
798 ! set largest grid value to cutoff
799 IF (igrid_level == 1) THEN
800 qs_control%cutoff = qs_control%e_cutoff(1)
801 END IF
802 END DO
803 ELSE
804 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
805 qs_control%e_cutoff(1) = qs_control%cutoff
806 DO igrid_level = 2, ngrid_level
807 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
808 qs_control%progression_factor
809 END DO
810 END IF
811 ! check that multigrids are ordered
812 DO igrid_level = 2, ngrid_level
813 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1)) THEN
814 cpabort("The cutoff values for the multi-grids are not ordered from large to small")
815 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1)) THEN
816 cpabort("The same cutoff value was specified for two multi-grids")
817 END IF
818 END DO
819 CALL timestop(handle)
820 END SUBROUTINE read_mgrid_section
821
822! **************************************************************************************************
823!> \brief ...
824!> \param qs_control ...
825!> \param qs_section ...
826! **************************************************************************************************
827 SUBROUTINE read_qs_section(qs_control, qs_section)
828
829 TYPE(qs_control_type), INTENT(INOUT) :: qs_control
830 TYPE(section_vals_type), POINTER :: qs_section
831
832 CHARACTER(len=*), PARAMETER :: routinen = 'read_qs_section'
833
834 CHARACTER(LEN=default_string_length) :: cval
835 CHARACTER(LEN=default_string_length), &
836 DIMENSION(:), POINTER :: clist
837 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
838 ngauss, ngp, nrep
839 INTEGER, DIMENSION(:), POINTER :: tmplist
840 LOGICAL :: explicit, was_present
841 REAL(dp) :: tmp, tmpsqrt, value
842 REAL(dp), POINTER :: scal(:)
843 TYPE(section_vals_type), POINTER :: cdft_control_section, ddapc_restraint_section, &
844 dftb_parameter, dftb_section, eeq_section, genpot_section, lri_optbas_section, &
845 mull_section, nonbonded_section, s2_restraint_section, se_section, xtb_parameter, &
846 xtb_section, xtb_tblite
847
848 CALL timeset(routinen, handle)
849
850 was_present = .false.
851 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
852 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
853 cdft_control_section, genpot_section, eeq_section)
854
855 mull_section => section_vals_get_subs_vals(qs_section, "MULLIKEN_RESTRAINT")
856 ddapc_restraint_section => section_vals_get_subs_vals(qs_section, "DDAPC_RESTRAINT")
857 s2_restraint_section => section_vals_get_subs_vals(qs_section, "S2_RESTRAINT")
858 se_section => section_vals_get_subs_vals(qs_section, "SE")
859 dftb_section => section_vals_get_subs_vals(qs_section, "DFTB")
860 xtb_section => section_vals_get_subs_vals(qs_section, "xTB")
861 dftb_parameter => section_vals_get_subs_vals(dftb_section, "PARAMETER")
862 xtb_parameter => section_vals_get_subs_vals(xtb_section, "PARAMETER")
863 eeq_section => section_vals_get_subs_vals(xtb_section, "EEQ")
864 lri_optbas_section => section_vals_get_subs_vals(qs_section, "OPTIMIZE_LRI_BASIS")
865 cdft_control_section => section_vals_get_subs_vals(qs_section, "CDFT")
866 nonbonded_section => section_vals_get_subs_vals(xtb_section, "NONBONDED")
867 genpot_section => section_vals_get_subs_vals(nonbonded_section, "GENPOT")
868 xtb_tblite => section_vals_get_subs_vals(xtb_section, "TBLITE")
869
870 ! Setup all defaults values and overwrite input parameters
871 ! EPS_DEFAULT should set the target accuracy in the total energy (~per electron) or a closely related value
872 CALL section_vals_val_get(qs_section, "EPS_DEFAULT", r_val=value)
873 tmpsqrt = sqrt(value) ! a trick to work around a NAG 5.1 optimizer bug
874
875 ! random choice ?
876 qs_control%eps_core_charge = value/100.0_dp
877 ! correct if all Gaussians would have the same radius (overlap will be smaller than eps_pgf_orb**2).
878 ! Can be significantly in error if not... requires fully new screening/pairlist procedures
879 qs_control%eps_pgf_orb = tmpsqrt
880 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
881 ! consistent since also a kind of overlap
882 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
883 ! accuracy is basically set by the overlap, this sets an empirical shift
884 qs_control%eps_ppl = 1.0e-2_dp
885 !
886 qs_control%gapw_control%eps_cpc = value
887 ! expexted error in the density
888 qs_control%eps_rho_gspace = value
889 qs_control%eps_rho_rspace = value
890 ! error in the gradient, can be the sqrt of the error in the energy, ignored if map_consistent
891 qs_control%eps_gvg_rspace = tmpsqrt
892 !
893 CALL section_vals_val_get(qs_section, "EPS_CORE_CHARGE", n_rep_val=n_rep)
894 IF (n_rep /= 0) THEN
895 CALL section_vals_val_get(qs_section, "EPS_CORE_CHARGE", r_val=qs_control%eps_core_charge)
896 END IF
897 CALL section_vals_val_get(qs_section, "EPS_GVG_RSPACE", n_rep_val=n_rep)
898 IF (n_rep /= 0) THEN
899 CALL section_vals_val_get(qs_section, "EPS_GVG_RSPACE", r_val=qs_control%eps_gvg_rspace)
900 END IF
901 CALL section_vals_val_get(qs_section, "EPS_PGF_ORB", n_rep_val=n_rep)
902 IF (n_rep /= 0) THEN
903 CALL section_vals_val_get(qs_section, "EPS_PGF_ORB", r_val=qs_control%eps_pgf_orb)
904 END IF
905 CALL section_vals_val_get(qs_section, "EPS_KG_ORB", n_rep_val=n_rep)
906 IF (n_rep /= 0) THEN
907 CALL section_vals_val_get(qs_section, "EPS_KG_ORB", r_val=tmp)
908 qs_control%eps_kg_orb = sqrt(tmp)
909 END IF
910 CALL section_vals_val_get(qs_section, "EPS_PPL", n_rep_val=n_rep)
911 IF (n_rep /= 0) THEN
912 CALL section_vals_val_get(qs_section, "EPS_PPL", r_val=qs_control%eps_ppl)
913 END IF
914 CALL section_vals_val_get(qs_section, "EPS_PPNL", n_rep_val=n_rep)
915 IF (n_rep /= 0) THEN
916 CALL section_vals_val_get(qs_section, "EPS_PPNL", r_val=qs_control%eps_ppnl)
917 END IF
918 CALL section_vals_val_get(qs_section, "EPS_RHO", n_rep_val=n_rep)
919 IF (n_rep /= 0) THEN
920 CALL section_vals_val_get(qs_section, "EPS_RHO", r_val=qs_control%eps_rho_gspace)
921 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
922 END IF
923 CALL section_vals_val_get(qs_section, "EPS_RHO_RSPACE", n_rep_val=n_rep)
924 IF (n_rep /= 0) THEN
925 CALL section_vals_val_get(qs_section, "EPS_RHO_RSPACE", r_val=qs_control%eps_rho_rspace)
926 END IF
927 CALL section_vals_val_get(qs_section, "EPS_RHO_GSPACE", n_rep_val=n_rep)
928 IF (n_rep /= 0) THEN
929 CALL section_vals_val_get(qs_section, "EPS_RHO_GSPACE", r_val=qs_control%eps_rho_gspace)
930 END IF
931 CALL section_vals_val_get(qs_section, "EPS_FILTER_MATRIX", n_rep_val=n_rep)
932 IF (n_rep /= 0) THEN
933 CALL section_vals_val_get(qs_section, "EPS_FILTER_MATRIX", r_val=qs_control%eps_filter_matrix)
934 END IF
935 CALL section_vals_val_get(qs_section, "EPS_CPC", n_rep_val=n_rep)
936 IF (n_rep /= 0) THEN
937 CALL section_vals_val_get(qs_section, "EPS_CPC", r_val=qs_control%gapw_control%eps_cpc)
938 END IF
939
940 CALL section_vals_val_get(qs_section, "EPSFIT", r_val=qs_control%gapw_control%eps_fit)
941 CALL section_vals_val_get(qs_section, "EPSISO", r_val=qs_control%gapw_control%eps_iso)
942 CALL section_vals_val_get(qs_section, "EPSSVD", r_val=qs_control%gapw_control%eps_svd)
943 CALL section_vals_val_get(qs_section, "EPSRHO0", r_val=qs_control%gapw_control%eps_Vrho0)
944 CALL section_vals_val_get(qs_section, "ALPHA0_HARD", r_val=qs_control%gapw_control%alpha0_hard)
945 qs_control%gapw_control%alpha0_hard_from_input = .false.
946 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
947 CALL section_vals_val_get(qs_section, "FORCE_PAW", l_val=qs_control%gapw_control%force_paw)
948 CALL section_vals_val_get(qs_section, "MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
949
950 CALL section_vals_val_get(qs_section, "MIN_PAIR_LIST_RADIUS", r_val=qs_control%pairlist_radius)
951
952 CALL section_vals_val_get(qs_section, "LS_SCF", l_val=qs_control%do_ls_scf)
953 CALL section_vals_val_get(qs_section, "ALMO_SCF", l_val=qs_control%do_almo_scf)
954 CALL section_vals_val_get(qs_section, "KG_METHOD", l_val=qs_control%do_kg)
955
956 ! Logicals
957 CALL section_vals_val_get(qs_section, "REF_EMBED_SUBSYS", l_val=qs_control%ref_embed_subsys)
958 CALL section_vals_val_get(qs_section, "CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
959 CALL section_vals_val_get(qs_section, "HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
960 CALL section_vals_val_get(qs_section, "DFET_EMBEDDED", l_val=qs_control%dfet_embedded)
961 CALL section_vals_val_get(qs_section, "DMFET_EMBEDDED", l_val=qs_control%dmfet_embedded)
962
963 ! Integers gapw
964 CALL section_vals_val_get(qs_section, "LMAXN1", i_val=qs_control%gapw_control%lmax_sphere)
965 CALL section_vals_val_get(qs_section, "LMAXN0", i_val=qs_control%gapw_control%lmax_rho0)
966 CALL section_vals_val_get(qs_section, "LADDN0", i_val=qs_control%gapw_control%ladd_rho0)
967 CALL section_vals_val_get(qs_section, "QUADRATURE", i_val=qs_control%gapw_control%quadrature)
968 ! GAPW 1c basis
969 CALL section_vals_val_get(qs_section, "GAPW_1C_BASIS", i_val=qs_control%gapw_control%basis_1c)
970 IF (qs_control%gapw_control%basis_1c /= gapw_1c_orb) THEN
971 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
972 END IF
973
974 ! Integers grids
975 CALL section_vals_val_get(qs_section, "PW_GRID", i_val=itmp)
976 SELECT CASE (itmp)
978 qs_control%pw_grid_opt%spherical = .true.
979 qs_control%pw_grid_opt%fullspace = .false.
981 qs_control%pw_grid_opt%spherical = .false.
982 qs_control%pw_grid_opt%fullspace = .true.
984 qs_control%pw_grid_opt%spherical = .false.
985 qs_control%pw_grid_opt%fullspace = .false.
986 END SELECT
987
988 ! Method for PPL calculation
989 CALL section_vals_val_get(qs_section, "CORE_PPL", i_val=itmp)
990 qs_control%do_ppl_method = itmp
991
992 CALL section_vals_val_get(qs_section, "PW_GRID_LAYOUT", i_vals=tmplist)
993 qs_control%pw_grid_opt%distribution_layout = tmplist
994 CALL section_vals_val_get(qs_section, "PW_GRID_BLOCKED", i_val=qs_control%pw_grid_opt%blocked)
995
996 !Integers extrapolation
997 CALL section_vals_val_get(qs_section, "EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
998 CALL section_vals_val_get(qs_section, "EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
999
1000 !Method
1001 CALL section_vals_val_get(qs_section, "METHOD", i_val=qs_control%method_id)
1002 qs_control%gapw = .false.
1003 qs_control%gapw_xc = .false.
1004 qs_control%gpw = .false.
1005 qs_control%pao = .false.
1006 qs_control%dftb = .false.
1007 qs_control%xtb = .false.
1008 qs_control%semi_empirical = .false.
1009 qs_control%ofgpw = .false.
1010 qs_control%lrigpw = .false.
1011 qs_control%rigpw = .false.
1012 SELECT CASE (qs_control%method_id)
1013 CASE (do_method_gapw)
1014 CALL cite_reference(lippert1999)
1015 CALL cite_reference(krack2000)
1016 qs_control%gapw = .true.
1017 CASE (do_method_gapw_xc)
1018 qs_control%gapw_xc = .true.
1019 CASE (do_method_gpw)
1020 CALL cite_reference(lippert1997)
1021 CALL cite_reference(vandevondele2005a)
1022 qs_control%gpw = .true.
1023 CASE (do_method_ofgpw)
1024 qs_control%ofgpw = .true.
1025 CASE (do_method_lrigpw)
1026 qs_control%lrigpw = .true.
1027 CASE (do_method_rigpw)
1028 qs_control%rigpw = .true.
1029 CASE (do_method_dftb)
1030 qs_control%dftb = .true.
1031 CALL cite_reference(porezag1995)
1032 CALL cite_reference(seifert1996)
1033 CASE (do_method_xtb)
1034 qs_control%xtb = .true.
1035 CALL cite_reference(grimme2017)
1036 CALL cite_reference(pracht2019)
1037 CASE (do_method_mndo)
1038 CALL cite_reference(dewar1977)
1039 qs_control%semi_empirical = .true.
1040 CASE (do_method_am1)
1041 CALL cite_reference(dewar1985)
1042 qs_control%semi_empirical = .true.
1043 CASE (do_method_pm3)
1044 CALL cite_reference(stewart1989)
1045 qs_control%semi_empirical = .true.
1046 CASE (do_method_pnnl)
1047 CALL cite_reference(schenter2008)
1048 qs_control%semi_empirical = .true.
1049 CASE (do_method_pm6)
1050 CALL cite_reference(stewart2007)
1051 qs_control%semi_empirical = .true.
1052 CASE (do_method_pm6fm)
1053 CALL cite_reference(vanvoorhis2015)
1054 qs_control%semi_empirical = .true.
1055 CASE (do_method_pdg)
1056 CALL cite_reference(repasky2002)
1057 qs_control%semi_empirical = .true.
1058 CASE (do_method_rm1)
1059 CALL cite_reference(rocha2006)
1060 qs_control%semi_empirical = .true.
1061 CASE (do_method_mndod)
1062 CALL cite_reference(dewar1977)
1063 CALL cite_reference(thiel1992)
1064 qs_control%semi_empirical = .true.
1065 END SELECT
1066
1067 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1068
1069 IF (qs_control%mulliken_restraint) THEN
1070 CALL section_vals_val_get(mull_section, "STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1071 CALL section_vals_val_get(mull_section, "TARGET", r_val=qs_control%mulliken_restraint_control%target)
1072 CALL section_vals_val_get(mull_section, "ATOMS", n_rep_val=n_rep)
1073 jj = 0
1074 DO k = 1, n_rep
1075 CALL section_vals_val_get(mull_section, "ATOMS", i_rep_val=k, i_vals=tmplist)
1076 jj = jj + SIZE(tmplist)
1077 END DO
1078 qs_control%mulliken_restraint_control%natoms = jj
1079 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1080 cpabort("Need at least 1 atom to use mulliken constraints")
1081 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1082 jj = 0
1083 DO k = 1, n_rep
1084 CALL section_vals_val_get(mull_section, "ATOMS", i_rep_val=k, i_vals=tmplist)
1085 DO j = 1, SIZE(tmplist)
1086 jj = jj + 1
1087 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1088 END DO
1089 END DO
1090 END IF
1091 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1092 IF (qs_control%ddapc_restraint) THEN
1093 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1094 CALL read_ddapc_section(qs_control, qs_section=qs_section)
1095 qs_control%ddapc_restraint_is_spin = .false.
1096 qs_control%ddapc_explicit_potential = .false.
1097 END IF
1098
1099 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1100 IF (qs_control%s2_restraint) THEN
1101 CALL section_vals_val_get(s2_restraint_section, "STRENGTH", &
1102 r_val=qs_control%s2_restraint_control%strength)
1103 CALL section_vals_val_get(s2_restraint_section, "TARGET", &
1104 r_val=qs_control%s2_restraint_control%target)
1105 CALL section_vals_val_get(s2_restraint_section, "FUNCTIONAL_FORM", &
1106 i_val=qs_control%s2_restraint_control%functional_form)
1107 END IF
1108
1109 CALL section_vals_get(cdft_control_section, explicit=qs_control%cdft)
1110 IF (qs_control%cdft) THEN
1111 CALL read_cdft_control_section(qs_control, cdft_control_section)
1112 END IF
1113
1114 ! Semi-empirical code
1115 IF (qs_control%semi_empirical) THEN
1116 CALL section_vals_val_get(se_section, "ORTHOGONAL_BASIS", &
1117 l_val=qs_control%se_control%orthogonal_basis)
1118 CALL section_vals_val_get(se_section, "DELTA", &
1119 r_val=qs_control%se_control%delta)
1120 CALL section_vals_val_get(se_section, "ANALYTICAL_GRADIENTS", &
1121 l_val=qs_control%se_control%analytical_gradients)
1122 CALL section_vals_val_get(se_section, "FORCE_KDSO-D_EXCHANGE", &
1123 l_val=qs_control%se_control%force_kdsod_EX)
1124 ! Integral Screening
1125 CALL section_vals_val_get(se_section, "INTEGRAL_SCREENING", &
1126 i_val=qs_control%se_control%integral_screening)
1127 IF (qs_control%method_id == do_method_pnnl) THEN
1128 IF (qs_control%se_control%integral_screening /= do_se_is_slater) &
1129 CALL cp_warn(__location__, &
1130 "PNNL semi-empirical parameterization supports only the Slater type "// &
1131 "integral scheme. Revert to Slater and continue the calculation.")
1132 qs_control%se_control%integral_screening = do_se_is_slater
1133 END IF
1134 ! Global Arrays variable
1135 CALL section_vals_val_get(se_section, "GA%NCELLS", &
1136 i_val=qs_control%se_control%ga_ncells)
1137 ! Long-Range correction
1138 CALL section_vals_val_get(se_section, "LR_CORRECTION%CUTOFF", &
1139 r_val=qs_control%se_control%cutoff_lrc)
1140 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1141 CALL section_vals_val_get(se_section, "LR_CORRECTION%RC_TAPER", &
1142 explicit=explicit)
1143 IF (explicit) THEN
1144 CALL section_vals_val_get(se_section, "LR_CORRECTION%RC_TAPER", &
1145 r_val=qs_control%se_control%taper_lrc)
1146 END IF
1147 CALL section_vals_val_get(se_section, "LR_CORRECTION%RC_RANGE", &
1148 r_val=qs_control%se_control%range_lrc)
1149 ! Coulomb
1150 CALL section_vals_val_get(se_section, "COULOMB%CUTOFF", &
1151 r_val=qs_control%se_control%cutoff_cou)
1152 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1153 CALL section_vals_val_get(se_section, "COULOMB%RC_TAPER", &
1154 explicit=explicit)
1155 IF (explicit) THEN
1156 CALL section_vals_val_get(se_section, "COULOMB%RC_TAPER", &
1157 r_val=qs_control%se_control%taper_cou)
1158 END IF
1159 CALL section_vals_val_get(se_section, "COULOMB%RC_RANGE", &
1160 r_val=qs_control%se_control%range_cou)
1161 ! Exchange
1162 CALL section_vals_val_get(se_section, "EXCHANGE%CUTOFF", &
1163 r_val=qs_control%se_control%cutoff_exc)
1164 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1165 CALL section_vals_val_get(se_section, "EXCHANGE%RC_TAPER", &
1166 explicit=explicit)
1167 IF (explicit) THEN
1168 CALL section_vals_val_get(se_section, "EXCHANGE%RC_TAPER", &
1169 r_val=qs_control%se_control%taper_exc)
1170 END IF
1171 CALL section_vals_val_get(se_section, "EXCHANGE%RC_RANGE", &
1172 r_val=qs_control%se_control%range_exc)
1173 ! Screening (only if the integral scheme is of dumped type)
1174 IF (qs_control%se_control%integral_screening == do_se_is_kdso_d) THEN
1175 CALL section_vals_val_get(se_section, "SCREENING%RC_TAPER", &
1176 r_val=qs_control%se_control%taper_scr)
1177 CALL section_vals_val_get(se_section, "SCREENING%RC_RANGE", &
1178 r_val=qs_control%se_control%range_scr)
1179 END IF
1180 ! Periodic Type Calculation
1181 CALL section_vals_val_get(se_section, "PERIODIC", &
1182 i_val=qs_control%se_control%periodic_type)
1183 SELECT CASE (qs_control%se_control%periodic_type)
1184 CASE (do_se_lr_none)
1185 qs_control%se_control%do_ewald = .false.
1186 qs_control%se_control%do_ewald_r3 = .false.
1187 qs_control%se_control%do_ewald_gks = .false.
1188 CASE (do_se_lr_ewald)
1189 qs_control%se_control%do_ewald = .true.
1190 qs_control%se_control%do_ewald_r3 = .false.
1191 qs_control%se_control%do_ewald_gks = .false.
1192 CASE (do_se_lr_ewald_gks)
1193 qs_control%se_control%do_ewald = .false.
1194 qs_control%se_control%do_ewald_r3 = .false.
1195 qs_control%se_control%do_ewald_gks = .true.
1196 IF (qs_control%method_id /= do_method_pnnl) &
1197 CALL cp_abort(__location__, &
1198 "A periodic semi-empirical calculation was requested with a long-range "// &
1199 "summation on the single integral evaluation. This scheme is supported "// &
1200 "only by the PNNL parameterization.")
1201 CASE (do_se_lr_ewald_r3)
1202 qs_control%se_control%do_ewald = .true.
1203 qs_control%se_control%do_ewald_r3 = .true.
1204 qs_control%se_control%do_ewald_gks = .false.
1205 IF (qs_control%se_control%integral_screening /= do_se_is_kdso) &
1206 CALL cp_abort(__location__, &
1207 "A periodic semi-empirical calculation was requested with a long-range "// &
1208 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1209 "with the integral screening chosen. The only integral screening supported "// &
1210 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1211 END SELECT
1212
1213 ! dispersion pair potentials
1214 CALL section_vals_val_get(se_section, "DISPERSION", &
1215 l_val=qs_control%se_control%dispersion)
1216 CALL section_vals_val_get(se_section, "DISPERSION_RADIUS", &
1217 r_val=qs_control%se_control%rcdisp)
1218 CALL section_vals_val_get(se_section, "COORDINATION_CUTOFF", &
1219 r_val=qs_control%se_control%epscn)
1220 CALL section_vals_val_get(se_section, "D3_SCALING", r_vals=scal)
1221 qs_control%se_control%sd3(1) = scal(1)
1222 qs_control%se_control%sd3(2) = scal(2)
1223 qs_control%se_control%sd3(3) = scal(3)
1224 CALL section_vals_val_get(se_section, "DISPERSION_PARAMETER_FILE", &
1225 c_val=qs_control%se_control%dispersion_parameter_file)
1226
1227 ! Stop the execution for non-implemented features
1228 IF (qs_control%se_control%periodic_type == do_se_lr_ewald_r3) THEN
1229 cpabort("EWALD_R3 not implemented yet!")
1230 END IF
1231
1232 IF (qs_control%method_id == do_method_mndo .OR. &
1233 qs_control%method_id == do_method_am1 .OR. &
1234 qs_control%method_id == do_method_mndod .OR. &
1235 qs_control%method_id == do_method_pdg .OR. &
1236 qs_control%method_id == do_method_pm3 .OR. &
1237 qs_control%method_id == do_method_pm6 .OR. &
1238 qs_control%method_id == do_method_pm6fm .OR. &
1239 qs_control%method_id == do_method_pnnl .OR. &
1240 qs_control%method_id == do_method_rm1) THEN
1241 qs_control%se_control%orthogonal_basis = .true.
1242 END IF
1243 END IF
1244
1245 ! DFTB code
1246 IF (qs_control%dftb) THEN
1247 CALL section_vals_val_get(dftb_section, "ORTHOGONAL_BASIS", &
1248 l_val=qs_control%dftb_control%orthogonal_basis)
1249 CALL section_vals_val_get(dftb_section, "SELF_CONSISTENT", &
1250 l_val=qs_control%dftb_control%self_consistent)
1251 CALL section_vals_val_get(dftb_section, "DISPERSION", &
1252 l_val=qs_control%dftb_control%dispersion)
1253 CALL section_vals_val_get(dftb_section, "DIAGONAL_DFTB3", &
1254 l_val=qs_control%dftb_control%dftb3_diagonal)
1255 CALL section_vals_val_get(dftb_section, "HB_SR_GAMMA", &
1256 l_val=qs_control%dftb_control%hb_sr_damp)
1257 CALL section_vals_val_get(dftb_section, "EPS_DISP", &
1258 r_val=qs_control%dftb_control%eps_disp)
1259 CALL section_vals_val_get(dftb_section, "DO_EWALD", explicit=explicit)
1260 IF (explicit) THEN
1261 CALL section_vals_val_get(dftb_section, "DO_EWALD", &
1262 l_val=qs_control%dftb_control%do_ewald)
1263 ELSE
1264 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1265 END IF
1266 CALL section_vals_val_get(dftb_parameter, "PARAM_FILE_PATH", &
1267 c_val=qs_control%dftb_control%sk_file_path)
1268 CALL section_vals_val_get(dftb_parameter, "PARAM_FILE_NAME", &
1269 c_val=qs_control%dftb_control%sk_file_list)
1270 CALL section_vals_val_get(dftb_parameter, "HB_SR_PARAM", &
1271 r_val=qs_control%dftb_control%hb_sr_para)
1272 CALL section_vals_val_get(dftb_parameter, "SK_FILE", n_rep_val=n_var)
1273 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1274 DO k = 1, n_var
1275 CALL section_vals_val_get(dftb_parameter, "SK_FILE", i_rep_val=k, &
1276 c_vals=clist)
1277 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1278 END DO
1279 ! Dispersion type
1280 CALL section_vals_val_get(dftb_parameter, "DISPERSION_TYPE", &
1281 i_val=qs_control%dftb_control%dispersion_type)
1282 CALL section_vals_val_get(dftb_parameter, "UFF_FORCE_FIELD", &
1283 c_val=qs_control%dftb_control%uff_force_field)
1284 ! D3 Dispersion
1285 CALL section_vals_val_get(dftb_parameter, "DISPERSION_RADIUS", &
1286 r_val=qs_control%dftb_control%rcdisp)
1287 CALL section_vals_val_get(dftb_parameter, "COORDINATION_CUTOFF", &
1288 r_val=qs_control%dftb_control%epscn)
1289 CALL section_vals_val_get(dftb_parameter, "D2_EXP_PRE", &
1290 r_val=qs_control%dftb_control%exp_pre)
1291 CALL section_vals_val_get(dftb_parameter, "D2_SCALING", &
1292 r_val=qs_control%dftb_control%scaling)
1293 CALL section_vals_val_get(dftb_parameter, "D3_SCALING", r_vals=scal)
1294 qs_control%dftb_control%sd3(1) = scal(1)
1295 qs_control%dftb_control%sd3(2) = scal(2)
1296 qs_control%dftb_control%sd3(3) = scal(3)
1297 CALL section_vals_val_get(dftb_parameter, "D3BJ_SCALING", r_vals=scal)
1298 qs_control%dftb_control%sd3bj(1) = scal(1)
1299 qs_control%dftb_control%sd3bj(2) = scal(2)
1300 qs_control%dftb_control%sd3bj(3) = scal(3)
1301 qs_control%dftb_control%sd3bj(4) = scal(4)
1302 CALL section_vals_val_get(dftb_parameter, "DISPERSION_PARAMETER_FILE", &
1303 c_val=qs_control%dftb_control%dispersion_parameter_file)
1304
1305 IF (qs_control%dftb_control%dispersion) CALL cite_reference(zhechkov2005)
1306 IF (qs_control%dftb_control%self_consistent) CALL cite_reference(elstner1998)
1307 IF (qs_control%dftb_control%hb_sr_damp) CALL cite_reference(hu2007)
1308 END IF
1309
1310 ! xTB code
1311 IF (qs_control%xtb) THEN
1312 CALL section_vals_val_get(xtb_section, "GFN_TYPE", i_val=qs_control%xtb_control%gfn_type)
1313 CALL section_vals_val_get(xtb_section, "DO_EWALD", explicit=explicit)
1314 IF (explicit) THEN
1315 CALL section_vals_val_get(xtb_section, "DO_EWALD", &
1316 l_val=qs_control%xtb_control%do_ewald)
1317 ELSE
1318 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1319 END IF
1320 ! vdW
1321 CALL section_vals_val_get(xtb_section, "VDW_POTENTIAL", explicit=explicit)
1322 IF (explicit) THEN
1323 CALL section_vals_val_get(xtb_section, "VDW_POTENTIAL", c_val=cval)
1324 CALL uppercase(cval)
1325 SELECT CASE (cval)
1326 CASE ("NONE")
1327 qs_control%xtb_control%vdw_type = xtb_vdw_type_none
1328 CASE ("DFTD3")
1329 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1330 CASE ("DFTD4")
1331 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1332 CASE DEFAULT
1333 cpabort("vdW type")
1334 END SELECT
1335 ELSE
1336 SELECT CASE (qs_control%xtb_control%gfn_type)
1337 CASE (0)
1338 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1339 CASE (1)
1340 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1341 CASE (2)
1342 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1343 cpabort("gfn2-xtb tbd")
1344 CASE DEFAULT
1345 cpabort("GFN type")
1346 END SELECT
1347 END IF
1348 !
1349 CALL section_vals_val_get(xtb_section, "STO_NG", i_val=ngauss)
1350 qs_control%xtb_control%sto_ng = ngauss
1351 CALL section_vals_val_get(xtb_section, "HYDROGEN_STO_NG", i_val=ngauss)
1352 qs_control%xtb_control%h_sto_ng = ngauss
1353 CALL section_vals_val_get(xtb_parameter, "PARAM_FILE_PATH", &
1354 c_val=qs_control%xtb_control%parameter_file_path)
1355 CALL section_vals_val_get(xtb_parameter, "PARAM_FILE_NAME", explicit=explicit)
1356 IF (explicit) THEN
1357 CALL section_vals_val_get(xtb_parameter, "PARAM_FILE_NAME", &
1358 c_val=qs_control%xtb_control%parameter_file_name)
1359 ELSE
1360 SELECT CASE (qs_control%xtb_control%gfn_type)
1361 CASE (0)
1362 qs_control%xtb_control%parameter_file_name = "xTB0_parameters"
1363 CASE (1)
1364 qs_control%xtb_control%parameter_file_name = "xTB1_parameters"
1365 CASE (2)
1366 cpabort("gfn2-xtb tbd")
1367 CASE DEFAULT
1368 cpabort("GFN type")
1369 END SELECT
1370 END IF
1371 ! D3 Dispersion
1372 CALL section_vals_val_get(xtb_parameter, "DISPERSION_RADIUS", &
1373 r_val=qs_control%xtb_control%rcdisp)
1374 CALL section_vals_val_get(xtb_parameter, "COORDINATION_CUTOFF", &
1375 r_val=qs_control%xtb_control%epscn)
1376 CALL section_vals_val_get(xtb_parameter, "D3BJ_SCALING", explicit=explicit)
1377 IF (explicit) THEN
1378 CALL section_vals_val_get(xtb_parameter, "D3BJ_SCALING", r_vals=scal)
1379 qs_control%xtb_control%s6 = scal(1)
1380 qs_control%xtb_control%s8 = scal(2)
1381 ELSE
1382 SELECT CASE (qs_control%xtb_control%gfn_type)
1383 CASE (0)
1384 qs_control%xtb_control%s6 = 1.00_dp
1385 qs_control%xtb_control%s8 = 2.85_dp
1386 CASE (1)
1387 qs_control%xtb_control%s6 = 1.00_dp
1388 qs_control%xtb_control%s8 = 2.40_dp
1389 CASE (2)
1390 cpabort("gfn2-xtb tbd")
1391 CASE DEFAULT
1392 cpabort("GFN type")
1393 END SELECT
1394 END IF
1395 CALL section_vals_val_get(xtb_parameter, "D3BJ_PARAM", explicit=explicit)
1396 IF (explicit) THEN
1397 CALL section_vals_val_get(xtb_parameter, "D3BJ_PARAM", r_vals=scal)
1398 qs_control%xtb_control%a1 = scal(1)
1399 qs_control%xtb_control%a2 = scal(2)
1400 ELSE
1401 SELECT CASE (qs_control%xtb_control%gfn_type)
1402 CASE (0)
1403 qs_control%xtb_control%a1 = 0.80_dp
1404 qs_control%xtb_control%a2 = 4.60_dp
1405 CASE (1)
1406 qs_control%xtb_control%a1 = 0.63_dp
1407 qs_control%xtb_control%a2 = 5.00_dp
1408 CASE (2)
1409 cpabort("gfn2-xtb tbd")
1410 CASE DEFAULT
1411 cpabort("GFN type")
1412 END SELECT
1413 END IF
1414 CALL section_vals_val_get(xtb_parameter, "DISPERSION_PARAMETER_FILE", &
1415 c_val=qs_control%xtb_control%dispersion_parameter_file)
1416 ! global parameters
1417 CALL section_vals_val_get(xtb_parameter, "HUCKEL_CONSTANTS", explicit=explicit)
1418 IF (explicit) THEN
1419 CALL section_vals_val_get(xtb_parameter, "HUCKEL_CONSTANTS", r_vals=scal)
1420 qs_control%xtb_control%ks = scal(1)
1421 qs_control%xtb_control%kp = scal(2)
1422 qs_control%xtb_control%kd = scal(3)
1423 qs_control%xtb_control%ksp = scal(4)
1424 qs_control%xtb_control%k2sh = scal(5)
1425 IF (qs_control%xtb_control%gfn_type == 0) THEN
1426 ! enforce ksp for gfn0
1427 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1428 END IF
1429 ELSE
1430 SELECT CASE (qs_control%xtb_control%gfn_type)
1431 CASE (0)
1432 qs_control%xtb_control%ks = 2.00_dp
1433 qs_control%xtb_control%kp = 2.4868_dp
1434 qs_control%xtb_control%kd = 2.27_dp
1435 qs_control%xtb_control%ksp = 2.2434_dp
1436 qs_control%xtb_control%k2sh = 1.1241_dp
1437 CASE (1)
1438 qs_control%xtb_control%ks = 1.85_dp
1439 qs_control%xtb_control%kp = 2.25_dp
1440 qs_control%xtb_control%kd = 2.00_dp
1441 qs_control%xtb_control%ksp = 2.08_dp
1442 qs_control%xtb_control%k2sh = 2.85_dp
1443 CASE (2)
1444 cpabort("gfn2-xtb tbd")
1445 CASE DEFAULT
1446 cpabort("GFN type")
1447 END SELECT
1448 END IF
1449 CALL section_vals_val_get(xtb_parameter, "COULOMB_CONSTANTS", explicit=explicit)
1450 IF (explicit) THEN
1451 CALL section_vals_val_get(xtb_parameter, "COULOMB_CONSTANTS", r_vals=scal)
1452 qs_control%xtb_control%kg = scal(1)
1453 qs_control%xtb_control%kf = scal(2)
1454 ELSE
1455 SELECT CASE (qs_control%xtb_control%gfn_type)
1456 CASE (0)
1457 qs_control%xtb_control%kg = 2.00_dp
1458 qs_control%xtb_control%kf = 1.50_dp
1459 CASE (1)
1460 qs_control%xtb_control%kg = 2.00_dp
1461 qs_control%xtb_control%kf = 1.50_dp
1462 CASE (2)
1463 cpabort("gfn2-xtb tbd")
1464 CASE DEFAULT
1465 cpabort("GFN type")
1466 END SELECT
1467 END IF
1468 CALL section_vals_val_get(xtb_parameter, "CN_CONSTANTS", r_vals=scal)
1469 qs_control%xtb_control%kcns = scal(1)
1470 qs_control%xtb_control%kcnp = scal(2)
1471 qs_control%xtb_control%kcnd = scal(3)
1472 !
1473 CALL section_vals_val_get(xtb_parameter, "EN_CONSTANTS", explicit=explicit)
1474 IF (explicit) THEN
1475 CALL section_vals_val_get(xtb_parameter, "EN_CONSTANTS", r_vals=scal)
1476 SELECT CASE (qs_control%xtb_control%gfn_type)
1477 CASE (0)
1478 qs_control%xtb_control%ksen = scal(1)
1479 qs_control%xtb_control%kpen = scal(2)
1480 qs_control%xtb_control%kden = scal(3)
1481 CASE (1)
1482 qs_control%xtb_control%ken = scal(1)
1483 CASE (2)
1484 cpabort("gfn2-xtb tbd")
1485 CASE DEFAULT
1486 cpabort("GFN type")
1487 END SELECT
1488 ELSE
1489 SELECT CASE (qs_control%xtb_control%gfn_type)
1490 CASE (0)
1491 qs_control%xtb_control%ksen = 0.006_dp
1492 qs_control%xtb_control%kpen = -0.001_dp
1493 qs_control%xtb_control%kden = -0.002_dp
1494 CASE (1)
1495 qs_control%xtb_control%ken = -0.007_dp
1496 CASE (2)
1497 cpabort("gfn2-xtb tbd")
1498 CASE DEFAULT
1499 cpabort("GFN type")
1500 END SELECT
1501 END IF
1502 ! ben
1503 CALL section_vals_val_get(xtb_parameter, "BEN_CONSTANT", r_vals=scal)
1504 qs_control%xtb_control%ben = scal(1)
1505 ! enscale (hidden parameter in repulsion
1506 CALL section_vals_val_get(xtb_parameter, "ENSCALE", explicit=explicit)
1507 IF (explicit) THEN
1508 CALL section_vals_val_get(xtb_parameter, "ENSCALE", &
1509 r_val=qs_control%xtb_control%enscale)
1510 ELSE
1511 SELECT CASE (qs_control%xtb_control%gfn_type)
1512 CASE (0)
1513 qs_control%xtb_control%enscale = -0.09_dp
1514 CASE (1)
1515 qs_control%xtb_control%enscale = 0._dp
1516 CASE (2)
1517 cpabort("gfn2-xtb tbd")
1518 CASE DEFAULT
1519 cpabort("GFN type")
1520 END SELECT
1521 END IF
1522 ! XB
1523 CALL section_vals_val_get(xtb_section, "USE_HALOGEN_CORRECTION", &
1524 l_val=qs_control%xtb_control%xb_interaction)
1525 CALL section_vals_val_get(xtb_parameter, "HALOGEN_BINDING", r_vals=scal)
1526 qs_control%xtb_control%kxr = scal(1)
1527 qs_control%xtb_control%kx2 = scal(2)
1528 ! NONBONDED interactions
1529 CALL section_vals_val_get(xtb_section, "DO_NONBONDED", &
1530 l_val=qs_control%xtb_control%do_nonbonded)
1531 CALL section_vals_get(nonbonded_section, explicit=explicit)
1532 IF (explicit .AND. qs_control%xtb_control%do_nonbonded) THEN
1533 CALL section_vals_get(genpot_section, explicit=explicit, n_repetition=ngp)
1534 IF (explicit) THEN
1535 CALL pair_potential_reallocate(qs_control%xtb_control%nonbonded, 1, ngp, gp=.true.)
1536 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1537 END IF
1538 END IF !nonbonded
1539 CALL section_vals_val_get(xtb_section, "EPS_PAIRPOTENTIAL", &
1540 r_val=qs_control%xtb_control%eps_pair)
1541 ! SR Coulomb
1542 CALL section_vals_val_get(xtb_parameter, "COULOMB_SR_CUT", r_vals=scal)
1543 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1544 CALL section_vals_val_get(xtb_parameter, "COULOMB_SR_EPS", r_vals=scal)
1545 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1546 ! XB_radius
1547 CALL section_vals_val_get(xtb_parameter, "XB_RADIUS", r_val=qs_control%xtb_control%xb_radius)
1548 ! Kab
1549 CALL section_vals_val_get(xtb_parameter, "KAB_PARAM", n_rep_val=n_rep)
1550 ! Coulomb
1551 SELECT CASE (qs_control%xtb_control%gfn_type)
1552 CASE (0)
1553 qs_control%xtb_control%coulomb_interaction = .false.
1554 qs_control%xtb_control%coulomb_lr = .false.
1555 qs_control%xtb_control%tb3_interaction = .false.
1556 qs_control%xtb_control%check_atomic_charges = .false.
1557 CALL section_vals_val_get(xtb_section, "VARIATIONAL_DIPOLE", &
1558 l_val=qs_control%xtb_control%var_dipole)
1559 CASE (1)
1560 ! For debugging purposes
1561 CALL section_vals_val_get(xtb_section, "COULOMB_INTERACTION", &
1562 l_val=qs_control%xtb_control%coulomb_interaction)
1563 CALL section_vals_val_get(xtb_section, "COULOMB_LR", &
1564 l_val=qs_control%xtb_control%coulomb_lr)
1565 CALL section_vals_val_get(xtb_section, "TB3_INTERACTION", &
1566 l_val=qs_control%xtb_control%tb3_interaction)
1567 ! Check for bad atomic charges
1568 CALL section_vals_val_get(xtb_section, "CHECK_ATOMIC_CHARGES", &
1569 l_val=qs_control%xtb_control%check_atomic_charges)
1570 qs_control%xtb_control%var_dipole = .false.
1571 CASE (2)
1572 cpabort("gfn2-xtb tbd")
1573 CASE DEFAULT
1574 cpabort("GFN type")
1575 END SELECT
1576 qs_control%xtb_control%kab_nval = n_rep
1577 IF (n_rep > 0) THEN
1578 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1579 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1580 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1581 DO j = 1, n_rep
1582 CALL section_vals_val_get(xtb_parameter, "KAB_PARAM", i_rep_val=j, c_vals=clist)
1583 qs_control%xtb_control%kab_param(1, j) = clist(1)
1584 CALL get_ptable_info(clist(1), &
1585 ielement=qs_control%xtb_control%kab_types(1, j))
1586 qs_control%xtb_control%kab_param(2, j) = clist(2)
1587 CALL get_ptable_info(clist(2), &
1588 ielement=qs_control%xtb_control%kab_types(2, j))
1589 qs_control%xtb_control%kab_param(3, j) = clist(3)
1590 READ (clist(3), '(F10.0)') qs_control%xtb_control%kab_vals(j)
1591 END DO
1592 END IF
1593
1594 IF (qs_control%xtb_control%gfn_type == 0) THEN
1595 CALL section_vals_val_get(xtb_parameter, "SRB_PARAMETER", r_vals=scal)
1596 qs_control%xtb_control%ksrb = scal(1)
1597 qs_control%xtb_control%esrb = scal(2)
1598 qs_control%xtb_control%gscal = scal(3)
1599 qs_control%xtb_control%c1srb = scal(4)
1600 qs_control%xtb_control%c2srb = scal(5)
1601 qs_control%xtb_control%shift = scal(6)
1602 END IF
1603
1604 CALL section_vals_val_get(xtb_section, "EN_SHIFT_TYPE", c_val=cval)
1605 CALL uppercase(cval)
1606 SELECT CASE (trim(cval))
1607 CASE ("SELECT")
1608 qs_control%xtb_control%enshift_type = 0
1609 CASE ("MOLECULE")
1610 qs_control%xtb_control%enshift_type = 1
1611 CASE ("CRYSTAL")
1612 qs_control%xtb_control%enshift_type = 2
1613 CASE DEFAULT
1614 cpabort("Unknown value for EN_SHIFT_TYPE")
1615 END SELECT
1616
1617 ! EEQ solver params
1618 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1619
1620 END IF
1621
1622 ! Optimize LRI basis set
1623 CALL section_vals_get(lri_optbas_section, explicit=qs_control%lri_optbas)
1624
1625 ! Use instead the tblite
1626 CALL section_vals_val_get(xtb_tblite, "_SECTION_PARAMETERS_", &
1627 l_val=qs_control%xtb_control%do_tblite)
1628 CALL section_vals_val_get(xtb_tblite, "METHOD", &
1629 i_val=qs_control%xtb_control%tblite_method)
1630 IF (qs_control%xtb_control%do_tblite) THEN
1631 CALL cite_reference(caldeweyher2017)
1632 CALL cite_reference(caldeweyher2020)
1633 CALL cite_reference(asgeirsson2017)
1634 CALL cite_reference(grimme2017)
1635 CALL cite_reference(bannwarth2019)
1636 !Ewald sum included in tblite
1637 qs_control%xtb_control%do_ewald = .false.
1638 END IF
1639
1640 CALL timestop(handle)
1641 END SUBROUTINE read_qs_section
1642
1643! **************************************************************************************************
1644!> \brief Read TDDFPT-related input parameters.
1645!> \param t_control TDDFPT control parameters
1646!> \param t_section TDDFPT input section
1647!> \param qs_control Quickstep control parameters
1648! **************************************************************************************************
1649 SUBROUTINE read_tddfpt2_control(t_control, t_section, qs_control)
1650 TYPE(tddfpt2_control_type), POINTER :: t_control
1651 TYPE(section_vals_type), POINTER :: t_section
1652 TYPE(qs_control_type), POINTER :: qs_control
1653
1654 CHARACTER(LEN=*), PARAMETER :: routinen = 'read_tddfpt2_control'
1655
1656 CHARACTER(LEN=default_string_length), &
1657 DIMENSION(:), POINTER :: tmpstringlist
1658 INTEGER :: handle, irep, isize, nrep
1659 INTEGER, ALLOCATABLE, DIMENSION(:) :: inds
1660 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1661 multigrid_set
1662 REAL(kind=dp) :: filter, fval, hfx
1663 TYPE(section_vals_type), POINTER :: dipole_section, mgrid_section, &
1664 soc_section, stda_section, xc_func, &
1665 xc_section
1666
1667 CALL timeset(routinen, handle)
1668
1669 CALL section_vals_val_get(t_section, "_SECTION_PARAMETERS_", l_val=t_control%enabled)
1670
1671 CALL section_vals_val_get(t_section, "NSTATES", i_val=t_control%nstates)
1672 CALL section_vals_val_get(t_section, "MAX_ITER", i_val=t_control%niters)
1673 CALL section_vals_val_get(t_section, "MAX_KV", i_val=t_control%nkvs)
1674 CALL section_vals_val_get(t_section, "NLUMO", i_val=t_control%nlumo)
1675 CALL section_vals_val_get(t_section, "NPROC_STATE", i_val=t_control%nprocs)
1676 CALL section_vals_val_get(t_section, "KERNEL", i_val=t_control%kernel)
1677 CALL section_vals_val_get(t_section, "SPINFLIP", i_val=t_control%spinflip)
1678 CALL section_vals_val_get(t_section, "OE_CORR", i_val=t_control%oe_corr)
1679 CALL section_vals_val_get(t_section, "EV_SHIFT", r_val=t_control%ev_shift)
1680 CALL section_vals_val_get(t_section, "EOS_SHIFT", r_val=t_control%eos_shift)
1681
1682 CALL section_vals_val_get(t_section, "CONVERGENCE", r_val=t_control%conv)
1683 CALL section_vals_val_get(t_section, "MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
1684 CALL section_vals_val_get(t_section, "ORTHOGONAL_EPS", r_val=t_control%orthogonal_eps)
1685
1686 CALL section_vals_val_get(t_section, "RESTART", l_val=t_control%is_restart)
1687 CALL section_vals_val_get(t_section, "RKS_TRIPLETS", l_val=t_control%rks_triplets)
1688 CALL section_vals_val_get(t_section, "DO_LRIGPW", l_val=t_control%do_lrigpw)
1689 CALL section_vals_val_get(t_section, "DO_SMEARING", l_val=t_control%do_smearing)
1690 CALL section_vals_val_get(t_section, "DO_BSE", l_val=t_control%do_bse)
1691 CALL section_vals_val_get(t_section, "ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1692 CALL section_vals_val_get(t_section, "ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1693 CALL section_vals_val_get(t_section, "EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
1694 CALL section_vals_val_get(t_section, "DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
1695
1696 ! read automatically generated auxiliary basis for LRI
1697 CALL section_vals_val_get(t_section, "AUTO_BASIS", n_rep_val=nrep)
1698 DO irep = 1, nrep
1699 CALL section_vals_val_get(t_section, "AUTO_BASIS", i_rep_val=irep, c_vals=tmpstringlist)
1700 IF (SIZE(tmpstringlist) == 2) THEN
1701 CALL uppercase(tmpstringlist(2))
1702 SELECT CASE (tmpstringlist(2))
1703 CASE ("X")
1704 isize = -1
1705 CASE ("SMALL")
1706 isize = 0
1707 CASE ("MEDIUM")
1708 isize = 1
1709 CASE ("LARGE")
1710 isize = 2
1711 CASE ("HUGE")
1712 isize = 3
1713 CASE DEFAULT
1714 cpabort("Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1715 END SELECT
1716 !
1717 SELECT CASE (tmpstringlist(1))
1718 CASE ("X")
1719 CASE ("P_LRI_AUX")
1720 t_control%auto_basis_p_lri_aux = isize
1721 CASE DEFAULT
1722 cpabort("Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1723 END SELECT
1724 ELSE
1725 CALL cp_abort(__location__, &
1726 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1727 END IF
1728 END DO
1729
1730 IF (t_control%conv < 0) &
1731 t_control%conv = abs(t_control%conv)
1732
1733 ! DIPOLE_MOMENTS subsection
1734 dipole_section => section_vals_get_subs_vals(t_section, "DIPOLE_MOMENTS")
1735 CALL section_vals_val_get(dipole_section, "DIPOLE_FORM", explicit=explicit)
1736 IF (explicit) THEN
1737 CALL section_vals_val_get(dipole_section, "DIPOLE_FORM", i_val=t_control%dipole_form)
1738 ELSE
1739 t_control%dipole_form = 0
1740 END IF
1741 CALL section_vals_val_get(dipole_section, "REFERENCE", i_val=t_control%dipole_reference)
1742 CALL section_vals_val_get(dipole_section, "REFERENCE_POINT", explicit=explicit)
1743 IF (explicit) THEN
1744 CALL section_vals_val_get(dipole_section, "REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1745 ELSE
1746 NULLIFY (t_control%dipole_ref_point)
1747 IF (t_control%dipole_form == tddfpt_dipole_length .AND. t_control%dipole_reference == use_mom_ref_user) THEN
1748 cpabort("User-defined reference point should be given explicitly")
1749 END IF
1750 END IF
1751
1752 !SOC subsection
1753 soc_section => section_vals_get_subs_vals(t_section, "SOC")
1754 CALL section_vals_get(soc_section, explicit=explicit)
1755 IF (explicit) THEN
1756 t_control%do_soc = .true.
1757 END IF
1758
1759 ! MGRID subsection
1760 mgrid_section => section_vals_get_subs_vals(t_section, "MGRID")
1761 CALL section_vals_get(mgrid_section, explicit=t_control%mgrid_is_explicit)
1762
1763 IF (t_control%mgrid_is_explicit) THEN
1764 CALL section_vals_val_get(mgrid_section, "NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1765 IF (.NOT. explicit) t_control%mgrid_ngrids = SIZE(qs_control%e_cutoff)
1766
1767 CALL section_vals_val_get(mgrid_section, "CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1768 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1769
1770 CALL section_vals_val_get(mgrid_section, "PROGRESSION_FACTOR", &
1771 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1772 IF (explicit) THEN
1773 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1774 CALL cp_abort(__location__, &
1775 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1776 ELSE
1777 t_control%mgrid_progression_factor = qs_control%progression_factor
1778 END IF
1779
1780 CALL section_vals_val_get(mgrid_section, "COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1781 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1782 IF (t_control%mgrid_commensurate_mgrids) THEN
1783 IF (explicit) THEN
1784 t_control%mgrid_progression_factor = 4.0_dp
1785 ELSE
1786 t_control%mgrid_progression_factor = qs_control%progression_factor
1787 END IF
1788 END IF
1789
1790 CALL section_vals_val_get(mgrid_section, "REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1791 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1792
1793 CALL section_vals_val_get(mgrid_section, "MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1794 IF (.NOT. explicit) multigrid_set = .false.
1795 IF (multigrid_set) THEN
1796 CALL section_vals_val_get(mgrid_section, "MULTIGRID_CUTOFF", r_vals=t_control%mgrid_e_cutoff)
1797 ELSE
1798 NULLIFY (t_control%mgrid_e_cutoff)
1799 END IF
1800
1801 CALL section_vals_val_get(mgrid_section, "REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1802 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1803
1804 CALL section_vals_val_get(mgrid_section, "SKIP_LOAD_BALANCE_DISTRIBUTED", &
1805 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1806 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1807
1808 IF (ASSOCIATED(t_control%mgrid_e_cutoff)) THEN
1809 IF (SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1810 cpabort("Inconsistent values for number of multi-grids")
1811
1812 ! sort multi-grids in descending order according to their cutoff values
1813 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1814 ALLOCATE (inds(t_control%mgrid_ngrids))
1815 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1816 DEALLOCATE (inds)
1817 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1818 END IF
1819 END IF
1820
1821 ! expand XC subsection (if given explicitly)
1822 xc_section => section_vals_get_subs_vals(t_section, "XC")
1823 xc_func => section_vals_get_subs_vals(xc_section, "XC_FUNCTIONAL")
1824 CALL section_vals_get(xc_func, explicit=explicit)
1825 IF (explicit) &
1826 CALL xc_functionals_expand(xc_func, xc_section)
1827
1828 ! sTDA subsection
1829 stda_section => section_vals_get_subs_vals(t_section, "STDA")
1830 IF (t_control%kernel == tddfpt_kernel_stda) THEN
1831 t_control%stda_control%hfx_fraction = 0.0_dp
1832 t_control%stda_control%do_exchange = .true.
1833 t_control%stda_control%eps_td_filter = 1.e-10_dp
1834 t_control%stda_control%mn_alpha = -99.0_dp
1835 t_control%stda_control%mn_beta = -99.0_dp
1836 ! set default for Ewald method (on/off) dependent on periodicity
1837 SELECT CASE (qs_control%periodicity)
1838 CASE (0)
1839 t_control%stda_control%do_ewald = .false.
1840 CASE (1)
1841 t_control%stda_control%do_ewald = .true.
1842 CASE (2)
1843 t_control%stda_control%do_ewald = .true.
1844 CASE (3)
1845 t_control%stda_control%do_ewald = .true.
1846 CASE DEFAULT
1847 cpabort("Illegal value for periodiciy")
1848 END SELECT
1849 CALL section_vals_get(stda_section, explicit=explicit)
1850 IF (explicit) THEN
1851 CALL section_vals_val_get(stda_section, "HFX_FRACTION", r_val=hfx, explicit=expl)
1852 IF (expl) t_control%stda_control%hfx_fraction = hfx
1853 CALL section_vals_val_get(stda_section, "EPS_TD_FILTER", r_val=filter, explicit=expl)
1854 IF (expl) t_control%stda_control%eps_td_filter = filter
1855 CALL section_vals_val_get(stda_section, "DO_EWALD", l_val=do_ewald, explicit=expl)
1856 IF (expl) t_control%stda_control%do_ewald = do_ewald
1857 CALL section_vals_val_get(stda_section, "DO_EXCHANGE", l_val=do_exchange, explicit=expl)
1858 IF (expl) t_control%stda_control%do_exchange = do_exchange
1859 CALL section_vals_val_get(stda_section, "MATAGA_NISHIMOTO_CEXP", r_val=fval)
1860 t_control%stda_control%mn_alpha = fval
1861 CALL section_vals_val_get(stda_section, "MATAGA_NISHIMOTO_XEXP", r_val=fval)
1862 t_control%stda_control%mn_beta = fval
1863 END IF
1864 CALL section_vals_val_get(stda_section, "COULOMB_SR_CUT", r_val=fval)
1865 t_control%stda_control%coulomb_sr_cut = fval
1866 CALL section_vals_val_get(stda_section, "COULOMB_SR_EPS", r_val=fval)
1867 t_control%stda_control%coulomb_sr_eps = fval
1868 END IF
1869
1870 CALL timestop(handle)
1871 END SUBROUTINE read_tddfpt2_control
1872
1873! **************************************************************************************************
1874!> \brief Write the DFT control parameters to the output unit.
1875!> \param dft_control ...
1876!> \param dft_section ...
1877! **************************************************************************************************
1878 SUBROUTINE write_dft_control(dft_control, dft_section)
1879 TYPE(dft_control_type), POINTER :: dft_control
1880 TYPE(section_vals_type), POINTER :: dft_section
1881
1882 CHARACTER(len=*), PARAMETER :: routinen = 'write_dft_control'
1883
1884 CHARACTER(LEN=20) :: tmpstr
1885 INTEGER :: handle, i, i_rep, n_rep, output_unit
1886 REAL(kind=dp) :: density_cut, density_smooth_cut_range, &
1887 gradient_cut, tau_cut
1888 TYPE(cp_logger_type), POINTER :: logger
1889 TYPE(enumeration_type), POINTER :: enum
1890 TYPE(keyword_type), POINTER :: keyword
1891 TYPE(section_type), POINTER :: section
1892 TYPE(section_vals_type), POINTER :: xc_section
1893
1894 IF (dft_control%qs_control%semi_empirical) RETURN
1895 IF (dft_control%qs_control%dftb) RETURN
1896 IF (dft_control%qs_control%xtb) THEN
1897 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1898 RETURN
1899 END IF
1900 CALL timeset(routinen, handle)
1901
1902 NULLIFY (logger)
1903 logger => cp_get_default_logger()
1904
1905 output_unit = cp_print_key_unit_nr(logger, dft_section, &
1906 "PRINT%DFT_CONTROL_PARAMETERS", extension=".Log")
1907
1908 IF (output_unit > 0) THEN
1909
1910 xc_section => section_vals_get_subs_vals(dft_section, "XC")
1911
1912 IF (dft_control%uks) THEN
1913 WRITE (unit=output_unit, fmt="(/,T2,A,T78,A)") &
1914 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation", "UKS"
1915 ELSE IF (dft_control%roks) THEN
1916 WRITE (unit=output_unit, fmt="(/,T2,A,T77,A)") &
1917 "DFT| Spin restricted open Kohn-Sham calculation", "ROKS"
1918 ELSE
1919 WRITE (unit=output_unit, fmt="(/,T2,A,T78,A)") &
1920 "DFT| Spin restricted Kohn-Sham (RKS) calculation", "RKS"
1921 END IF
1922
1923 WRITE (unit=output_unit, fmt="(T2,A,T76,I5)") &
1924 "DFT| Multiplicity", dft_control%multiplicity
1925 WRITE (unit=output_unit, fmt="(T2,A,T76,I5)") &
1926 "DFT| Number of spin states", dft_control%nspins
1927
1928 WRITE (unit=output_unit, fmt="(T2,A,T76,I5)") &
1929 "DFT| Charge", dft_control%charge
1930
1931 IF (dft_control%sic_method_id .NE. sic_none) CALL cite_reference(vandevondele2005b)
1932 SELECT CASE (dft_control%sic_method_id)
1933 CASE (sic_none)
1934 tmpstr = "NO"
1935 CASE (sic_mauri_spz)
1936 tmpstr = "SPZ/MAURI SIC"
1937 CASE (sic_mauri_us)
1938 tmpstr = "US/MAURI SIC"
1939 CASE (sic_ad)
1940 tmpstr = "AD SIC"
1941 CASE (sic_eo)
1942 tmpstr = "Explicit Orbital SIC"
1943 CASE DEFAULT
1944 ! fix throughout the cp2k for this option
1945 cpabort("SIC option unknown")
1946 END SELECT
1947
1948 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
1949 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1950
1951 IF (dft_control%sic_method_id /= sic_none) THEN
1952 WRITE (unit=output_unit, fmt="(T2,A,T66,ES15.6)") &
1953 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1954 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1955 END IF
1956
1957 IF (dft_control%sic_method_id == sic_eo) THEN
1958 IF (dft_control%sic_list_id == sic_list_all) THEN
1959 WRITE (unit=output_unit, fmt="(T2,A,T66,A)") &
1960 "DFT| SIC orbitals", "ALL"
1961 END IF
1962 IF (dft_control%sic_list_id == sic_list_unpaired) THEN
1963 WRITE (unit=output_unit, fmt="(T2,A,T66,A)") &
1964 "DFT| SIC orbitals", "UNPAIRED"
1965 END IF
1966 END IF
1967
1968 CALL section_vals_val_get(xc_section, "density_cutoff", r_val=density_cut)
1969 CALL section_vals_val_get(xc_section, "gradient_cutoff", r_val=gradient_cut)
1970 CALL section_vals_val_get(xc_section, "tau_cutoff", r_val=tau_cut)
1971 CALL section_vals_val_get(xc_section, "density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1972
1973 WRITE (unit=output_unit, fmt="(T2,A,T66,ES15.6)") &
1974 "DFT| Cutoffs: density ", density_cut, &
1975 "DFT| gradient", gradient_cut, &
1976 "DFT| tau ", tau_cut, &
1977 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1978 CALL section_vals_val_get(xc_section, "XC_GRID%XC_SMOOTH_RHO", &
1979 c_val=tmpstr)
1980 WRITE (output_unit, '( A, T61, A )') &
1981 " DFT| XC density smoothing ", adjustr(tmpstr)
1982 CALL section_vals_val_get(xc_section, "XC_GRID%XC_DERIV", &
1983 c_val=tmpstr)
1984 WRITE (output_unit, '( A, T61, A )') &
1985 " DFT| XC derivatives ", adjustr(tmpstr)
1986 IF (dft_control%dft_plus_u) THEN
1987 NULLIFY (enum, keyword, section)
1988 CALL create_dft_section(section)
1989 keyword => section_get_keyword(section, "PLUS_U_METHOD")
1990 CALL keyword_get(keyword, enum=enum)
1991 WRITE (unit=output_unit, fmt="(/,T2,A,T41,A40)") &
1992 "DFT+U| Method", adjustr(trim(enum_i2c(enum, dft_control%plus_u_method_id)))
1993 WRITE (unit=output_unit, fmt="(T2,A)") &
1994 "DFT+U| Check atomic kind information for details"
1995 CALL section_release(section)
1996 END IF
1997
1998 WRITE (unit=output_unit, fmt="(A)") ""
1999 CALL xc_write(output_unit, xc_section, dft_control%lsd)
2000
2001 IF (dft_control%apply_period_efield) THEN
2002 WRITE (unit=output_unit, fmt="(A)") ""
2003 IF (dft_control%period_efield%displacement_field) THEN
2004 WRITE (unit=output_unit, fmt="(T2,A)") &
2005 "PERIODIC_EFIELD| Use displacement field formulation"
2006 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,ES14.6)") &
2007 "PERIODIC_EFIELD| Displacement field filter: x", &
2008 dft_control%period_efield%d_filter(1), &
2009 "PERIODIC_EFIELD| y", &
2010 dft_control%period_efield%d_filter(2), &
2011 "PERIODIC_EFIELD| z", &
2012 dft_control%period_efield%d_filter(3)
2013 END IF
2014 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,ES14.6)") &
2015 "PERIODIC_EFIELD| Polarisation vector: x", &
2016 dft_control%period_efield%polarisation(1), &
2017 "PERIODIC_EFIELD| y", &
2018 dft_control%period_efield%polarisation(2), &
2019 "PERIODIC_EFIELD| z", &
2020 dft_control%period_efield%polarisation(3)
2021
2022 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,I14)") &
2023 "PERIODIC_EFIELD| Start Frame:", &
2024 dft_control%period_efield%start_frame, &
2025 "PERIODIC_EFIELD| End Frame:", &
2026 dft_control%period_efield%end_frame
2027
2028 IF (ALLOCATED(dft_control%period_efield%strength_list)) THEN
2029 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,I14)") &
2030 "PERIODIC_EFIELD| Number of Intensities:", &
2031 SIZE(dft_control%period_efield%strength_list)
2032 WRITE (unit=output_unit, fmt="(T2,A,I10,T66,1X,ES14.6)") &
2033 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2034 1, dft_control%period_efield%strength_list(1)
2035 DO i = 2, SIZE(dft_control%period_efield%strength_list)
2036 WRITE (unit=output_unit, fmt="(T2,A,I10,T66,1X,ES14.6)") &
2037 "PERIODIC_EFIELD| ", &
2038 i, dft_control%period_efield%strength_list(i)
2039 END DO
2040 ELSE
2041 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,ES14.6)") &
2042 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2043 dft_control%period_efield%strength
2044 END IF
2045
2046 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
2047 dft_control%period_efield%polarisation)) < epsilon(0.0_dp)) THEN
2048 cpabort("Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2049 END IF
2050 END IF
2051
2052 IF (dft_control%do_sccs) THEN
2053 WRITE (unit=output_unit, fmt="(/,T2,A)") &
2054 "SCCS| Self-consistent continuum solvation model"
2055 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2056 "SCCS| Relative permittivity of the solvent (medium)", &
2057 dft_control%sccs_control%epsilon_solvent, &
2058 "SCCS| Absolute permittivity [a.u.]", &
2059 dft_control%sccs_control%epsilon_solvent/fourpi
2060 SELECT CASE (dft_control%sccs_control%method_id)
2061 CASE (sccs_andreussi)
2062 WRITE (unit=output_unit, fmt="(T2,A,/,(T2,A,T61,ES20.6))") &
2063 "SCCS| Dielectric function proposed by Andreussi et al.", &
2064 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2065 "SCCS| rho_min", dft_control%sccs_control%rho_min
2066 CASE (sccs_fattebert_gygi)
2067 WRITE (unit=output_unit, fmt="(T2,A,/,(T2,A,T61,ES20.6))") &
2068 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2069 "SCCS| beta", dft_control%sccs_control%beta, &
2070 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2071 CASE DEFAULT
2072 cpabort("Invalid SCCS model specified. Please, check your input!")
2073 END SELECT
2074 SELECT CASE (dft_control%sccs_control%derivative_method)
2075 CASE (sccs_derivative_fft)
2076 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2077 "SCCS| Numerical derivative calculation", &
2078 adjustr("FFT")
2079 CASE (sccs_derivative_cd3)
2080 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2081 "SCCS| Numerical derivative calculation", &
2082 adjustr("3-point stencil central differences")
2083 CASE (sccs_derivative_cd5)
2084 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2085 "SCCS| Numerical derivative calculation", &
2086 adjustr("5-point stencil central differences")
2087 CASE (sccs_derivative_cd7)
2088 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2089 "SCCS| Numerical derivative calculation", &
2090 adjustr("7-point stencil central differences")
2091 CASE DEFAULT
2092 CALL cp_abort(__location__, &
2093 "Invalid derivative method specified for SCCS model. "// &
2094 "Please, check your input!")
2095 END SELECT
2096 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2097 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2098 cp_unit_from_cp2k(dft_control%sccs_control%alpha_solvent, "mN/m")
2099 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2100 "SCCS| Dispersion parameter beta [GPa]", &
2101 cp_unit_from_cp2k(dft_control%sccs_control%beta_solvent, "GPa")
2102 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2103 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2104 cp_unit_from_cp2k(dft_control%sccs_control%gamma_solvent, "mN/m")
2105 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2106 "SCCS| Mixing parameter applied during the iteration cycle", &
2107 dft_control%sccs_control%mixing
2108 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2109 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2110 dft_control%sccs_control%eps_sccs
2111 WRITE (unit=output_unit, fmt="(T2,A,T61,I20)") &
2112 "SCCS| Maximum number of iteration steps", &
2113 dft_control%sccs_control%max_iter
2114 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2115 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2116 dft_control%sccs_control%eps_scf
2117 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2118 "SCCS| Numerical increment for the cavity surface calculation", &
2119 dft_control%sccs_control%delta_rho
2120 END IF
2121
2122 WRITE (unit=output_unit, fmt="(A)") ""
2123
2124 END IF
2125
2126 IF (dft_control%hairy_probes .EQV. .true.) THEN
2127 n_rep = SIZE(dft_control%probe)
2128 IF (output_unit > 0) THEN
2129 DO i_rep = 1, n_rep
2130 WRITE (unit=output_unit, fmt="(T2,A,I5)") &
2131 "HP | hair probe set", i_rep
2132 WRITE (unit=output_unit, fmt="(T2,A,T61,*(I5))") &
2133 "HP| atom indexes", &
2134 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2135 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2136 "HP| potential", dft_control%probe(i_rep)%mu
2137 WRITE (unit=output_unit, fmt="(T2,A,T61,F20.2)") &
2138 "HP| temperature", dft_control%probe(i_rep)%T
2139 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2140 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2141 END DO
2142 END IF
2143 END IF
2144
2145 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2146 "PRINT%DFT_CONTROL_PARAMETERS")
2147
2148 CALL timestop(handle)
2149
2150 END SUBROUTINE write_dft_control
2151
2152! **************************************************************************************************
2153!> \brief Write the ADMM control parameters to the output unit.
2154!> \param admm_control ...
2155!> \param dft_section ...
2156! **************************************************************************************************
2157 SUBROUTINE write_admm_control(admm_control, dft_section)
2158 TYPE(admm_control_type), POINTER :: admm_control
2159 TYPE(section_vals_type), POINTER :: dft_section
2160
2161 INTEGER :: iounit
2162 TYPE(cp_logger_type), POINTER :: logger
2163
2164 NULLIFY (logger)
2165 logger => cp_get_default_logger()
2166
2167 iounit = cp_print_key_unit_nr(logger, dft_section, &
2168 "PRINT%DFT_CONTROL_PARAMETERS", extension=".Log")
2169
2170 IF (iounit > 0) THEN
2171
2172 SELECT CASE (admm_control%admm_type)
2173 CASE (no_admm_type)
2174 WRITE (unit=iounit, fmt="(/,T2,A,T77,A)") "ADMM| Specific ADMM type specified", "NONE"
2175 CASE (admm1_type)
2176 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMM1"
2177 CASE (admm2_type)
2178 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMM2"
2179 CASE (admms_type)
2180 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMMS"
2181 CASE (admmp_type)
2182 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMMP"
2183 CASE (admmq_type)
2184 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMMQ"
2185 CASE DEFAULT
2186 cpabort("admm_type")
2187 END SELECT
2188
2189 SELECT CASE (admm_control%purification_method)
2190 CASE (do_admm_purify_none)
2191 WRITE (unit=iounit, fmt="(T2,A,T77,A)") "ADMM| Density matrix purification method", "NONE"
2193 WRITE (unit=iounit, fmt="(T2,A,T75,A)") "ADMM| Density matrix purification method", "Cauchy"
2195 WRITE (unit=iounit, fmt="(T2,A,T66,A)") "ADMM| Density matrix purification method", "Cauchy subspace"
2197 WRITE (unit=iounit, fmt="(T2,A,T63,A)") "ADMM| Density matrix purification method", "MO diagonalization"
2199 WRITE (unit=iounit, fmt="(T2,A,T71,A)") "ADMM| Density matrix purification method", "MO no diag"
2201 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Density matrix purification method", "McWeeny"
2203 WRITE (unit=iounit, fmt="(T2,A,T73,A)") "ADMM| Density matrix purification method", "NONE(DM)"
2204 CASE DEFAULT
2205 cpabort("admm_purification_method")
2206 END SELECT
2207
2208 SELECT CASE (admm_control%method)
2210 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Orbital projection on ADMM basis"
2212 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Blocked Fock matrix projection with full purification"
2214 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Blocked Fock matrix projection"
2216 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Orbital projection with charge constrain"
2217 CASE DEFAULT
2218 cpabort("admm method")
2219 END SELECT
2220
2221 SELECT CASE (admm_control%scaling_model)
2224 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Use Merlot (2014) scaling model"
2225 CASE DEFAULT
2226 cpabort("admm scaling_model")
2227 END SELECT
2228
2229 WRITE (unit=iounit, fmt="(T2,A,T61,G20.10)") "ADMM| eps_filter", admm_control%eps_filter
2230
2231 SELECT CASE (admm_control%aux_exch_func)
2233 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| No exchange functional correction term used"
2235 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Exchange functional in correction term", "(W)PBEX"
2237 WRITE (unit=iounit, fmt="(T2,A,T77,A)") "ADMM| Exchange functional in correction term", "PBEX"
2239 WRITE (unit=iounit, fmt="(T2,A,T77,A)") "ADMM| Exchange functional in correction term", "OPTX"
2241 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Exchange functional in correction term", "Becke88"
2243 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Exchange functional in correction term", "SlaterX"
2244 CASE DEFAULT
2245 cpabort("admm aux_exch_func")
2246 END SELECT
2247
2248 WRITE (unit=iounit, fmt="(A)") ""
2249
2250 END IF
2251
2252 CALL cp_print_key_finished_output(iounit, logger, dft_section, &
2253 "PRINT%DFT_CONTROL_PARAMETERS")
2254 END SUBROUTINE write_admm_control
2255
2256! **************************************************************************************************
2257!> \brief Write the xTB control parameters to the output unit.
2258!> \param xtb_control ...
2259!> \param dft_section ...
2260! **************************************************************************************************
2261 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2262 TYPE(xtb_control_type), POINTER :: xtb_control
2263 TYPE(section_vals_type), POINTER :: dft_section
2264
2265 CHARACTER(len=*), PARAMETER :: routinen = 'write_xtb_control'
2266
2267 INTEGER :: handle, output_unit
2268 TYPE(cp_logger_type), POINTER :: logger
2269
2270 CALL timeset(routinen, handle)
2271 NULLIFY (logger)
2272 logger => cp_get_default_logger()
2273
2274 output_unit = cp_print_key_unit_nr(logger, dft_section, &
2275 "PRINT%DFT_CONTROL_PARAMETERS", extension=".Log")
2276
2277 IF (output_unit > 0) THEN
2278
2279 WRITE (unit=output_unit, fmt="(/,T2,A,T31,A50)") &
2280 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2281 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2282 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2283 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2284 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2285 WRITE (unit=output_unit, fmt="(T2,A,T71,E10.4)") &
2286 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2287 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.6)") &
2288 "xTB| Repulsive enhancement factor", xtb_control%enscale
2289 WRITE (unit=output_unit, fmt="(T2,A,T71,L10)") &
2290 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2291 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2292 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2293 WRITE (unit=output_unit, fmt="(T2,A,T71,L10)") &
2294 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2295 SELECT CASE (xtb_control%vdw_type)
2296 CASE (xtb_vdw_type_none)
2297 WRITE (unit=output_unit, fmt="(T2,A)") "xTB| No vdW potential selected"
2298 CASE (xtb_vdw_type_d3)
2299 WRITE (unit=output_unit, fmt="(T2,A,T72,A)") "xTB| vdW potential type:", "DFTD3(BJ)"
2300 WRITE (unit=output_unit, fmt="(T2,A,T31,A50)") &
2301 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2302 CASE (xtb_vdw_type_d4)
2303 WRITE (unit=output_unit, fmt="(T2,A,T76,A)") "xTB| vdW potential type:", "DFTD4"
2304 WRITE (unit=output_unit, fmt="(T2,A,T31,A50)") &
2305 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2306 CASE DEFAULT
2307 cpabort("vdw type")
2308 END SELECT
2309 WRITE (unit=output_unit, fmt="(T2,A,T51,3F10.3)") &
2310 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2311 WRITE (unit=output_unit, fmt="(T2,A,T61,2F10.3)") &
2312 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2313 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2314 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2315 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2316 "xTB| Repulsion potential exponent", xtb_control%kf
2317 WRITE (unit=output_unit, fmt="(T2,A,T51,3F10.3)") &
2318 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2319 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2320 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2321 "xTB| Electronegativity scaling", xtb_control%ken
2322 WRITE (unit=output_unit, fmt="(T2,A,T61,2F10.3)") &
2323 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2324 WRITE (unit=output_unit, fmt="(/)")
2325
2326 END IF
2327
2328 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2329 "PRINT%DFT_CONTROL_PARAMETERS")
2330
2331 CALL timestop(handle)
2332
2333 END SUBROUTINE write_xtb_control
2334
2335! **************************************************************************************************
2336!> \brief Purpose: Write the QS control parameters to the output unit.
2337!> \param qs_control ...
2338!> \param dft_section ...
2339! **************************************************************************************************
2340 SUBROUTINE write_qs_control(qs_control, dft_section)
2341 TYPE(qs_control_type), INTENT(IN) :: qs_control
2342 TYPE(section_vals_type), POINTER :: dft_section
2343
2344 CHARACTER(len=*), PARAMETER :: routinen = 'write_qs_control'
2345
2346 CHARACTER(len=20) :: method, quadrature
2347 INTEGER :: handle, i, igrid_level, ngrid_level, &
2348 output_unit
2349 TYPE(cp_logger_type), POINTER :: logger
2350 TYPE(ddapc_restraint_type), POINTER :: ddapc_restraint_control
2351 TYPE(enumeration_type), POINTER :: enum
2352 TYPE(keyword_type), POINTER :: keyword
2353 TYPE(section_type), POINTER :: qs_section
2354 TYPE(section_vals_type), POINTER :: print_section_vals, qs_section_vals
2355
2356 IF (qs_control%semi_empirical) RETURN
2357 IF (qs_control%dftb) RETURN
2358 IF (qs_control%xtb) RETURN
2359 CALL timeset(routinen, handle)
2360 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2361 logger => cp_get_default_logger()
2362 print_section_vals => section_vals_get_subs_vals(dft_section, "PRINT")
2363 qs_section_vals => section_vals_get_subs_vals(dft_section, "QS")
2364 CALL section_vals_get(qs_section_vals, section=qs_section)
2365
2366 NULLIFY (enum, keyword)
2367 keyword => section_get_keyword(qs_section, "METHOD")
2368 CALL keyword_get(keyword, enum=enum)
2369 method = trim(enum_i2c(enum, qs_control%method_id))
2370
2371 NULLIFY (enum, keyword)
2372 keyword => section_get_keyword(qs_section, "QUADRATURE")
2373 CALL keyword_get(keyword, enum=enum)
2374 quadrature = trim(enum_i2c(enum, qs_control%gapw_control%quadrature))
2375
2376 output_unit = cp_print_key_unit_nr(logger, print_section_vals, &
2377 "DFT_CONTROL_PARAMETERS", extension=".Log")
2378 IF (output_unit > 0) THEN
2379 ngrid_level = SIZE(qs_control%e_cutoff)
2380 WRITE (unit=output_unit, fmt="(/,T2,A,T61,A20)") &
2381 "QS| Method:", adjustr(method)
2382 IF (qs_control%pw_grid_opt%spherical) THEN
2383 WRITE (unit=output_unit, fmt="(T2,A,T61,A)") &
2384 "QS| Density plane wave grid type", " SPHERICAL HALFSPACE"
2385 ELSE IF (qs_control%pw_grid_opt%fullspace) THEN
2386 WRITE (unit=output_unit, fmt="(T2,A,T57,A)") &
2387 "QS| Density plane wave grid type", " NON-SPHERICAL FULLSPACE"
2388 ELSE
2389 WRITE (unit=output_unit, fmt="(T2,A,T57,A)") &
2390 "QS| Density plane wave grid type", " NON-SPHERICAL HALFSPACE"
2391 END IF
2392 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2393 "QS| Number of grid levels:", SIZE(qs_control%e_cutoff)
2394 IF (ngrid_level == 1) THEN
2395 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2396 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2397 ELSE
2398 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2399 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2400 IF (qs_control%commensurate_mgrids) &
2401 WRITE (unit=output_unit, fmt="(T2,A)") "QS| Using commensurate multigrids"
2402 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2403 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2404 WRITE (unit=output_unit, fmt="(T2,A,I3,A,T71,F10.1)") &
2405 ("QS| ", igrid_level, ") grid level", &
2406 qs_control%e_cutoff(igrid_level), &
2407 igrid_level=2, SIZE(qs_control%e_cutoff))
2408 END IF
2409 IF (qs_control%pao) THEN
2410 WRITE (unit=output_unit, fmt="(T2,A)") "QS| PAO active"
2411 END IF
2412 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2413 "QS| Grid level progression factor:", qs_control%progression_factor
2414 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2415 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2416 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2417 "QS| Interaction thresholds: eps_pgf_orb:", &
2418 qs_control%eps_pgf_orb, &
2419 "QS| eps_filter_matrix:", &
2420 qs_control%eps_filter_matrix, &
2421 "QS| eps_core_charge:", &
2422 qs_control%eps_core_charge, &
2423 "QS| eps_rho_gspace:", &
2424 qs_control%eps_rho_gspace, &
2425 "QS| eps_rho_rspace:", &
2426 qs_control%eps_rho_rspace, &
2427 "QS| eps_gvg_rspace:", &
2428 qs_control%eps_gvg_rspace, &
2429 "QS| eps_ppl:", &
2430 qs_control%eps_ppl, &
2431 "QS| eps_ppnl:", &
2432 qs_control%eps_ppnl
2433 IF (qs_control%gapw) THEN
2434 SELECT CASE (qs_control%gapw_control%basis_1c)
2435 CASE (gapw_1c_orb)
2436 WRITE (unit=output_unit, fmt="(T2,A)") &
2437 "QS| GAPW| One center basis from orbital basis primitives"
2438 CASE (gapw_1c_small)
2439 WRITE (unit=output_unit, fmt="(T2,A)") &
2440 "QS| GAPW| One center basis extended with primitives (small:s)"
2441 CASE (gapw_1c_medium)
2442 WRITE (unit=output_unit, fmt="(T2,A)") &
2443 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2444 CASE (gapw_1c_large)
2445 WRITE (unit=output_unit, fmt="(T2,A)") &
2446 "QS| GAPW| One center basis extended with primitives (large:spd)"
2447 CASE (gapw_1c_very_large)
2448 WRITE (unit=output_unit, fmt="(T2,A)") &
2449 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2450 CASE DEFAULT
2451 cpabort("basis_1c incorrect")
2452 END SELECT
2453 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2454 "QS| GAPW| eps_fit:", &
2455 qs_control%gapw_control%eps_fit, &
2456 "QS| GAPW| eps_iso:", &
2457 qs_control%gapw_control%eps_iso, &
2458 "QS| GAPW| eps_svd:", &
2459 qs_control%gapw_control%eps_svd, &
2460 "QS| GAPW| eps_cpc:", &
2461 qs_control%gapw_control%eps_cpc
2462 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2463 "QS| GAPW| atom-r-grid: quadrature:", &
2464 adjustr(quadrature)
2465 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2466 "QS| GAPW| atom-s-grid: max l :", &
2467 qs_control%gapw_control%lmax_sphere, &
2468 "QS| GAPW| max_l_rho0 :", &
2469 qs_control%gapw_control%lmax_rho0
2470 IF (qs_control%gapw_control%non_paw_atoms) THEN
2471 WRITE (unit=output_unit, fmt="(T2,A)") &
2472 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2473 END IF
2474 IF (qs_control%gapw_control%nopaw_as_gpw) THEN
2475 WRITE (unit=output_unit, fmt="(T2,A)") &
2476 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2477 END IF
2478 END IF
2479 IF (qs_control%gapw_xc) THEN
2480 SELECT CASE (qs_control%gapw_control%basis_1c)
2481 CASE (gapw_1c_orb)
2482 WRITE (unit=output_unit, fmt="(T2,A)") &
2483 "QS| GAPW_XC| One center basis from orbital basis primitives"
2484 CASE (gapw_1c_small)
2485 WRITE (unit=output_unit, fmt="(T2,A)") &
2486 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2487 CASE (gapw_1c_medium)
2488 WRITE (unit=output_unit, fmt="(T2,A)") &
2489 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2490 CASE (gapw_1c_large)
2491 WRITE (unit=output_unit, fmt="(T2,A)") &
2492 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2493 CASE (gapw_1c_very_large)
2494 WRITE (unit=output_unit, fmt="(T2,A)") &
2495 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2496 CASE DEFAULT
2497 cpabort("basis_1c incorrect")
2498 END SELECT
2499 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2500 "QS| GAPW_XC| eps_fit:", &
2501 qs_control%gapw_control%eps_fit, &
2502 "QS| GAPW_XC| eps_iso:", &
2503 qs_control%gapw_control%eps_iso, &
2504 "QS| GAPW_XC| eps_svd:", &
2505 qs_control%gapw_control%eps_svd
2506 WRITE (unit=output_unit, fmt="(T2,A,T55,A30)") &
2507 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2508 enum_i2c(enum, qs_control%gapw_control%quadrature)
2509 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2510 "QS| GAPW_XC| atom-s-grid: max l :", &
2511 qs_control%gapw_control%lmax_sphere
2512 END IF
2513 IF (qs_control%mulliken_restraint) THEN
2514 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2515 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2516 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2517 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2518 WRITE (unit=output_unit, fmt="(T2,A,T73,I8)") &
2519 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2520 WRITE (unit=output_unit, fmt="(5I8)") qs_control%mulliken_restraint_control%atoms
2521 END IF
2522 IF (qs_control%ddapc_restraint) THEN
2523 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
2524 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2525 IF (SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2526 WRITE (unit=output_unit, fmt="(T2,A,T3,I8)") &
2527 "QS| parameters for DDAPC restraint number", i
2528 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2529 "QS| ddapc restraint target", ddapc_restraint_control%target
2530 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2531 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2532 WRITE (unit=output_unit, fmt="(T2,A,T73,I8)") &
2533 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2534 WRITE (unit=output_unit, fmt="(5I8)") ddapc_restraint_control%atoms
2535 WRITE (unit=output_unit, fmt="(T2,A)") "Coefficients:"
2536 WRITE (unit=output_unit, fmt="(5F6.2)") ddapc_restraint_control%coeff
2537 SELECT CASE (ddapc_restraint_control%functional_form)
2538 CASE (do_ddapc_restraint)
2539 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2540 "QS| ddapc restraint functional form :", "RESTRAINT"
2541 CASE (do_ddapc_constraint)
2542 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2543 "QS| ddapc restraint functional form :", "CONSTRAINT"
2544 CASE DEFAULT
2545 cpabort("Unknown ddapc restraint")
2546 END SELECT
2547 END DO
2548 END IF
2549 IF (qs_control%s2_restraint) THEN
2550 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2551 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2552 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2553 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2554 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2555 CASE (do_s2_restraint)
2556 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2557 "QS| s2 restraint functional form :", "RESTRAINT"
2558 cpabort("Not yet implemented")
2559 CASE (do_s2_constraint)
2560 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2561 "QS| s2 restraint functional form :", "CONSTRAINT"
2562 CASE DEFAULT
2563 cpabort("Unknown ddapc restraint")
2564 END SELECT
2565 END IF
2566 END IF
2567 CALL cp_print_key_finished_output(output_unit, logger, print_section_vals, &
2568 "DFT_CONTROL_PARAMETERS")
2569
2570 CALL timestop(handle)
2571
2572 END SUBROUTINE write_qs_control
2573
2574! **************************************************************************************************
2575!> \brief reads the input parameters needed for ddapc.
2576!> \param qs_control ...
2577!> \param qs_section ...
2578!> \param ddapc_restraint_section ...
2579!> \author fschiff
2580!> \note
2581!> either reads DFT%QS%DDAPC_RESTRAINT or PROPERTIES%ET_coupling
2582!> if(qs_section is present the DFT part is read, if ddapc_restraint_section
2583!> is present ET_COUPLING is read. Avoid having both!!!
2584! **************************************************************************************************
2585 SUBROUTINE read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
2586
2587 TYPE(qs_control_type), INTENT(INOUT) :: qs_control
2588 TYPE(section_vals_type), OPTIONAL, POINTER :: qs_section, ddapc_restraint_section
2589
2590 INTEGER :: i, j, jj, k, n_rep
2591 INTEGER, DIMENSION(:), POINTER :: tmplist
2592 REAL(kind=dp), DIMENSION(:), POINTER :: rtmplist
2593 TYPE(ddapc_restraint_type), POINTER :: ddapc_restraint_control
2594 TYPE(section_vals_type), POINTER :: ddapc_section
2595
2596 IF (PRESENT(ddapc_restraint_section)) THEN
2597 IF (ASSOCIATED(qs_control%ddapc_restraint_control)) THEN
2598 IF (SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2599 cpabort("ET_COUPLING cannot be used in combination with a normal restraint")
2600 ELSE
2601 ddapc_section => ddapc_restraint_section
2602 ALLOCATE (qs_control%ddapc_restraint_control(1))
2603 END IF
2604 END IF
2605
2606 IF (PRESENT(qs_section)) THEN
2607 NULLIFY (ddapc_section)
2608 ddapc_section => section_vals_get_subs_vals(qs_section, &
2609 "DDAPC_RESTRAINT")
2610 END IF
2611
2612 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
2613
2614 CALL ddapc_control_create(qs_control%ddapc_restraint_control(i))
2615 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2616
2617 CALL section_vals_val_get(ddapc_section, "STRENGTH", i_rep_section=i, &
2618 r_val=ddapc_restraint_control%strength)
2619 CALL section_vals_val_get(ddapc_section, "TARGET", i_rep_section=i, &
2620 r_val=ddapc_restraint_control%target)
2621 CALL section_vals_val_get(ddapc_section, "FUNCTIONAL_FORM", i_rep_section=i, &
2622 i_val=ddapc_restraint_control%functional_form)
2623 CALL section_vals_val_get(ddapc_section, "ATOMS", i_rep_section=i, &
2624 n_rep_val=n_rep)
2625 CALL section_vals_val_get(ddapc_section, "TYPE_OF_DENSITY", i_rep_section=i, &
2626 i_val=ddapc_restraint_control%density_type)
2627
2628 jj = 0
2629 DO k = 1, n_rep
2630 CALL section_vals_val_get(ddapc_section, "ATOMS", i_rep_section=i, &
2631 i_rep_val=k, i_vals=tmplist)
2632 DO j = 1, SIZE(tmplist)
2633 jj = jj + 1
2634 END DO
2635 END DO
2636 IF (jj < 1) cpabort("Need at least 1 atom to use ddapc constraints")
2637 ddapc_restraint_control%natoms = jj
2638 IF (ASSOCIATED(ddapc_restraint_control%atoms)) &
2639 DEALLOCATE (ddapc_restraint_control%atoms)
2640 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2641 jj = 0
2642 DO k = 1, n_rep
2643 CALL section_vals_val_get(ddapc_section, "ATOMS", i_rep_section=i, &
2644 i_rep_val=k, i_vals=tmplist)
2645 DO j = 1, SIZE(tmplist)
2646 jj = jj + 1
2647 ddapc_restraint_control%atoms(jj) = tmplist(j)
2648 END DO
2649 END DO
2650
2651 IF (ASSOCIATED(ddapc_restraint_control%coeff)) &
2652 DEALLOCATE (ddapc_restraint_control%coeff)
2653 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2654 ddapc_restraint_control%coeff = 1.0_dp
2655
2656 CALL section_vals_val_get(ddapc_section, "COEFF", i_rep_section=i, &
2657 n_rep_val=n_rep)
2658 jj = 0
2659 DO k = 1, n_rep
2660 CALL section_vals_val_get(ddapc_section, "COEFF", i_rep_section=i, &
2661 i_rep_val=k, r_vals=rtmplist)
2662 DO j = 1, SIZE(rtmplist)
2663 jj = jj + 1
2664 IF (jj > ddapc_restraint_control%natoms) &
2665 cpabort("Need the same number of coeff as there are atoms ")
2666 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2667 END DO
2668 END DO
2669 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2670 cpabort("Need no or the same number of coeff as there are atoms.")
2671 END DO
2672 k = 0
2673 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
2674 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2675 do_ddapc_constraint) k = k + 1
2676 END DO
2677 IF (k == 2) CALL cp_abort(__location__, &
2678 "Only a single constraint possible yet, try to use restraints instead ")
2679
2680 END SUBROUTINE read_ddapc_section
2681
2682! **************************************************************************************************
2683!> \brief ...
2684!> \param dft_control ...
2685!> \param efield_section ...
2686! **************************************************************************************************
2687 SUBROUTINE read_efield_sections(dft_control, efield_section)
2688 TYPE(dft_control_type), POINTER :: dft_control
2689 TYPE(section_vals_type), POINTER :: efield_section
2690
2691 CHARACTER(len=default_path_length) :: file_name
2692 INTEGER :: i, io, j, n, unit_nr
2693 REAL(kind=dp), DIMENSION(:), POINTER :: tmp_vals
2694 TYPE(efield_type), POINTER :: efield
2695 TYPE(section_vals_type), POINTER :: tmp_section
2696
2697 DO i = 1, SIZE(dft_control%efield_fields)
2698 NULLIFY (dft_control%efield_fields(i)%efield)
2699 ALLOCATE (dft_control%efield_fields(i)%efield)
2700 efield => dft_control%efield_fields(i)%efield
2701 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2702 CALL section_vals_val_get(efield_section, "INTENSITY", i_rep_section=i, &
2703 r_val=efield%strength)
2704
2705 CALL section_vals_val_get(efield_section, "POLARISATION", i_rep_section=i, &
2706 r_vals=tmp_vals)
2707 ALLOCATE (efield%polarisation(SIZE(tmp_vals)))
2708 efield%polarisation = tmp_vals
2709 CALL section_vals_val_get(efield_section, "PHASE", i_rep_section=i, &
2710 r_val=efield%phase_offset)
2711 CALL section_vals_val_get(efield_section, "ENVELOP", i_rep_section=i, &
2712 i_val=efield%envelop_id)
2713 CALL section_vals_val_get(efield_section, "WAVELENGTH", i_rep_section=i, &
2714 r_val=efield%wavelength)
2715 CALL section_vals_val_get(efield_section, "VEC_POT_INITIAL", i_rep_section=i, &
2716 r_vals=tmp_vals)
2717 efield%vec_pot_initial = tmp_vals
2718
2719 IF (efield%envelop_id == constant_env) THEN
2720 ALLOCATE (efield%envelop_i_vars(2))
2721 tmp_section => section_vals_get_subs_vals(efield_section, "CONSTANT_ENV", i_rep_section=i)
2722 CALL section_vals_val_get(tmp_section, "START_STEP", &
2723 i_val=efield%envelop_i_vars(1))
2724 CALL section_vals_val_get(tmp_section, "END_STEP", &
2725 i_val=efield%envelop_i_vars(2))
2726 ELSE IF (efield%envelop_id == gaussian_env) THEN
2727 ALLOCATE (efield%envelop_r_vars(2))
2728 tmp_section => section_vals_get_subs_vals(efield_section, "GAUSSIAN_ENV", i_rep_section=i)
2729 CALL section_vals_val_get(tmp_section, "T0", &
2730 r_val=efield%envelop_r_vars(1))
2731 CALL section_vals_val_get(tmp_section, "SIGMA", &
2732 r_val=efield%envelop_r_vars(2))
2733 ELSE IF (efield%envelop_id == ramp_env) THEN
2734 ALLOCATE (efield%envelop_i_vars(4))
2735 tmp_section => section_vals_get_subs_vals(efield_section, "RAMP_ENV", i_rep_section=i)
2736 CALL section_vals_val_get(tmp_section, "START_STEP_IN", &
2737 i_val=efield%envelop_i_vars(1))
2738 CALL section_vals_val_get(tmp_section, "END_STEP_IN", &
2739 i_val=efield%envelop_i_vars(2))
2740 CALL section_vals_val_get(tmp_section, "START_STEP_OUT", &
2741 i_val=efield%envelop_i_vars(3))
2742 CALL section_vals_val_get(tmp_section, "END_STEP_OUT", &
2743 i_val=efield%envelop_i_vars(4))
2744 ELSE IF (efield%envelop_id == custom_env) THEN
2745 tmp_section => section_vals_get_subs_vals(efield_section, "CUSTOM_ENV", i_rep_section=i)
2746 CALL section_vals_val_get(tmp_section, "EFIELD_FILE_NAME", c_val=file_name)
2747 CALL open_file(file_name=trim(file_name), file_action="READ", file_status="OLD", unit_number=unit_nr)
2748 !Determine the number of lines in file
2749 n = 0
2750 DO WHILE (.true.)
2751 READ (unit_nr, *, iostat=io)
2752 IF (io /= 0) EXIT
2753 n = n + 1
2754 END DO
2755 rewind(unit_nr)
2756 ALLOCATE (efield%envelop_r_vars(n + 1))
2757 !Store the timestep of the list in the first entry of the r_vars
2758 CALL section_vals_val_get(tmp_section, "TIMESTEP", r_val=efield%envelop_r_vars(1))
2759 !Read the file
2760 DO j = 2, n + 1
2761 READ (unit_nr, *) efield%envelop_r_vars(j)
2762 efield%envelop_r_vars(j) = cp_unit_to_cp2k(efield%envelop_r_vars(j), "volt/m")
2763 END DO
2764 CALL close_file(unit_nr)
2765 END IF
2766 END DO
2767 END SUBROUTINE read_efield_sections
2768
2769! **************************************************************************************************
2770!> \brief reads the input parameters needed real time propagation
2771!> \param dft_control ...
2772!> \param rtp_section ...
2773!> \author fschiff
2774! **************************************************************************************************
2775 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2776
2777 TYPE(dft_control_type), INTENT(INOUT) :: dft_control
2778 TYPE(section_vals_type), POINTER :: rtp_section
2779
2780 INTEGER, DIMENSION(:), POINTER :: tmp
2781 LOGICAL :: is_present
2782 TYPE(section_vals_type), POINTER :: proj_mo_section
2783
2784 ALLOCATE (dft_control%rtp_control)
2785 CALL section_vals_val_get(rtp_section, "MAX_ITER", &
2786 i_val=dft_control%rtp_control%max_iter)
2787 CALL section_vals_val_get(rtp_section, "MAT_EXP", &
2788 i_val=dft_control%rtp_control%mat_exp)
2789 CALL section_vals_val_get(rtp_section, "ASPC_ORDER", &
2790 i_val=dft_control%rtp_control%aspc_order)
2791 CALL section_vals_val_get(rtp_section, "EXP_ACCURACY", &
2792 r_val=dft_control%rtp_control%eps_exp)
2793 CALL section_vals_val_get(rtp_section, "RTBSE%_SECTION_PARAMETERS_", &
2794 i_val=dft_control%rtp_control%rtp_method)
2795 CALL section_vals_val_get(rtp_section, "RTBSE%RTBSE_HAMILTONIAN", &
2796 i_val=dft_control%rtp_control%rtbse_ham)
2797 CALL section_vals_val_get(rtp_section, "PROPAGATOR", &
2798 i_val=dft_control%rtp_control%propagator)
2799 CALL section_vals_val_get(rtp_section, "EPS_ITER", &
2800 r_val=dft_control%rtp_control%eps_ener)
2801 CALL section_vals_val_get(rtp_section, "INITIAL_WFN", &
2802 i_val=dft_control%rtp_control%initial_wfn)
2803 CALL section_vals_val_get(rtp_section, "HFX_BALANCE_IN_CORE", &
2804 l_val=dft_control%rtp_control%hfx_redistribute)
2805 CALL section_vals_val_get(rtp_section, "APPLY_WFN_MIX_INIT_RESTART", &
2806 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2807 CALL section_vals_val_get(rtp_section, "APPLY_DELTA_PULSE", &
2808 l_val=dft_control%rtp_control%apply_delta_pulse)
2809 CALL section_vals_val_get(rtp_section, "APPLY_DELTA_PULSE_MAG", &
2810 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2811 CALL section_vals_val_get(rtp_section, "VELOCITY_GAUGE", &
2812 l_val=dft_control%rtp_control%velocity_gauge)
2813 CALL section_vals_val_get(rtp_section, "VG_COM_NL", &
2814 l_val=dft_control%rtp_control%nl_gauge_transform)
2815 CALL section_vals_val_get(rtp_section, "PERIODIC", &
2816 l_val=dft_control%rtp_control%periodic)
2817 CALL section_vals_val_get(rtp_section, "DENSITY_PROPAGATION", &
2818 l_val=dft_control%rtp_control%linear_scaling)
2819 CALL section_vals_val_get(rtp_section, "MCWEENY_MAX_ITER", &
2820 i_val=dft_control%rtp_control%mcweeny_max_iter)
2821 CALL section_vals_val_get(rtp_section, "ACCURACY_REFINEMENT", &
2822 i_val=dft_control%rtp_control%acc_ref)
2823 CALL section_vals_val_get(rtp_section, "MCWEENY_EPS", &
2824 r_val=dft_control%rtp_control%mcweeny_eps)
2825 CALL section_vals_val_get(rtp_section, "DELTA_PULSE_SCALE", &
2826 r_val=dft_control%rtp_control%delta_pulse_scale)
2827 CALL section_vals_val_get(rtp_section, "DELTA_PULSE_DIRECTION", &
2828 i_vals=tmp)
2829 dft_control%rtp_control%delta_pulse_direction = tmp
2830 CALL section_vals_val_get(rtp_section, "SC_CHECK_START", &
2831 i_val=dft_control%rtp_control%sc_check_start)
2832 proj_mo_section => section_vals_get_subs_vals(rtp_section, "PRINT%PROJECTION_MO")
2833 CALL section_vals_get(proj_mo_section, explicit=is_present)
2834 IF (is_present) THEN
2835 IF (dft_control%rtp_control%linear_scaling) &
2836 CALL cp_abort(__location__, &
2837 "You have defined a time dependent projection of mos, but "// &
2838 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2839 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2840 "define any PRINT%PROJECTION_MO section")
2841 dft_control%rtp_control%is_proj_mo = .true.
2842 ELSE
2843 dft_control%rtp_control%is_proj_mo = .false.
2844 END IF
2845
2846 END SUBROUTINE read_rtp_section
2847
2848! **************************************************************************************************
2849!> \brief Parses the BLOCK_LIST keywords from the ADMM section
2850!> \param admm_control ...
2851!> \param dft_section ...
2852! **************************************************************************************************
2853 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2854 TYPE(admm_control_type), POINTER :: admm_control
2855 TYPE(section_vals_type), POINTER :: dft_section
2856
2857 INTEGER :: irep, list_size, n_rep
2858 INTEGER, DIMENSION(:), POINTER :: tmplist
2859
2860 NULLIFY (tmplist)
2861
2862 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
2863 n_rep_val=n_rep)
2864
2865 ALLOCATE (admm_control%blocks(n_rep))
2866
2867 DO irep = 1, n_rep
2868 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
2869 i_rep_val=irep, i_vals=tmplist)
2870 list_size = SIZE(tmplist)
2871 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2872 admm_control%blocks(irep)%list(:) = tmplist(:)
2873 END DO
2874
2875 END SUBROUTINE read_admm_block_list
2876
2877! **************************************************************************************************
2878!> \brief ...
2879!> \param dft_control ...
2880!> \param hairy_probes_section ...
2881!> \param
2882!> \param
2883! **************************************************************************************************
2884 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
2885 TYPE(dft_control_type), POINTER :: dft_control
2886 TYPE(section_vals_type), POINTER :: hairy_probes_section
2887
2888 INTEGER :: i, j, jj, kk, n_rep
2889 INTEGER, DIMENSION(:), POINTER :: tmplist
2890
2891 DO i = 1, SIZE(dft_control%probe)
2892 NULLIFY (dft_control%probe(i)%atom_ids)
2893
2894 CALL section_vals_val_get(hairy_probes_section, "ATOM_IDS", i_rep_section=i, n_rep_val=n_rep)
2895 jj = 0
2896 DO kk = 1, n_rep
2897 CALL section_vals_val_get(hairy_probes_section, "ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2898 jj = jj + SIZE(tmplist)
2899 END DO
2900
2901 dft_control%probe(i)%natoms = jj
2902 IF (dft_control%probe(i)%natoms < 1) &
2903 cpabort("Need at least 1 atom to use hair probes formalism")
2904 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
2905
2906 jj = 0
2907 DO kk = 1, n_rep
2908 CALL section_vals_val_get(hairy_probes_section, "ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2909 DO j = 1, SIZE(tmplist)
2910 jj = jj + 1
2911 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
2912 END DO
2913 END DO
2914
2915 CALL section_vals_val_get(hairy_probes_section, "MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
2916
2917 CALL section_vals_val_get(hairy_probes_section, "T", i_rep_section=i, r_val=dft_control%probe(i)%T)
2918
2919 CALL section_vals_val_get(hairy_probes_section, "ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
2920
2921 CALL section_vals_val_get(hairy_probes_section, "eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
2922 END DO
2923
2924 END SUBROUTINE read_hairy_probes_sections
2925! **************************************************************************************************
2926
2927END MODULE cp_control_utils
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2005b
integer, save, public umari2002
integer, save, public yin2017
integer, save, public stewart2007
integer, save, public caldeweyher2020
integer, save, public stengel2009
integer, save, public vandevondele2005a
integer, save, public caldeweyher2017
integer, save, public grimme2017
integer, save, public lippert1999
integer, save, public dewar1977
integer, save, public elstner1998
integer, save, public vanvoorhis2015
integer, save, public repasky2002
integer, save, public hu2007
integer, save, public andreussi2012
integer, save, public asgeirsson2017
integer, save, public rocha2006
integer, save, public lippert1997
integer, save, public fattebert2002
integer, save, public thiel1992
integer, save, public pracht2019
integer, save, public porezag1995
integer, save, public bannwarth2019
integer, save, public souza2002
integer, save, public schenter2008
integer, save, public krack2000
integer, save, public dewar1985
integer, save, public stewart1989
integer, save, public seifert1996
integer, save, public zhechkov2005
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dft_control_create(dft_control)
allocates and perform a very basic initialization
subroutine, public expot_control_create(expot_control)
...
subroutine, public maxwell_control_create(maxwell_control)
...
subroutine, public ddapc_control_create(ddapc_restraint_control)
create the ddapc_restraint_type
subroutine, public admm_control_create(admm_control)
...
Utilities to set up the control types.
subroutine, public write_qs_control(qs_control, dft_section)
Purpose: Write the QS control parameters to the output unit.
subroutine, public read_rixs_control(rixs_control, rixs_section, qs_control)
Reads the input and stores in the rixs_control_type.
subroutine, public read_tddfpt2_control(t_control, t_section, qs_control)
Read TDDFPT-related input parameters.
subroutine, public read_dft_control(dft_control, dft_section)
...
subroutine, public read_qs_section(qs_control, qs_section)
...
subroutine, public write_admm_control(admm_control, dft_section)
Write the ADMM control parameters to the output unit.
subroutine, public write_dft_control(dft_control, dft_section)
Write the DFT control parameters to the output unit.
subroutine, public read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
reads the input parameters needed for ddapc.
subroutine, public read_mgrid_section(qs_control, dft_section)
...
Utility routines to open and close files. Tracking of preconnections.
Definition cp_files.F:16
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
Definition cp_files.F:311
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
Definition cp_files.F:122
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_read_line(parser, nline, at_end)
Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_reset(parser)
Resets the parser: rewinding the unit and re-initializing all parser structures.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Definition cp_units.F:1178
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition cp_units.F:1149
Input definition and setup for EEQ model.
Definition eeq_input.F:12
subroutine, public read_eeq_param(eeq_section, eeq_sparam)
...
Definition eeq_input.F:110
subroutine, public read_gp_section(nonbonded, section, start)
Reads the GENPOT - generic potential section.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public sic_list_unpaired
integer, parameter, public sic_mauri_spz
integer, parameter, public do_method_ofgpw
integer, parameter, public do_admm_purify_mo_no_diag
integer, parameter, public do_se_lr_ewald_gks
integer, parameter, public do_admm_aux_exch_func_opt_libxc
integer, parameter, public do_s2_restraint
integer, parameter, public do_admm_purify_none
integer, parameter, public do_method_rigpw
integer, parameter, public do_s2_constraint
integer, parameter, public use_mom_ref_user
integer, parameter, public do_method_gpw
integer, parameter, public gapw_1c_large
integer, parameter, public do_method_pdg
integer, parameter, public do_admm_purify_none_dm
integer, parameter, public do_method_pnnl
integer, parameter, public do_ddapc_constraint
integer, parameter, public do_se_lr_none
integer, parameter, public do_admm_purify_mcweeny
integer, parameter, public do_se_lr_ewald
integer, parameter, public do_admm_blocking_purify_full
integer, parameter, public ramp_env
integer, parameter, public do_se_is_kdso_d
integer, parameter, public gapw_1c_medium
integer, parameter, public do_admm_aux_exch_func_sx_libxc
integer, parameter, public admm2_type
integer, parameter, public xtb_vdw_type_d3
integer, parameter, public sic_list_all
integer, parameter, public constant_env
integer, parameter, public sic_eo
integer, parameter, public sccs_derivative_cd5
integer, parameter, public do_admm_aux_exch_func_bee
integer, parameter, public no_admm_type
integer, parameter, public do_admm_blocked_projection
integer, parameter, public do_admm_basis_projection
integer, parameter, public do_method_rm1
integer, parameter, public do_admm_aux_exch_func_default_libxc
integer, parameter, public do_admm_aux_exch_func_opt
integer, parameter, public gapw_1c_small
integer, parameter, public do_admm_aux_exch_func_none
integer, parameter, public do_admm_purify_cauchy_subspace
integer, parameter, public do_method_pm3
integer, parameter, public do_admm_aux_exch_func_bee_libxc
integer, parameter, public admm1_type
integer, parameter, public do_admm_aux_exch_func_pbex_libxc
integer, parameter, public do_method_mndo
integer, parameter, public gapw_1c_orb
integer, parameter, public do_admm_aux_exch_func_default
integer, parameter, public xtb_vdw_type_d4
integer, parameter, public do_pwgrid_ns_fullspace
integer, parameter, public gapw_1c_very_large
integer, parameter, public do_method_gapw
integer, parameter, public admms_type
integer, parameter, public do_admm_charge_constrained_projection
integer, parameter, public do_admm_purify_cauchy
integer, parameter, public sccs_fattebert_gygi
integer, parameter, public gaussian_env
integer, parameter, public sccs_derivative_cd7
integer, parameter, public do_method_mndod
integer, parameter, public xtb_vdw_type_none
integer, parameter, public do_method_am1
integer, parameter, public do_method_dftb
integer, parameter, public tddfpt_dipole_length
integer, parameter, public sccs_derivative_fft
integer, parameter, public tddfpt_kernel_stda
integer, parameter, public do_pwgrid_spherical
integer, parameter, public do_se_lr_ewald_r3
integer, parameter, public do_se_is_kdso
integer, parameter, public do_admm_purify_mo_diag
integer, parameter, public do_method_lrigpw
integer, parameter, public sic_mauri_us
integer, parameter, public sic_none
integer, parameter, public do_se_is_slater
integer, parameter, public custom_env
integer, parameter, public do_method_xtb
integer, parameter, public do_ddapc_restraint
integer, parameter, public do_pwgrid_ns_halfspace
integer, parameter, public sccs_derivative_cd3
integer, parameter, public do_method_pm6fm
integer, parameter, public admmq_type
integer, parameter, public sccs_andreussi
integer, parameter, public sic_ad
integer, parameter, public do_admm_exch_scaling_none
integer, parameter, public admmp_type
integer, parameter, public do_method_gapw_xc
integer, parameter, public do_admm_exch_scaling_merlot
integer, parameter, public real_time_propagation
integer, parameter, public numerical
integer, parameter, public do_method_pm6
integer, parameter, public do_admm_aux_exch_func_pbex
integer, parameter, public slater
checks the input and perform some automatic "magic" on it
subroutine, public xc_functionals_expand(functionals, xc_section)
expand a shortcutted functional section
function that build the dft section of the input
subroutine, public create_dft_section(section)
creates the dft section
represents an enumeration, i.e. a mapping between integers and strings
character(len=default_string_length) function, public enum_i2c(enum, i)
maps an integer to a string
represents keywords in an input
subroutine, public keyword_get(keyword, names, usage, description, type_of_var, n_var, default_value, lone_keyword_value, repeats, enum, citations)
...
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_vals_val_set(section_vals, keyword_name, i_rep_section, i_rep_val, val, l_val, i_val, r_val, c_val, l_vals_ptr, i_vals_ptr, r_vals_ptr, c_vals_ptr)
sets the requested value
integer function, public section_get_ival(section_vals, keyword_name)
...
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
recursive type(keyword_type) function, pointer, public section_get_keyword(section, keyword_name)
returns the requested keyword
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
integer, parameter, public default_path_length
Definition kinds.F:58
Definition of mathematical constants and functions.
real(kind=dp), parameter, public fourpi
subroutine, public pair_potential_reallocate(p, lb1_new, ub1_new, lj, lj_charmm, williams, goodwin, eam, quip, nequip, allegro, bmhft, bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
Cleans the potential parameter type.
Periodic Table related data definitions.
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
Utility subroutines for CDFT calculations.
subroutine, public read_cdft_control_section(qs_control, cdft_control_section)
reads the input parameters needed for CDFT with OT
Input control types for NEGF/SMEAGOL transport calculations.
subroutine, public read_smeagol_control(smeagol_control, smeagol_section)
Read SMEAGOL-related input parameters.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
All kind of helpful little routines.
Definition util.F:14
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
subroutine, public read_xas_tdp_control(xas_tdp_control, xas_tdp_section)
Reads the inputs and stores in xas_tdp_control_type.
input constants for xc
integer, parameter, public xc_deriv_collocate
Writes information on XC functionals to output.
subroutine, public xc_write(iounit, xc_section, lsd)
...
Exchange and Correlation functional calculations.
Definition xc.F:17
logical function, public xc_uses_norm_drho(xc_fun_section, lsd)
...
Definition xc.F:111
logical function, public xc_uses_kinetic_energy_density(xc_fun_section, lsd)
...
Definition xc.F:91
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represent a keyword in the input
represent a section of the input file