(git:97501a3)
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%lrho1_eq_lrho0 = .false.
946 qs_control%gapw_control%alpha0_hard_from_input = .false.
947 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
948 CALL section_vals_val_get(qs_section, "FORCE_PAW", l_val=qs_control%gapw_control%force_paw)
949 CALL section_vals_val_get(qs_section, "MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
950
951 CALL section_vals_val_get(qs_section, "MIN_PAIR_LIST_RADIUS", r_val=qs_control%pairlist_radius)
952
953 CALL section_vals_val_get(qs_section, "LS_SCF", l_val=qs_control%do_ls_scf)
954 CALL section_vals_val_get(qs_section, "ALMO_SCF", l_val=qs_control%do_almo_scf)
955 CALL section_vals_val_get(qs_section, "KG_METHOD", l_val=qs_control%do_kg)
956
957 ! Logicals
958 CALL section_vals_val_get(qs_section, "REF_EMBED_SUBSYS", l_val=qs_control%ref_embed_subsys)
959 CALL section_vals_val_get(qs_section, "CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
960 CALL section_vals_val_get(qs_section, "HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
961 CALL section_vals_val_get(qs_section, "DFET_EMBEDDED", l_val=qs_control%dfet_embedded)
962 CALL section_vals_val_get(qs_section, "DMFET_EMBEDDED", l_val=qs_control%dmfet_embedded)
963
964 ! Integers gapw
965 CALL section_vals_val_get(qs_section, "LMAXN1", i_val=qs_control%gapw_control%lmax_sphere)
966 CALL section_vals_val_get(qs_section, "LMAXN0", i_val=qs_control%gapw_control%lmax_rho0)
967 CALL section_vals_val_get(qs_section, "LADDN0", i_val=qs_control%gapw_control%ladd_rho0)
968 CALL section_vals_val_get(qs_section, "QUADRATURE", i_val=qs_control%gapw_control%quadrature)
969 ! GAPW 1c basis
970 CALL section_vals_val_get(qs_section, "GAPW_1C_BASIS", i_val=qs_control%gapw_control%basis_1c)
971 IF (qs_control%gapw_control%basis_1c /= gapw_1c_orb) THEN
972 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
973 END IF
974
975 ! Integers grids
976 CALL section_vals_val_get(qs_section, "PW_GRID", i_val=itmp)
977 SELECT CASE (itmp)
979 qs_control%pw_grid_opt%spherical = .true.
980 qs_control%pw_grid_opt%fullspace = .false.
982 qs_control%pw_grid_opt%spherical = .false.
983 qs_control%pw_grid_opt%fullspace = .true.
985 qs_control%pw_grid_opt%spherical = .false.
986 qs_control%pw_grid_opt%fullspace = .false.
987 END SELECT
988
989 ! Method for PPL calculation
990 CALL section_vals_val_get(qs_section, "CORE_PPL", i_val=itmp)
991 qs_control%do_ppl_method = itmp
992
993 CALL section_vals_val_get(qs_section, "PW_GRID_LAYOUT", i_vals=tmplist)
994 qs_control%pw_grid_opt%distribution_layout = tmplist
995 CALL section_vals_val_get(qs_section, "PW_GRID_BLOCKED", i_val=qs_control%pw_grid_opt%blocked)
996
997 !Integers extrapolation
998 CALL section_vals_val_get(qs_section, "EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
999 CALL section_vals_val_get(qs_section, "EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
1000
1001 !Method
1002 CALL section_vals_val_get(qs_section, "METHOD", i_val=qs_control%method_id)
1003 qs_control%gapw = .false.
1004 qs_control%gapw_xc = .false.
1005 qs_control%gpw = .false.
1006 qs_control%pao = .false.
1007 qs_control%dftb = .false.
1008 qs_control%xtb = .false.
1009 qs_control%semi_empirical = .false.
1010 qs_control%ofgpw = .false.
1011 qs_control%lrigpw = .false.
1012 qs_control%rigpw = .false.
1013 SELECT CASE (qs_control%method_id)
1014 CASE (do_method_gapw)
1015 CALL cite_reference(lippert1999)
1016 CALL cite_reference(krack2000)
1017 qs_control%gapw = .true.
1018 CASE (do_method_gapw_xc)
1019 qs_control%gapw_xc = .true.
1020 CASE (do_method_gpw)
1021 CALL cite_reference(lippert1997)
1022 CALL cite_reference(vandevondele2005a)
1023 qs_control%gpw = .true.
1024 CASE (do_method_ofgpw)
1025 qs_control%ofgpw = .true.
1026 CASE (do_method_lrigpw)
1027 qs_control%lrigpw = .true.
1028 CASE (do_method_rigpw)
1029 qs_control%rigpw = .true.
1030 CASE (do_method_dftb)
1031 qs_control%dftb = .true.
1032 CALL cite_reference(porezag1995)
1033 CALL cite_reference(seifert1996)
1034 CASE (do_method_xtb)
1035 qs_control%xtb = .true.
1036 CALL cite_reference(grimme2017)
1037 CALL cite_reference(pracht2019)
1038 CASE (do_method_mndo)
1039 CALL cite_reference(dewar1977)
1040 qs_control%semi_empirical = .true.
1041 CASE (do_method_am1)
1042 CALL cite_reference(dewar1985)
1043 qs_control%semi_empirical = .true.
1044 CASE (do_method_pm3)
1045 CALL cite_reference(stewart1989)
1046 qs_control%semi_empirical = .true.
1047 CASE (do_method_pnnl)
1048 CALL cite_reference(schenter2008)
1049 qs_control%semi_empirical = .true.
1050 CASE (do_method_pm6)
1051 CALL cite_reference(stewart2007)
1052 qs_control%semi_empirical = .true.
1053 CASE (do_method_pm6fm)
1054 CALL cite_reference(vanvoorhis2015)
1055 qs_control%semi_empirical = .true.
1056 CASE (do_method_pdg)
1057 CALL cite_reference(repasky2002)
1058 qs_control%semi_empirical = .true.
1059 CASE (do_method_rm1)
1060 CALL cite_reference(rocha2006)
1061 qs_control%semi_empirical = .true.
1062 CASE (do_method_mndod)
1063 CALL cite_reference(dewar1977)
1064 CALL cite_reference(thiel1992)
1065 qs_control%semi_empirical = .true.
1066 END SELECT
1067
1068 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1069
1070 IF (qs_control%mulliken_restraint) THEN
1071 CALL section_vals_val_get(mull_section, "STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1072 CALL section_vals_val_get(mull_section, "TARGET", r_val=qs_control%mulliken_restraint_control%target)
1073 CALL section_vals_val_get(mull_section, "ATOMS", n_rep_val=n_rep)
1074 jj = 0
1075 DO k = 1, n_rep
1076 CALL section_vals_val_get(mull_section, "ATOMS", i_rep_val=k, i_vals=tmplist)
1077 jj = jj + SIZE(tmplist)
1078 END DO
1079 qs_control%mulliken_restraint_control%natoms = jj
1080 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1081 cpabort("Need at least 1 atom to use mulliken constraints")
1082 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1083 jj = 0
1084 DO k = 1, n_rep
1085 CALL section_vals_val_get(mull_section, "ATOMS", i_rep_val=k, i_vals=tmplist)
1086 DO j = 1, SIZE(tmplist)
1087 jj = jj + 1
1088 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1089 END DO
1090 END DO
1091 END IF
1092 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1093 IF (qs_control%ddapc_restraint) THEN
1094 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1095 CALL read_ddapc_section(qs_control, qs_section=qs_section)
1096 qs_control%ddapc_restraint_is_spin = .false.
1097 qs_control%ddapc_explicit_potential = .false.
1098 END IF
1099
1100 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1101 IF (qs_control%s2_restraint) THEN
1102 CALL section_vals_val_get(s2_restraint_section, "STRENGTH", &
1103 r_val=qs_control%s2_restraint_control%strength)
1104 CALL section_vals_val_get(s2_restraint_section, "TARGET", &
1105 r_val=qs_control%s2_restraint_control%target)
1106 CALL section_vals_val_get(s2_restraint_section, "FUNCTIONAL_FORM", &
1107 i_val=qs_control%s2_restraint_control%functional_form)
1108 END IF
1109
1110 CALL section_vals_get(cdft_control_section, explicit=qs_control%cdft)
1111 IF (qs_control%cdft) THEN
1112 CALL read_cdft_control_section(qs_control, cdft_control_section)
1113 END IF
1114
1115 ! Semi-empirical code
1116 IF (qs_control%semi_empirical) THEN
1117 CALL section_vals_val_get(se_section, "ORTHOGONAL_BASIS", &
1118 l_val=qs_control%se_control%orthogonal_basis)
1119 CALL section_vals_val_get(se_section, "DELTA", &
1120 r_val=qs_control%se_control%delta)
1121 CALL section_vals_val_get(se_section, "ANALYTICAL_GRADIENTS", &
1122 l_val=qs_control%se_control%analytical_gradients)
1123 CALL section_vals_val_get(se_section, "FORCE_KDSO-D_EXCHANGE", &
1124 l_val=qs_control%se_control%force_kdsod_EX)
1125 ! Integral Screening
1126 CALL section_vals_val_get(se_section, "INTEGRAL_SCREENING", &
1127 i_val=qs_control%se_control%integral_screening)
1128 IF (qs_control%method_id == do_method_pnnl) THEN
1129 IF (qs_control%se_control%integral_screening /= do_se_is_slater) &
1130 CALL cp_warn(__location__, &
1131 "PNNL semi-empirical parameterization supports only the Slater type "// &
1132 "integral scheme. Revert to Slater and continue the calculation.")
1133 qs_control%se_control%integral_screening = do_se_is_slater
1134 END IF
1135 ! Global Arrays variable
1136 CALL section_vals_val_get(se_section, "GA%NCELLS", &
1137 i_val=qs_control%se_control%ga_ncells)
1138 ! Long-Range correction
1139 CALL section_vals_val_get(se_section, "LR_CORRECTION%CUTOFF", &
1140 r_val=qs_control%se_control%cutoff_lrc)
1141 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1142 CALL section_vals_val_get(se_section, "LR_CORRECTION%RC_TAPER", &
1143 explicit=explicit)
1144 IF (explicit) THEN
1145 CALL section_vals_val_get(se_section, "LR_CORRECTION%RC_TAPER", &
1146 r_val=qs_control%se_control%taper_lrc)
1147 END IF
1148 CALL section_vals_val_get(se_section, "LR_CORRECTION%RC_RANGE", &
1149 r_val=qs_control%se_control%range_lrc)
1150 ! Coulomb
1151 CALL section_vals_val_get(se_section, "COULOMB%CUTOFF", &
1152 r_val=qs_control%se_control%cutoff_cou)
1153 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1154 CALL section_vals_val_get(se_section, "COULOMB%RC_TAPER", &
1155 explicit=explicit)
1156 IF (explicit) THEN
1157 CALL section_vals_val_get(se_section, "COULOMB%RC_TAPER", &
1158 r_val=qs_control%se_control%taper_cou)
1159 END IF
1160 CALL section_vals_val_get(se_section, "COULOMB%RC_RANGE", &
1161 r_val=qs_control%se_control%range_cou)
1162 ! Exchange
1163 CALL section_vals_val_get(se_section, "EXCHANGE%CUTOFF", &
1164 r_val=qs_control%se_control%cutoff_exc)
1165 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1166 CALL section_vals_val_get(se_section, "EXCHANGE%RC_TAPER", &
1167 explicit=explicit)
1168 IF (explicit) THEN
1169 CALL section_vals_val_get(se_section, "EXCHANGE%RC_TAPER", &
1170 r_val=qs_control%se_control%taper_exc)
1171 END IF
1172 CALL section_vals_val_get(se_section, "EXCHANGE%RC_RANGE", &
1173 r_val=qs_control%se_control%range_exc)
1174 ! Screening (only if the integral scheme is of dumped type)
1175 IF (qs_control%se_control%integral_screening == do_se_is_kdso_d) THEN
1176 CALL section_vals_val_get(se_section, "SCREENING%RC_TAPER", &
1177 r_val=qs_control%se_control%taper_scr)
1178 CALL section_vals_val_get(se_section, "SCREENING%RC_RANGE", &
1179 r_val=qs_control%se_control%range_scr)
1180 END IF
1181 ! Periodic Type Calculation
1182 CALL section_vals_val_get(se_section, "PERIODIC", &
1183 i_val=qs_control%se_control%periodic_type)
1184 SELECT CASE (qs_control%se_control%periodic_type)
1185 CASE (do_se_lr_none)
1186 qs_control%se_control%do_ewald = .false.
1187 qs_control%se_control%do_ewald_r3 = .false.
1188 qs_control%se_control%do_ewald_gks = .false.
1189 CASE (do_se_lr_ewald)
1190 qs_control%se_control%do_ewald = .true.
1191 qs_control%se_control%do_ewald_r3 = .false.
1192 qs_control%se_control%do_ewald_gks = .false.
1193 CASE (do_se_lr_ewald_gks)
1194 qs_control%se_control%do_ewald = .false.
1195 qs_control%se_control%do_ewald_r3 = .false.
1196 qs_control%se_control%do_ewald_gks = .true.
1197 IF (qs_control%method_id /= do_method_pnnl) &
1198 CALL cp_abort(__location__, &
1199 "A periodic semi-empirical calculation was requested with a long-range "// &
1200 "summation on the single integral evaluation. This scheme is supported "// &
1201 "only by the PNNL parameterization.")
1202 CASE (do_se_lr_ewald_r3)
1203 qs_control%se_control%do_ewald = .true.
1204 qs_control%se_control%do_ewald_r3 = .true.
1205 qs_control%se_control%do_ewald_gks = .false.
1206 IF (qs_control%se_control%integral_screening /= do_se_is_kdso) &
1207 CALL cp_abort(__location__, &
1208 "A periodic semi-empirical calculation was requested with a long-range "// &
1209 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1210 "with the integral screening chosen. The only integral screening supported "// &
1211 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1212 END SELECT
1213
1214 ! dispersion pair potentials
1215 CALL section_vals_val_get(se_section, "DISPERSION", &
1216 l_val=qs_control%se_control%dispersion)
1217 CALL section_vals_val_get(se_section, "DISPERSION_RADIUS", &
1218 r_val=qs_control%se_control%rcdisp)
1219 CALL section_vals_val_get(se_section, "COORDINATION_CUTOFF", &
1220 r_val=qs_control%se_control%epscn)
1221 CALL section_vals_val_get(se_section, "D3_SCALING", r_vals=scal)
1222 qs_control%se_control%sd3(1) = scal(1)
1223 qs_control%se_control%sd3(2) = scal(2)
1224 qs_control%se_control%sd3(3) = scal(3)
1225 CALL section_vals_val_get(se_section, "DISPERSION_PARAMETER_FILE", &
1226 c_val=qs_control%se_control%dispersion_parameter_file)
1227
1228 ! Stop the execution for non-implemented features
1229 IF (qs_control%se_control%periodic_type == do_se_lr_ewald_r3) THEN
1230 cpabort("EWALD_R3 not implemented yet!")
1231 END IF
1232
1233 IF (qs_control%method_id == do_method_mndo .OR. &
1234 qs_control%method_id == do_method_am1 .OR. &
1235 qs_control%method_id == do_method_mndod .OR. &
1236 qs_control%method_id == do_method_pdg .OR. &
1237 qs_control%method_id == do_method_pm3 .OR. &
1238 qs_control%method_id == do_method_pm6 .OR. &
1239 qs_control%method_id == do_method_pm6fm .OR. &
1240 qs_control%method_id == do_method_pnnl .OR. &
1241 qs_control%method_id == do_method_rm1) THEN
1242 qs_control%se_control%orthogonal_basis = .true.
1243 END IF
1244 END IF
1245
1246 ! DFTB code
1247 IF (qs_control%dftb) THEN
1248 CALL section_vals_val_get(dftb_section, "ORTHOGONAL_BASIS", &
1249 l_val=qs_control%dftb_control%orthogonal_basis)
1250 CALL section_vals_val_get(dftb_section, "SELF_CONSISTENT", &
1251 l_val=qs_control%dftb_control%self_consistent)
1252 CALL section_vals_val_get(dftb_section, "DISPERSION", &
1253 l_val=qs_control%dftb_control%dispersion)
1254 CALL section_vals_val_get(dftb_section, "DIAGONAL_DFTB3", &
1255 l_val=qs_control%dftb_control%dftb3_diagonal)
1256 CALL section_vals_val_get(dftb_section, "HB_SR_GAMMA", &
1257 l_val=qs_control%dftb_control%hb_sr_damp)
1258 CALL section_vals_val_get(dftb_section, "EPS_DISP", &
1259 r_val=qs_control%dftb_control%eps_disp)
1260 CALL section_vals_val_get(dftb_section, "DO_EWALD", explicit=explicit)
1261 IF (explicit) THEN
1262 CALL section_vals_val_get(dftb_section, "DO_EWALD", &
1263 l_val=qs_control%dftb_control%do_ewald)
1264 ELSE
1265 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1266 END IF
1267 CALL section_vals_val_get(dftb_parameter, "PARAM_FILE_PATH", &
1268 c_val=qs_control%dftb_control%sk_file_path)
1269 CALL section_vals_val_get(dftb_parameter, "PARAM_FILE_NAME", &
1270 c_val=qs_control%dftb_control%sk_file_list)
1271 CALL section_vals_val_get(dftb_parameter, "HB_SR_PARAM", &
1272 r_val=qs_control%dftb_control%hb_sr_para)
1273 CALL section_vals_val_get(dftb_parameter, "SK_FILE", n_rep_val=n_var)
1274 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1275 DO k = 1, n_var
1276 CALL section_vals_val_get(dftb_parameter, "SK_FILE", i_rep_val=k, &
1277 c_vals=clist)
1278 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1279 END DO
1280 ! Dispersion type
1281 CALL section_vals_val_get(dftb_parameter, "DISPERSION_TYPE", &
1282 i_val=qs_control%dftb_control%dispersion_type)
1283 CALL section_vals_val_get(dftb_parameter, "UFF_FORCE_FIELD", &
1284 c_val=qs_control%dftb_control%uff_force_field)
1285 ! D3 Dispersion
1286 CALL section_vals_val_get(dftb_parameter, "DISPERSION_RADIUS", &
1287 r_val=qs_control%dftb_control%rcdisp)
1288 CALL section_vals_val_get(dftb_parameter, "COORDINATION_CUTOFF", &
1289 r_val=qs_control%dftb_control%epscn)
1290 CALL section_vals_val_get(dftb_parameter, "D2_EXP_PRE", &
1291 r_val=qs_control%dftb_control%exp_pre)
1292 CALL section_vals_val_get(dftb_parameter, "D2_SCALING", &
1293 r_val=qs_control%dftb_control%scaling)
1294 CALL section_vals_val_get(dftb_parameter, "D3_SCALING", r_vals=scal)
1295 qs_control%dftb_control%sd3(1) = scal(1)
1296 qs_control%dftb_control%sd3(2) = scal(2)
1297 qs_control%dftb_control%sd3(3) = scal(3)
1298 CALL section_vals_val_get(dftb_parameter, "D3BJ_SCALING", r_vals=scal)
1299 qs_control%dftb_control%sd3bj(1) = scal(1)
1300 qs_control%dftb_control%sd3bj(2) = scal(2)
1301 qs_control%dftb_control%sd3bj(3) = scal(3)
1302 qs_control%dftb_control%sd3bj(4) = scal(4)
1303 CALL section_vals_val_get(dftb_parameter, "DISPERSION_PARAMETER_FILE", &
1304 c_val=qs_control%dftb_control%dispersion_parameter_file)
1305
1306 IF (qs_control%dftb_control%dispersion) CALL cite_reference(zhechkov2005)
1307 IF (qs_control%dftb_control%self_consistent) CALL cite_reference(elstner1998)
1308 IF (qs_control%dftb_control%hb_sr_damp) CALL cite_reference(hu2007)
1309 END IF
1310
1311 ! xTB code
1312 IF (qs_control%xtb) THEN
1313 CALL section_vals_val_get(xtb_section, "GFN_TYPE", i_val=qs_control%xtb_control%gfn_type)
1314 CALL section_vals_val_get(xtb_section, "DO_EWALD", explicit=explicit)
1315 IF (explicit) THEN
1316 CALL section_vals_val_get(xtb_section, "DO_EWALD", &
1317 l_val=qs_control%xtb_control%do_ewald)
1318 ELSE
1319 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1320 END IF
1321 ! vdW
1322 CALL section_vals_val_get(xtb_section, "VDW_POTENTIAL", explicit=explicit)
1323 IF (explicit) THEN
1324 CALL section_vals_val_get(xtb_section, "VDW_POTENTIAL", c_val=cval)
1325 CALL uppercase(cval)
1326 SELECT CASE (cval)
1327 CASE ("NONE")
1328 qs_control%xtb_control%vdw_type = xtb_vdw_type_none
1329 CASE ("DFTD3")
1330 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1331 CASE ("DFTD4")
1332 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1333 CASE DEFAULT
1334 cpabort("vdW type")
1335 END SELECT
1336 ELSE
1337 SELECT CASE (qs_control%xtb_control%gfn_type)
1338 CASE (0)
1339 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1340 CASE (1)
1341 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1342 CASE (2)
1343 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1344 cpabort("gfn2-xtb tbd")
1345 CASE DEFAULT
1346 cpabort("GFN type")
1347 END SELECT
1348 END IF
1349 !
1350 CALL section_vals_val_get(xtb_section, "STO_NG", i_val=ngauss)
1351 qs_control%xtb_control%sto_ng = ngauss
1352 CALL section_vals_val_get(xtb_section, "HYDROGEN_STO_NG", i_val=ngauss)
1353 qs_control%xtb_control%h_sto_ng = ngauss
1354 CALL section_vals_val_get(xtb_parameter, "PARAM_FILE_PATH", &
1355 c_val=qs_control%xtb_control%parameter_file_path)
1356 CALL section_vals_val_get(xtb_parameter, "PARAM_FILE_NAME", explicit=explicit)
1357 IF (explicit) THEN
1358 CALL section_vals_val_get(xtb_parameter, "PARAM_FILE_NAME", &
1359 c_val=qs_control%xtb_control%parameter_file_name)
1360 ELSE
1361 SELECT CASE (qs_control%xtb_control%gfn_type)
1362 CASE (0)
1363 qs_control%xtb_control%parameter_file_name = "xTB0_parameters"
1364 CASE (1)
1365 qs_control%xtb_control%parameter_file_name = "xTB1_parameters"
1366 CASE (2)
1367 cpabort("gfn2-xtb tbd")
1368 CASE DEFAULT
1369 cpabort("GFN type")
1370 END SELECT
1371 END IF
1372 ! D3 Dispersion
1373 CALL section_vals_val_get(xtb_parameter, "DISPERSION_RADIUS", &
1374 r_val=qs_control%xtb_control%rcdisp)
1375 CALL section_vals_val_get(xtb_parameter, "COORDINATION_CUTOFF", &
1376 r_val=qs_control%xtb_control%epscn)
1377 CALL section_vals_val_get(xtb_parameter, "D3BJ_SCALING", explicit=explicit)
1378 IF (explicit) THEN
1379 CALL section_vals_val_get(xtb_parameter, "D3BJ_SCALING", r_vals=scal)
1380 qs_control%xtb_control%s6 = scal(1)
1381 qs_control%xtb_control%s8 = scal(2)
1382 ELSE
1383 SELECT CASE (qs_control%xtb_control%gfn_type)
1384 CASE (0)
1385 qs_control%xtb_control%s6 = 1.00_dp
1386 qs_control%xtb_control%s8 = 2.85_dp
1387 CASE (1)
1388 qs_control%xtb_control%s6 = 1.00_dp
1389 qs_control%xtb_control%s8 = 2.40_dp
1390 CASE (2)
1391 cpabort("gfn2-xtb tbd")
1392 CASE DEFAULT
1393 cpabort("GFN type")
1394 END SELECT
1395 END IF
1396 CALL section_vals_val_get(xtb_parameter, "D3BJ_PARAM", explicit=explicit)
1397 IF (explicit) THEN
1398 CALL section_vals_val_get(xtb_parameter, "D3BJ_PARAM", r_vals=scal)
1399 qs_control%xtb_control%a1 = scal(1)
1400 qs_control%xtb_control%a2 = scal(2)
1401 ELSE
1402 SELECT CASE (qs_control%xtb_control%gfn_type)
1403 CASE (0)
1404 qs_control%xtb_control%a1 = 0.80_dp
1405 qs_control%xtb_control%a2 = 4.60_dp
1406 CASE (1)
1407 qs_control%xtb_control%a1 = 0.63_dp
1408 qs_control%xtb_control%a2 = 5.00_dp
1409 CASE (2)
1410 cpabort("gfn2-xtb tbd")
1411 CASE DEFAULT
1412 cpabort("GFN type")
1413 END SELECT
1414 END IF
1415 CALL section_vals_val_get(xtb_parameter, "DISPERSION_PARAMETER_FILE", &
1416 c_val=qs_control%xtb_control%dispersion_parameter_file)
1417 ! global parameters
1418 CALL section_vals_val_get(xtb_parameter, "HUCKEL_CONSTANTS", explicit=explicit)
1419 IF (explicit) THEN
1420 CALL section_vals_val_get(xtb_parameter, "HUCKEL_CONSTANTS", r_vals=scal)
1421 qs_control%xtb_control%ks = scal(1)
1422 qs_control%xtb_control%kp = scal(2)
1423 qs_control%xtb_control%kd = scal(3)
1424 qs_control%xtb_control%ksp = scal(4)
1425 qs_control%xtb_control%k2sh = scal(5)
1426 IF (qs_control%xtb_control%gfn_type == 0) THEN
1427 ! enforce ksp for gfn0
1428 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1429 END IF
1430 ELSE
1431 SELECT CASE (qs_control%xtb_control%gfn_type)
1432 CASE (0)
1433 qs_control%xtb_control%ks = 2.00_dp
1434 qs_control%xtb_control%kp = 2.4868_dp
1435 qs_control%xtb_control%kd = 2.27_dp
1436 qs_control%xtb_control%ksp = 2.2434_dp
1437 qs_control%xtb_control%k2sh = 1.1241_dp
1438 CASE (1)
1439 qs_control%xtb_control%ks = 1.85_dp
1440 qs_control%xtb_control%kp = 2.25_dp
1441 qs_control%xtb_control%kd = 2.00_dp
1442 qs_control%xtb_control%ksp = 2.08_dp
1443 qs_control%xtb_control%k2sh = 2.85_dp
1444 CASE (2)
1445 cpabort("gfn2-xtb tbd")
1446 CASE DEFAULT
1447 cpabort("GFN type")
1448 END SELECT
1449 END IF
1450 CALL section_vals_val_get(xtb_parameter, "COULOMB_CONSTANTS", explicit=explicit)
1451 IF (explicit) THEN
1452 CALL section_vals_val_get(xtb_parameter, "COULOMB_CONSTANTS", r_vals=scal)
1453 qs_control%xtb_control%kg = scal(1)
1454 qs_control%xtb_control%kf = scal(2)
1455 ELSE
1456 SELECT CASE (qs_control%xtb_control%gfn_type)
1457 CASE (0)
1458 qs_control%xtb_control%kg = 2.00_dp
1459 qs_control%xtb_control%kf = 1.50_dp
1460 CASE (1)
1461 qs_control%xtb_control%kg = 2.00_dp
1462 qs_control%xtb_control%kf = 1.50_dp
1463 CASE (2)
1464 cpabort("gfn2-xtb tbd")
1465 CASE DEFAULT
1466 cpabort("GFN type")
1467 END SELECT
1468 END IF
1469 CALL section_vals_val_get(xtb_parameter, "CN_CONSTANTS", r_vals=scal)
1470 qs_control%xtb_control%kcns = scal(1)
1471 qs_control%xtb_control%kcnp = scal(2)
1472 qs_control%xtb_control%kcnd = scal(3)
1473 !
1474 CALL section_vals_val_get(xtb_parameter, "EN_CONSTANTS", explicit=explicit)
1475 IF (explicit) THEN
1476 CALL section_vals_val_get(xtb_parameter, "EN_CONSTANTS", r_vals=scal)
1477 SELECT CASE (qs_control%xtb_control%gfn_type)
1478 CASE (0)
1479 qs_control%xtb_control%ksen = scal(1)
1480 qs_control%xtb_control%kpen = scal(2)
1481 qs_control%xtb_control%kden = scal(3)
1482 CASE (1)
1483 qs_control%xtb_control%ken = scal(1)
1484 CASE (2)
1485 cpabort("gfn2-xtb tbd")
1486 CASE DEFAULT
1487 cpabort("GFN type")
1488 END SELECT
1489 ELSE
1490 SELECT CASE (qs_control%xtb_control%gfn_type)
1491 CASE (0)
1492 qs_control%xtb_control%ksen = 0.006_dp
1493 qs_control%xtb_control%kpen = -0.001_dp
1494 qs_control%xtb_control%kden = -0.002_dp
1495 CASE (1)
1496 qs_control%xtb_control%ken = -0.007_dp
1497 CASE (2)
1498 cpabort("gfn2-xtb tbd")
1499 CASE DEFAULT
1500 cpabort("GFN type")
1501 END SELECT
1502 END IF
1503 ! ben
1504 CALL section_vals_val_get(xtb_parameter, "BEN_CONSTANT", r_vals=scal)
1505 qs_control%xtb_control%ben = scal(1)
1506 ! enscale (hidden parameter in repulsion
1507 CALL section_vals_val_get(xtb_parameter, "ENSCALE", explicit=explicit)
1508 IF (explicit) THEN
1509 CALL section_vals_val_get(xtb_parameter, "ENSCALE", &
1510 r_val=qs_control%xtb_control%enscale)
1511 ELSE
1512 SELECT CASE (qs_control%xtb_control%gfn_type)
1513 CASE (0)
1514 qs_control%xtb_control%enscale = -0.09_dp
1515 CASE (1)
1516 qs_control%xtb_control%enscale = 0._dp
1517 CASE (2)
1518 cpabort("gfn2-xtb tbd")
1519 CASE DEFAULT
1520 cpabort("GFN type")
1521 END SELECT
1522 END IF
1523 ! XB
1524 CALL section_vals_val_get(xtb_section, "USE_HALOGEN_CORRECTION", &
1525 l_val=qs_control%xtb_control%xb_interaction)
1526 CALL section_vals_val_get(xtb_parameter, "HALOGEN_BINDING", r_vals=scal)
1527 qs_control%xtb_control%kxr = scal(1)
1528 qs_control%xtb_control%kx2 = scal(2)
1529 ! NONBONDED interactions
1530 CALL section_vals_val_get(xtb_section, "DO_NONBONDED", &
1531 l_val=qs_control%xtb_control%do_nonbonded)
1532 CALL section_vals_get(nonbonded_section, explicit=explicit)
1533 IF (explicit .AND. qs_control%xtb_control%do_nonbonded) THEN
1534 CALL section_vals_get(genpot_section, explicit=explicit, n_repetition=ngp)
1535 IF (explicit) THEN
1536 CALL pair_potential_reallocate(qs_control%xtb_control%nonbonded, 1, ngp, gp=.true.)
1537 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1538 END IF
1539 END IF !nonbonded
1540 CALL section_vals_val_get(xtb_section, "EPS_PAIRPOTENTIAL", &
1541 r_val=qs_control%xtb_control%eps_pair)
1542 ! SR Coulomb
1543 CALL section_vals_val_get(xtb_parameter, "COULOMB_SR_CUT", r_vals=scal)
1544 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1545 CALL section_vals_val_get(xtb_parameter, "COULOMB_SR_EPS", r_vals=scal)
1546 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1547 ! XB_radius
1548 CALL section_vals_val_get(xtb_parameter, "XB_RADIUS", r_val=qs_control%xtb_control%xb_radius)
1549 ! Kab
1550 CALL section_vals_val_get(xtb_parameter, "KAB_PARAM", n_rep_val=n_rep)
1551 ! Coulomb
1552 SELECT CASE (qs_control%xtb_control%gfn_type)
1553 CASE (0)
1554 qs_control%xtb_control%coulomb_interaction = .false.
1555 qs_control%xtb_control%coulomb_lr = .false.
1556 qs_control%xtb_control%tb3_interaction = .false.
1557 qs_control%xtb_control%check_atomic_charges = .false.
1558 CALL section_vals_val_get(xtb_section, "VARIATIONAL_DIPOLE", &
1559 l_val=qs_control%xtb_control%var_dipole)
1560 CASE (1)
1561 ! For debugging purposes
1562 CALL section_vals_val_get(xtb_section, "COULOMB_INTERACTION", &
1563 l_val=qs_control%xtb_control%coulomb_interaction)
1564 CALL section_vals_val_get(xtb_section, "COULOMB_LR", &
1565 l_val=qs_control%xtb_control%coulomb_lr)
1566 CALL section_vals_val_get(xtb_section, "TB3_INTERACTION", &
1567 l_val=qs_control%xtb_control%tb3_interaction)
1568 ! Check for bad atomic charges
1569 CALL section_vals_val_get(xtb_section, "CHECK_ATOMIC_CHARGES", &
1570 l_val=qs_control%xtb_control%check_atomic_charges)
1571 qs_control%xtb_control%var_dipole = .false.
1572 CASE (2)
1573 cpabort("gfn2-xtb tbd")
1574 CASE DEFAULT
1575 cpabort("GFN type")
1576 END SELECT
1577 qs_control%xtb_control%kab_nval = n_rep
1578 IF (n_rep > 0) THEN
1579 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1580 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1581 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1582 DO j = 1, n_rep
1583 CALL section_vals_val_get(xtb_parameter, "KAB_PARAM", i_rep_val=j, c_vals=clist)
1584 qs_control%xtb_control%kab_param(1, j) = clist(1)
1585 CALL get_ptable_info(clist(1), &
1586 ielement=qs_control%xtb_control%kab_types(1, j))
1587 qs_control%xtb_control%kab_param(2, j) = clist(2)
1588 CALL get_ptable_info(clist(2), &
1589 ielement=qs_control%xtb_control%kab_types(2, j))
1590 qs_control%xtb_control%kab_param(3, j) = clist(3)
1591 READ (clist(3), '(F10.0)') qs_control%xtb_control%kab_vals(j)
1592 END DO
1593 END IF
1594
1595 IF (qs_control%xtb_control%gfn_type == 0) THEN
1596 CALL section_vals_val_get(xtb_parameter, "SRB_PARAMETER", r_vals=scal)
1597 qs_control%xtb_control%ksrb = scal(1)
1598 qs_control%xtb_control%esrb = scal(2)
1599 qs_control%xtb_control%gscal = scal(3)
1600 qs_control%xtb_control%c1srb = scal(4)
1601 qs_control%xtb_control%c2srb = scal(5)
1602 qs_control%xtb_control%shift = scal(6)
1603 END IF
1604
1605 CALL section_vals_val_get(xtb_section, "EN_SHIFT_TYPE", c_val=cval)
1606 CALL uppercase(cval)
1607 SELECT CASE (trim(cval))
1608 CASE ("SELECT")
1609 qs_control%xtb_control%enshift_type = 0
1610 CASE ("MOLECULE")
1611 qs_control%xtb_control%enshift_type = 1
1612 CASE ("CRYSTAL")
1613 qs_control%xtb_control%enshift_type = 2
1614 CASE DEFAULT
1615 cpabort("Unknown value for EN_SHIFT_TYPE")
1616 END SELECT
1617
1618 ! EEQ solver params
1619 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1620
1621 END IF
1622
1623 ! Optimize LRI basis set
1624 CALL section_vals_get(lri_optbas_section, explicit=qs_control%lri_optbas)
1625
1626 ! Use instead the tblite
1627 CALL section_vals_val_get(xtb_tblite, "_SECTION_PARAMETERS_", &
1628 l_val=qs_control%xtb_control%do_tblite)
1629 CALL section_vals_val_get(xtb_tblite, "METHOD", &
1630 i_val=qs_control%xtb_control%tblite_method)
1631 IF (qs_control%xtb_control%do_tblite) THEN
1632 CALL cite_reference(caldeweyher2017)
1633 CALL cite_reference(caldeweyher2020)
1634 CALL cite_reference(asgeirsson2017)
1635 CALL cite_reference(grimme2017)
1636 CALL cite_reference(bannwarth2019)
1637 !Ewald sum included in tblite
1638 qs_control%xtb_control%do_ewald = .false.
1639 END IF
1640
1641 CALL timestop(handle)
1642 END SUBROUTINE read_qs_section
1643
1644! **************************************************************************************************
1645!> \brief Read TDDFPT-related input parameters.
1646!> \param t_control TDDFPT control parameters
1647!> \param t_section TDDFPT input section
1648!> \param qs_control Quickstep control parameters
1649! **************************************************************************************************
1650 SUBROUTINE read_tddfpt2_control(t_control, t_section, qs_control)
1651 TYPE(tddfpt2_control_type), POINTER :: t_control
1652 TYPE(section_vals_type), POINTER :: t_section
1653 TYPE(qs_control_type), POINTER :: qs_control
1654
1655 CHARACTER(LEN=*), PARAMETER :: routinen = 'read_tddfpt2_control'
1656
1657 CHARACTER(LEN=default_string_length), &
1658 DIMENSION(:), POINTER :: tmpstringlist
1659 INTEGER :: handle, irep, isize, nrep
1660 INTEGER, ALLOCATABLE, DIMENSION(:) :: inds
1661 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1662 multigrid_set
1663 REAL(kind=dp) :: filter, fval, hfx
1664 TYPE(section_vals_type), POINTER :: dipole_section, mgrid_section, &
1665 soc_section, stda_section, xc_func, &
1666 xc_section
1667
1668 CALL timeset(routinen, handle)
1669
1670 CALL section_vals_val_get(t_section, "_SECTION_PARAMETERS_", l_val=t_control%enabled)
1671
1672 CALL section_vals_val_get(t_section, "NSTATES", i_val=t_control%nstates)
1673 CALL section_vals_val_get(t_section, "MAX_ITER", i_val=t_control%niters)
1674 CALL section_vals_val_get(t_section, "MAX_KV", i_val=t_control%nkvs)
1675 CALL section_vals_val_get(t_section, "NLUMO", i_val=t_control%nlumo)
1676 CALL section_vals_val_get(t_section, "NPROC_STATE", i_val=t_control%nprocs)
1677 CALL section_vals_val_get(t_section, "KERNEL", i_val=t_control%kernel)
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, "ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1691 CALL section_vals_val_get(t_section, "ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1692 CALL section_vals_val_get(t_section, "EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
1693 CALL section_vals_val_get(t_section, "DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
1694
1695 ! read automatically generated auxiliary basis for LRI
1696 CALL section_vals_val_get(t_section, "AUTO_BASIS", n_rep_val=nrep)
1697 DO irep = 1, nrep
1698 CALL section_vals_val_get(t_section, "AUTO_BASIS", i_rep_val=irep, c_vals=tmpstringlist)
1699 IF (SIZE(tmpstringlist) == 2) THEN
1700 CALL uppercase(tmpstringlist(2))
1701 SELECT CASE (tmpstringlist(2))
1702 CASE ("X")
1703 isize = -1
1704 CASE ("SMALL")
1705 isize = 0
1706 CASE ("MEDIUM")
1707 isize = 1
1708 CASE ("LARGE")
1709 isize = 2
1710 CASE ("HUGE")
1711 isize = 3
1712 CASE DEFAULT
1713 cpabort("Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1714 END SELECT
1715 !
1716 SELECT CASE (tmpstringlist(1))
1717 CASE ("X")
1718 CASE ("P_LRI_AUX")
1719 t_control%auto_basis_p_lri_aux = isize
1720 CASE DEFAULT
1721 cpabort("Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1722 END SELECT
1723 ELSE
1724 CALL cp_abort(__location__, &
1725 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1726 END IF
1727 END DO
1728
1729 IF (t_control%conv < 0) &
1730 t_control%conv = abs(t_control%conv)
1731
1732 ! DIPOLE_MOMENTS subsection
1733 dipole_section => section_vals_get_subs_vals(t_section, "DIPOLE_MOMENTS")
1734 CALL section_vals_val_get(dipole_section, "DIPOLE_FORM", explicit=explicit)
1735 IF (explicit) THEN
1736 CALL section_vals_val_get(dipole_section, "DIPOLE_FORM", i_val=t_control%dipole_form)
1737 ELSE
1738 t_control%dipole_form = 0
1739 END IF
1740 CALL section_vals_val_get(dipole_section, "REFERENCE", i_val=t_control%dipole_reference)
1741 CALL section_vals_val_get(dipole_section, "REFERENCE_POINT", explicit=explicit)
1742 IF (explicit) THEN
1743 CALL section_vals_val_get(dipole_section, "REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1744 ELSE
1745 NULLIFY (t_control%dipole_ref_point)
1746 IF (t_control%dipole_form == tddfpt_dipole_length .AND. t_control%dipole_reference == use_mom_ref_user) THEN
1747 cpabort("User-defined reference point should be given explicitly")
1748 END IF
1749 END IF
1750
1751 !SOC subsection
1752 soc_section => section_vals_get_subs_vals(t_section, "SOC")
1753 CALL section_vals_get(soc_section, explicit=explicit)
1754 IF (explicit) THEN
1755 t_control%do_soc = .true.
1756 END IF
1757
1758 ! MGRID subsection
1759 mgrid_section => section_vals_get_subs_vals(t_section, "MGRID")
1760 CALL section_vals_get(mgrid_section, explicit=t_control%mgrid_is_explicit)
1761
1762 IF (t_control%mgrid_is_explicit) THEN
1763 CALL section_vals_val_get(mgrid_section, "NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1764 IF (.NOT. explicit) t_control%mgrid_ngrids = SIZE(qs_control%e_cutoff)
1765
1766 CALL section_vals_val_get(mgrid_section, "CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1767 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1768
1769 CALL section_vals_val_get(mgrid_section, "PROGRESSION_FACTOR", &
1770 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1771 IF (explicit) THEN
1772 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1773 CALL cp_abort(__location__, &
1774 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1775 ELSE
1776 t_control%mgrid_progression_factor = qs_control%progression_factor
1777 END IF
1778
1779 CALL section_vals_val_get(mgrid_section, "COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1780 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1781 IF (t_control%mgrid_commensurate_mgrids) THEN
1782 IF (explicit) THEN
1783 t_control%mgrid_progression_factor = 4.0_dp
1784 ELSE
1785 t_control%mgrid_progression_factor = qs_control%progression_factor
1786 END IF
1787 END IF
1788
1789 CALL section_vals_val_get(mgrid_section, "REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1790 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1791
1792 CALL section_vals_val_get(mgrid_section, "MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1793 IF (.NOT. explicit) multigrid_set = .false.
1794 IF (multigrid_set) THEN
1795 CALL section_vals_val_get(mgrid_section, "MULTIGRID_CUTOFF", r_vals=t_control%mgrid_e_cutoff)
1796 ELSE
1797 NULLIFY (t_control%mgrid_e_cutoff)
1798 END IF
1799
1800 CALL section_vals_val_get(mgrid_section, "REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1801 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1802
1803 CALL section_vals_val_get(mgrid_section, "SKIP_LOAD_BALANCE_DISTRIBUTED", &
1804 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1805 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1806
1807 IF (ASSOCIATED(t_control%mgrid_e_cutoff)) THEN
1808 IF (SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1809 cpabort("Inconsistent values for number of multi-grids")
1810
1811 ! sort multi-grids in descending order according to their cutoff values
1812 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1813 ALLOCATE (inds(t_control%mgrid_ngrids))
1814 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1815 DEALLOCATE (inds)
1816 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1817 END IF
1818 END IF
1819
1820 ! expand XC subsection (if given explicitly)
1821 xc_section => section_vals_get_subs_vals(t_section, "XC")
1822 xc_func => section_vals_get_subs_vals(xc_section, "XC_FUNCTIONAL")
1823 CALL section_vals_get(xc_func, explicit=explicit)
1824 IF (explicit) &
1825 CALL xc_functionals_expand(xc_func, xc_section)
1826
1827 ! sTDA subsection
1828 stda_section => section_vals_get_subs_vals(t_section, "STDA")
1829 IF (t_control%kernel == tddfpt_kernel_stda) THEN
1830 t_control%stda_control%hfx_fraction = 0.0_dp
1831 t_control%stda_control%do_exchange = .true.
1832 t_control%stda_control%eps_td_filter = 1.e-10_dp
1833 t_control%stda_control%mn_alpha = -99.0_dp
1834 t_control%stda_control%mn_beta = -99.0_dp
1835 ! set default for Ewald method (on/off) dependent on periodicity
1836 SELECT CASE (qs_control%periodicity)
1837 CASE (0)
1838 t_control%stda_control%do_ewald = .false.
1839 CASE (1)
1840 t_control%stda_control%do_ewald = .true.
1841 CASE (2)
1842 t_control%stda_control%do_ewald = .true.
1843 CASE (3)
1844 t_control%stda_control%do_ewald = .true.
1845 CASE DEFAULT
1846 cpabort("Illegal value for periodiciy")
1847 END SELECT
1848 CALL section_vals_get(stda_section, explicit=explicit)
1849 IF (explicit) THEN
1850 CALL section_vals_val_get(stda_section, "HFX_FRACTION", r_val=hfx, explicit=expl)
1851 IF (expl) t_control%stda_control%hfx_fraction = hfx
1852 CALL section_vals_val_get(stda_section, "EPS_TD_FILTER", r_val=filter, explicit=expl)
1853 IF (expl) t_control%stda_control%eps_td_filter = filter
1854 CALL section_vals_val_get(stda_section, "DO_EWALD", l_val=do_ewald, explicit=expl)
1855 IF (expl) t_control%stda_control%do_ewald = do_ewald
1856 CALL section_vals_val_get(stda_section, "DO_EXCHANGE", l_val=do_exchange, explicit=expl)
1857 IF (expl) t_control%stda_control%do_exchange = do_exchange
1858 CALL section_vals_val_get(stda_section, "MATAGA_NISHIMOTO_CEXP", r_val=fval)
1859 t_control%stda_control%mn_alpha = fval
1860 CALL section_vals_val_get(stda_section, "MATAGA_NISHIMOTO_XEXP", r_val=fval)
1861 t_control%stda_control%mn_beta = fval
1862 END IF
1863 CALL section_vals_val_get(stda_section, "COULOMB_SR_CUT", r_val=fval)
1864 t_control%stda_control%coulomb_sr_cut = fval
1865 CALL section_vals_val_get(stda_section, "COULOMB_SR_EPS", r_val=fval)
1866 t_control%stda_control%coulomb_sr_eps = fval
1867 END IF
1868
1869 CALL timestop(handle)
1870 END SUBROUTINE read_tddfpt2_control
1871
1872! **************************************************************************************************
1873!> \brief Write the DFT control parameters to the output unit.
1874!> \param dft_control ...
1875!> \param dft_section ...
1876! **************************************************************************************************
1877 SUBROUTINE write_dft_control(dft_control, dft_section)
1878 TYPE(dft_control_type), POINTER :: dft_control
1879 TYPE(section_vals_type), POINTER :: dft_section
1880
1881 CHARACTER(len=*), PARAMETER :: routinen = 'write_dft_control'
1882
1883 CHARACTER(LEN=20) :: tmpstr
1884 INTEGER :: handle, i, i_rep, n_rep, output_unit
1885 REAL(kind=dp) :: density_cut, density_smooth_cut_range, &
1886 gradient_cut, tau_cut
1887 TYPE(cp_logger_type), POINTER :: logger
1888 TYPE(enumeration_type), POINTER :: enum
1889 TYPE(keyword_type), POINTER :: keyword
1890 TYPE(section_type), POINTER :: section
1891 TYPE(section_vals_type), POINTER :: xc_section
1892
1893 IF (dft_control%qs_control%semi_empirical) RETURN
1894 IF (dft_control%qs_control%dftb) RETURN
1895 IF (dft_control%qs_control%xtb) THEN
1896 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1897 RETURN
1898 END IF
1899 CALL timeset(routinen, handle)
1900
1901 NULLIFY (logger)
1902 logger => cp_get_default_logger()
1903
1904 output_unit = cp_print_key_unit_nr(logger, dft_section, &
1905 "PRINT%DFT_CONTROL_PARAMETERS", extension=".Log")
1906
1907 IF (output_unit > 0) THEN
1908
1909 xc_section => section_vals_get_subs_vals(dft_section, "XC")
1910
1911 IF (dft_control%uks) THEN
1912 WRITE (unit=output_unit, fmt="(/,T2,A,T78,A)") &
1913 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation", "UKS"
1914 ELSE IF (dft_control%roks) THEN
1915 WRITE (unit=output_unit, fmt="(/,T2,A,T77,A)") &
1916 "DFT| Spin restricted open Kohn-Sham calculation", "ROKS"
1917 ELSE
1918 WRITE (unit=output_unit, fmt="(/,T2,A,T78,A)") &
1919 "DFT| Spin restricted Kohn-Sham (RKS) calculation", "RKS"
1920 END IF
1921
1922 WRITE (unit=output_unit, fmt="(T2,A,T76,I5)") &
1923 "DFT| Multiplicity", dft_control%multiplicity
1924 WRITE (unit=output_unit, fmt="(T2,A,T76,I5)") &
1925 "DFT| Number of spin states", dft_control%nspins
1926
1927 WRITE (unit=output_unit, fmt="(T2,A,T76,I5)") &
1928 "DFT| Charge", dft_control%charge
1929
1930 IF (dft_control%sic_method_id .NE. sic_none) CALL cite_reference(vandevondele2005b)
1931 SELECT CASE (dft_control%sic_method_id)
1932 CASE (sic_none)
1933 tmpstr = "NO"
1934 CASE (sic_mauri_spz)
1935 tmpstr = "SPZ/MAURI SIC"
1936 CASE (sic_mauri_us)
1937 tmpstr = "US/MAURI SIC"
1938 CASE (sic_ad)
1939 tmpstr = "AD SIC"
1940 CASE (sic_eo)
1941 tmpstr = "Explicit Orbital SIC"
1942 CASE DEFAULT
1943 ! fix throughout the cp2k for this option
1944 cpabort("SIC option unknown")
1945 END SELECT
1946
1947 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
1948 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1949
1950 IF (dft_control%sic_method_id /= sic_none) THEN
1951 WRITE (unit=output_unit, fmt="(T2,A,T66,ES15.6)") &
1952 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1953 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1954 END IF
1955
1956 IF (dft_control%sic_method_id == sic_eo) THEN
1957 IF (dft_control%sic_list_id == sic_list_all) THEN
1958 WRITE (unit=output_unit, fmt="(T2,A,T66,A)") &
1959 "DFT| SIC orbitals", "ALL"
1960 END IF
1961 IF (dft_control%sic_list_id == sic_list_unpaired) THEN
1962 WRITE (unit=output_unit, fmt="(T2,A,T66,A)") &
1963 "DFT| SIC orbitals", "UNPAIRED"
1964 END IF
1965 END IF
1966
1967 CALL section_vals_val_get(xc_section, "density_cutoff", r_val=density_cut)
1968 CALL section_vals_val_get(xc_section, "gradient_cutoff", r_val=gradient_cut)
1969 CALL section_vals_val_get(xc_section, "tau_cutoff", r_val=tau_cut)
1970 CALL section_vals_val_get(xc_section, "density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1971
1972 WRITE (unit=output_unit, fmt="(T2,A,T66,ES15.6)") &
1973 "DFT| Cutoffs: density ", density_cut, &
1974 "DFT| gradient", gradient_cut, &
1975 "DFT| tau ", tau_cut, &
1976 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1977 CALL section_vals_val_get(xc_section, "XC_GRID%XC_SMOOTH_RHO", &
1978 c_val=tmpstr)
1979 WRITE (output_unit, '( A, T61, A )') &
1980 " DFT| XC density smoothing ", adjustr(tmpstr)
1981 CALL section_vals_val_get(xc_section, "XC_GRID%XC_DERIV", &
1982 c_val=tmpstr)
1983 WRITE (output_unit, '( A, T61, A )') &
1984 " DFT| XC derivatives ", adjustr(tmpstr)
1985 IF (dft_control%dft_plus_u) THEN
1986 NULLIFY (enum, keyword, section)
1987 CALL create_dft_section(section)
1988 keyword => section_get_keyword(section, "PLUS_U_METHOD")
1989 CALL keyword_get(keyword, enum=enum)
1990 WRITE (unit=output_unit, fmt="(/,T2,A,T41,A40)") &
1991 "DFT+U| Method", adjustr(trim(enum_i2c(enum, dft_control%plus_u_method_id)))
1992 WRITE (unit=output_unit, fmt="(T2,A)") &
1993 "DFT+U| Check atomic kind information for details"
1994 CALL section_release(section)
1995 END IF
1996
1997 WRITE (unit=output_unit, fmt="(A)") ""
1998 CALL xc_write(output_unit, xc_section, dft_control%lsd)
1999
2000 IF (dft_control%apply_period_efield) THEN
2001 WRITE (unit=output_unit, fmt="(A)") ""
2002 IF (dft_control%period_efield%displacement_field) THEN
2003 WRITE (unit=output_unit, fmt="(T2,A)") &
2004 "PERIODIC_EFIELD| Use displacement field formulation"
2005 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,ES14.6)") &
2006 "PERIODIC_EFIELD| Displacement field filter: x", &
2007 dft_control%period_efield%d_filter(1), &
2008 "PERIODIC_EFIELD| y", &
2009 dft_control%period_efield%d_filter(2), &
2010 "PERIODIC_EFIELD| z", &
2011 dft_control%period_efield%d_filter(3)
2012 END IF
2013 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,ES14.6)") &
2014 "PERIODIC_EFIELD| Polarisation vector: x", &
2015 dft_control%period_efield%polarisation(1), &
2016 "PERIODIC_EFIELD| y", &
2017 dft_control%period_efield%polarisation(2), &
2018 "PERIODIC_EFIELD| z", &
2019 dft_control%period_efield%polarisation(3)
2020
2021 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,I14)") &
2022 "PERIODIC_EFIELD| Start Frame:", &
2023 dft_control%period_efield%start_frame, &
2024 "PERIODIC_EFIELD| End Frame:", &
2025 dft_control%period_efield%end_frame
2026
2027 IF (ALLOCATED(dft_control%period_efield%strength_list)) THEN
2028 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,I14)") &
2029 "PERIODIC_EFIELD| Number of Intensities:", &
2030 SIZE(dft_control%period_efield%strength_list)
2031 WRITE (unit=output_unit, fmt="(T2,A,I10,T66,1X,ES14.6)") &
2032 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2033 1, dft_control%period_efield%strength_list(1)
2034 DO i = 2, SIZE(dft_control%period_efield%strength_list)
2035 WRITE (unit=output_unit, fmt="(T2,A,I10,T66,1X,ES14.6)") &
2036 "PERIODIC_EFIELD| ", &
2037 i, dft_control%period_efield%strength_list(i)
2038 END DO
2039 ELSE
2040 WRITE (unit=output_unit, fmt="(T2,A,T66,1X,ES14.6)") &
2041 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2042 dft_control%period_efield%strength
2043 END IF
2044
2045 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
2046 dft_control%period_efield%polarisation)) < epsilon(0.0_dp)) THEN
2047 cpabort("Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2048 END IF
2049 END IF
2050
2051 IF (dft_control%do_sccs) THEN
2052 WRITE (unit=output_unit, fmt="(/,T2,A)") &
2053 "SCCS| Self-consistent continuum solvation model"
2054 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2055 "SCCS| Relative permittivity of the solvent (medium)", &
2056 dft_control%sccs_control%epsilon_solvent, &
2057 "SCCS| Absolute permittivity [a.u.]", &
2058 dft_control%sccs_control%epsilon_solvent/fourpi
2059 SELECT CASE (dft_control%sccs_control%method_id)
2060 CASE (sccs_andreussi)
2061 WRITE (unit=output_unit, fmt="(T2,A,/,(T2,A,T61,ES20.6))") &
2062 "SCCS| Dielectric function proposed by Andreussi et al.", &
2063 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2064 "SCCS| rho_min", dft_control%sccs_control%rho_min
2065 CASE (sccs_fattebert_gygi)
2066 WRITE (unit=output_unit, fmt="(T2,A,/,(T2,A,T61,ES20.6))") &
2067 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2068 "SCCS| beta", dft_control%sccs_control%beta, &
2069 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2070 CASE DEFAULT
2071 cpabort("Invalid SCCS model specified. Please, check your input!")
2072 END SELECT
2073 SELECT CASE (dft_control%sccs_control%derivative_method)
2074 CASE (sccs_derivative_fft)
2075 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2076 "SCCS| Numerical derivative calculation", &
2077 adjustr("FFT")
2078 CASE (sccs_derivative_cd3)
2079 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2080 "SCCS| Numerical derivative calculation", &
2081 adjustr("3-point stencil central differences")
2082 CASE (sccs_derivative_cd5)
2083 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2084 "SCCS| Numerical derivative calculation", &
2085 adjustr("5-point stencil central differences")
2086 CASE (sccs_derivative_cd7)
2087 WRITE (unit=output_unit, fmt="(T2,A,T46,A35)") &
2088 "SCCS| Numerical derivative calculation", &
2089 adjustr("7-point stencil central differences")
2090 CASE DEFAULT
2091 CALL cp_abort(__location__, &
2092 "Invalid derivative method specified for SCCS model. "// &
2093 "Please, check your input!")
2094 END SELECT
2095 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2096 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2097 cp_unit_from_cp2k(dft_control%sccs_control%alpha_solvent, "mN/m")
2098 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2099 "SCCS| Dispersion parameter beta [GPa]", &
2100 cp_unit_from_cp2k(dft_control%sccs_control%beta_solvent, "GPa")
2101 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2102 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2103 cp_unit_from_cp2k(dft_control%sccs_control%gamma_solvent, "mN/m")
2104 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2105 "SCCS| Mixing parameter applied during the iteration cycle", &
2106 dft_control%sccs_control%mixing
2107 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2108 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2109 dft_control%sccs_control%eps_sccs
2110 WRITE (unit=output_unit, fmt="(T2,A,T61,I20)") &
2111 "SCCS| Maximum number of iteration steps", &
2112 dft_control%sccs_control%max_iter
2113 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2114 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2115 dft_control%sccs_control%eps_scf
2116 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2117 "SCCS| Numerical increment for the cavity surface calculation", &
2118 dft_control%sccs_control%delta_rho
2119 END IF
2120
2121 WRITE (unit=output_unit, fmt="(A)") ""
2122
2123 END IF
2124
2125 IF (dft_control%hairy_probes .EQV. .true.) THEN
2126 n_rep = SIZE(dft_control%probe)
2127 IF (output_unit > 0) THEN
2128 DO i_rep = 1, n_rep
2129 WRITE (unit=output_unit, fmt="(T2,A,I5)") &
2130 "HP | hair probe set", i_rep
2131 WRITE (unit=output_unit, fmt="(T2,A,T61,*(I5))") &
2132 "HP| atom indexes", &
2133 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2134 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2135 "HP| potential", dft_control%probe(i_rep)%mu
2136 WRITE (unit=output_unit, fmt="(T2,A,T61,F20.2)") &
2137 "HP| temperature", dft_control%probe(i_rep)%T
2138 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.6)") &
2139 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2140 END DO
2141 END IF
2142 END IF
2143
2144 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2145 "PRINT%DFT_CONTROL_PARAMETERS")
2146
2147 CALL timestop(handle)
2148
2149 END SUBROUTINE write_dft_control
2150
2151! **************************************************************************************************
2152!> \brief Write the ADMM control parameters to the output unit.
2153!> \param admm_control ...
2154!> \param dft_section ...
2155! **************************************************************************************************
2156 SUBROUTINE write_admm_control(admm_control, dft_section)
2157 TYPE(admm_control_type), POINTER :: admm_control
2158 TYPE(section_vals_type), POINTER :: dft_section
2159
2160 INTEGER :: iounit
2161 TYPE(cp_logger_type), POINTER :: logger
2162
2163 NULLIFY (logger)
2164 logger => cp_get_default_logger()
2165
2166 iounit = cp_print_key_unit_nr(logger, dft_section, &
2167 "PRINT%DFT_CONTROL_PARAMETERS", extension=".Log")
2168
2169 IF (iounit > 0) THEN
2170
2171 SELECT CASE (admm_control%admm_type)
2172 CASE (no_admm_type)
2173 WRITE (unit=iounit, fmt="(/,T2,A,T77,A)") "ADMM| Specific ADMM type specified", "NONE"
2174 CASE (admm1_type)
2175 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMM1"
2176 CASE (admm2_type)
2177 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMM2"
2178 CASE (admms_type)
2179 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMMS"
2180 CASE (admmp_type)
2181 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMMP"
2182 CASE (admmq_type)
2183 WRITE (unit=iounit, fmt="(/,T2,A,T76,A)") "ADMM| Specific ADMM type specified", "ADMMQ"
2184 CASE DEFAULT
2185 cpabort("admm_type")
2186 END SELECT
2187
2188 SELECT CASE (admm_control%purification_method)
2189 CASE (do_admm_purify_none)
2190 WRITE (unit=iounit, fmt="(T2,A,T77,A)") "ADMM| Density matrix purification method", "NONE"
2192 WRITE (unit=iounit, fmt="(T2,A,T75,A)") "ADMM| Density matrix purification method", "Cauchy"
2194 WRITE (unit=iounit, fmt="(T2,A,T66,A)") "ADMM| Density matrix purification method", "Cauchy subspace"
2196 WRITE (unit=iounit, fmt="(T2,A,T63,A)") "ADMM| Density matrix purification method", "MO diagonalization"
2198 WRITE (unit=iounit, fmt="(T2,A,T71,A)") "ADMM| Density matrix purification method", "MO no diag"
2200 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Density matrix purification method", "McWeeny"
2202 WRITE (unit=iounit, fmt="(T2,A,T73,A)") "ADMM| Density matrix purification method", "NONE(DM)"
2203 CASE DEFAULT
2204 cpabort("admm_purification_method")
2205 END SELECT
2206
2207 SELECT CASE (admm_control%method)
2209 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Orbital projection on ADMM basis"
2211 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Blocked Fock matrix projection with full purification"
2213 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Blocked Fock matrix projection"
2215 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Orbital projection with charge constrain"
2216 CASE DEFAULT
2217 cpabort("admm method")
2218 END SELECT
2219
2220 SELECT CASE (admm_control%scaling_model)
2223 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| Use Merlot (2014) scaling model"
2224 CASE DEFAULT
2225 cpabort("admm scaling_model")
2226 END SELECT
2227
2228 WRITE (unit=iounit, fmt="(T2,A,T61,G20.10)") "ADMM| eps_filter", admm_control%eps_filter
2229
2230 SELECT CASE (admm_control%aux_exch_func)
2232 WRITE (unit=iounit, fmt="(T2,A)") "ADMM| No exchange functional correction term used"
2234 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Exchange functional in correction term", "(W)PBEX"
2236 WRITE (unit=iounit, fmt="(T2,A,T77,A)") "ADMM| Exchange functional in correction term", "PBEX"
2238 WRITE (unit=iounit, fmt="(T2,A,T77,A)") "ADMM| Exchange functional in correction term", "OPTX"
2240 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Exchange functional in correction term", "Becke88"
2242 WRITE (unit=iounit, fmt="(T2,A,T74,A)") "ADMM| Exchange functional in correction term", "SlaterX"
2243 CASE DEFAULT
2244 cpabort("admm aux_exch_func")
2245 END SELECT
2246
2247 WRITE (unit=iounit, fmt="(A)") ""
2248
2249 END IF
2250
2251 CALL cp_print_key_finished_output(iounit, logger, dft_section, &
2252 "PRINT%DFT_CONTROL_PARAMETERS")
2253 END SUBROUTINE write_admm_control
2254
2255! **************************************************************************************************
2256!> \brief Write the xTB control parameters to the output unit.
2257!> \param xtb_control ...
2258!> \param dft_section ...
2259! **************************************************************************************************
2260 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2261 TYPE(xtb_control_type), POINTER :: xtb_control
2262 TYPE(section_vals_type), POINTER :: dft_section
2263
2264 CHARACTER(len=*), PARAMETER :: routinen = 'write_xtb_control'
2265
2266 INTEGER :: handle, output_unit
2267 TYPE(cp_logger_type), POINTER :: logger
2268
2269 CALL timeset(routinen, handle)
2270 NULLIFY (logger)
2271 logger => cp_get_default_logger()
2272
2273 output_unit = cp_print_key_unit_nr(logger, dft_section, &
2274 "PRINT%DFT_CONTROL_PARAMETERS", extension=".Log")
2275
2276 IF (output_unit > 0) THEN
2277
2278 WRITE (unit=output_unit, fmt="(/,T2,A,T31,A50)") &
2279 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2280 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2281 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2282 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2283 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2284 WRITE (unit=output_unit, fmt="(T2,A,T71,E10.4)") &
2285 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2286 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.6)") &
2287 "xTB| Repulsive enhancement factor", xtb_control%enscale
2288 WRITE (unit=output_unit, fmt="(T2,A,T71,L10)") &
2289 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2290 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2291 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2292 WRITE (unit=output_unit, fmt="(T2,A,T71,L10)") &
2293 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2294 SELECT CASE (xtb_control%vdw_type)
2295 CASE (xtb_vdw_type_none)
2296 WRITE (unit=output_unit, fmt="(T2,A)") "xTB| No vdW potential selected"
2297 CASE (xtb_vdw_type_d3)
2298 WRITE (unit=output_unit, fmt="(T2,A,T72,A)") "xTB| vdW potential type:", "DFTD3(BJ)"
2299 WRITE (unit=output_unit, fmt="(T2,A,T31,A50)") &
2300 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2301 CASE (xtb_vdw_type_d4)
2302 WRITE (unit=output_unit, fmt="(T2,A,T76,A)") "xTB| vdW potential type:", "DFTD4"
2303 WRITE (unit=output_unit, fmt="(T2,A,T31,A50)") &
2304 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2305 CASE DEFAULT
2306 cpabort("vdw type")
2307 END SELECT
2308 WRITE (unit=output_unit, fmt="(T2,A,T51,3F10.3)") &
2309 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2310 WRITE (unit=output_unit, fmt="(T2,A,T61,2F10.3)") &
2311 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2312 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2313 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2314 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2315 "xTB| Repulsion potential exponent", xtb_control%kf
2316 WRITE (unit=output_unit, fmt="(T2,A,T51,3F10.3)") &
2317 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2318 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2319 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.3)") &
2320 "xTB| Electronegativity scaling", xtb_control%ken
2321 WRITE (unit=output_unit, fmt="(T2,A,T61,2F10.3)") &
2322 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2323 WRITE (unit=output_unit, fmt="(/)")
2324
2325 END IF
2326
2327 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2328 "PRINT%DFT_CONTROL_PARAMETERS")
2329
2330 CALL timestop(handle)
2331
2332 END SUBROUTINE write_xtb_control
2333
2334! **************************************************************************************************
2335!> \brief Purpose: Write the QS control parameters to the output unit.
2336!> \param qs_control ...
2337!> \param dft_section ...
2338! **************************************************************************************************
2339 SUBROUTINE write_qs_control(qs_control, dft_section)
2340 TYPE(qs_control_type), INTENT(IN) :: qs_control
2341 TYPE(section_vals_type), POINTER :: dft_section
2342
2343 CHARACTER(len=*), PARAMETER :: routinen = 'write_qs_control'
2344
2345 CHARACTER(len=20) :: method, quadrature
2346 INTEGER :: handle, i, igrid_level, ngrid_level, &
2347 output_unit
2348 TYPE(cp_logger_type), POINTER :: logger
2349 TYPE(ddapc_restraint_type), POINTER :: ddapc_restraint_control
2350 TYPE(enumeration_type), POINTER :: enum
2351 TYPE(keyword_type), POINTER :: keyword
2352 TYPE(section_type), POINTER :: qs_section
2353 TYPE(section_vals_type), POINTER :: print_section_vals, qs_section_vals
2354
2355 IF (qs_control%semi_empirical) RETURN
2356 IF (qs_control%dftb) RETURN
2357 IF (qs_control%xtb) RETURN
2358 CALL timeset(routinen, handle)
2359 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2360 logger => cp_get_default_logger()
2361 print_section_vals => section_vals_get_subs_vals(dft_section, "PRINT")
2362 qs_section_vals => section_vals_get_subs_vals(dft_section, "QS")
2363 CALL section_vals_get(qs_section_vals, section=qs_section)
2364
2365 NULLIFY (enum, keyword)
2366 keyword => section_get_keyword(qs_section, "METHOD")
2367 CALL keyword_get(keyword, enum=enum)
2368 method = trim(enum_i2c(enum, qs_control%method_id))
2369
2370 NULLIFY (enum, keyword)
2371 keyword => section_get_keyword(qs_section, "QUADRATURE")
2372 CALL keyword_get(keyword, enum=enum)
2373 quadrature = trim(enum_i2c(enum, qs_control%gapw_control%quadrature))
2374
2375 output_unit = cp_print_key_unit_nr(logger, print_section_vals, &
2376 "DFT_CONTROL_PARAMETERS", extension=".Log")
2377 IF (output_unit > 0) THEN
2378 ngrid_level = SIZE(qs_control%e_cutoff)
2379 WRITE (unit=output_unit, fmt="(/,T2,A,T61,A20)") &
2380 "QS| Method:", adjustr(method)
2381 IF (qs_control%pw_grid_opt%spherical) THEN
2382 WRITE (unit=output_unit, fmt="(T2,A,T61,A)") &
2383 "QS| Density plane wave grid type", " SPHERICAL HALFSPACE"
2384 ELSE IF (qs_control%pw_grid_opt%fullspace) THEN
2385 WRITE (unit=output_unit, fmt="(T2,A,T57,A)") &
2386 "QS| Density plane wave grid type", " NON-SPHERICAL FULLSPACE"
2387 ELSE
2388 WRITE (unit=output_unit, fmt="(T2,A,T57,A)") &
2389 "QS| Density plane wave grid type", " NON-SPHERICAL HALFSPACE"
2390 END IF
2391 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2392 "QS| Number of grid levels:", SIZE(qs_control%e_cutoff)
2393 IF (ngrid_level == 1) THEN
2394 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2395 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2396 ELSE
2397 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2398 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2399 IF (qs_control%commensurate_mgrids) &
2400 WRITE (unit=output_unit, fmt="(T2,A)") "QS| Using commensurate multigrids"
2401 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2402 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2403 WRITE (unit=output_unit, fmt="(T2,A,I3,A,T71,F10.1)") &
2404 ("QS| ", igrid_level, ") grid level", &
2405 qs_control%e_cutoff(igrid_level), &
2406 igrid_level=2, SIZE(qs_control%e_cutoff))
2407 END IF
2408 IF (qs_control%pao) THEN
2409 WRITE (unit=output_unit, fmt="(T2,A)") "QS| PAO active"
2410 END IF
2411 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2412 "QS| Grid level progression factor:", qs_control%progression_factor
2413 WRITE (unit=output_unit, fmt="(T2,A,T71,F10.1)") &
2414 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2415 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2416 "QS| Interaction thresholds: eps_pgf_orb:", &
2417 qs_control%eps_pgf_orb, &
2418 "QS| eps_filter_matrix:", &
2419 qs_control%eps_filter_matrix, &
2420 "QS| eps_core_charge:", &
2421 qs_control%eps_core_charge, &
2422 "QS| eps_rho_gspace:", &
2423 qs_control%eps_rho_gspace, &
2424 "QS| eps_rho_rspace:", &
2425 qs_control%eps_rho_rspace, &
2426 "QS| eps_gvg_rspace:", &
2427 qs_control%eps_gvg_rspace, &
2428 "QS| eps_ppl:", &
2429 qs_control%eps_ppl, &
2430 "QS| eps_ppnl:", &
2431 qs_control%eps_ppnl
2432 IF (qs_control%gapw) THEN
2433 SELECT CASE (qs_control%gapw_control%basis_1c)
2434 CASE (gapw_1c_orb)
2435 WRITE (unit=output_unit, fmt="(T2,A)") &
2436 "QS| GAPW| One center basis from orbital basis primitives"
2437 CASE (gapw_1c_small)
2438 WRITE (unit=output_unit, fmt="(T2,A)") &
2439 "QS| GAPW| One center basis extended with primitives (small:s)"
2440 CASE (gapw_1c_medium)
2441 WRITE (unit=output_unit, fmt="(T2,A)") &
2442 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2443 CASE (gapw_1c_large)
2444 WRITE (unit=output_unit, fmt="(T2,A)") &
2445 "QS| GAPW| One center basis extended with primitives (large:spd)"
2446 CASE (gapw_1c_very_large)
2447 WRITE (unit=output_unit, fmt="(T2,A)") &
2448 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2449 CASE DEFAULT
2450 cpabort("basis_1c incorrect")
2451 END SELECT
2452 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2453 "QS| GAPW| eps_fit:", &
2454 qs_control%gapw_control%eps_fit, &
2455 "QS| GAPW| eps_iso:", &
2456 qs_control%gapw_control%eps_iso, &
2457 "QS| GAPW| eps_svd:", &
2458 qs_control%gapw_control%eps_svd, &
2459 "QS| GAPW| eps_cpc:", &
2460 qs_control%gapw_control%eps_cpc
2461 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2462 "QS| GAPW| atom-r-grid: quadrature:", &
2463 adjustr(quadrature)
2464 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2465 "QS| GAPW| atom-s-grid: max l :", &
2466 qs_control%gapw_control%lmax_sphere, &
2467 "QS| GAPW| max_l_rho0 :", &
2468 qs_control%gapw_control%lmax_rho0
2469 IF (qs_control%gapw_control%non_paw_atoms) THEN
2470 WRITE (unit=output_unit, fmt="(T2,A)") &
2471 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2472 END IF
2473 IF (qs_control%gapw_control%nopaw_as_gpw) THEN
2474 WRITE (unit=output_unit, fmt="(T2,A)") &
2475 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2476 END IF
2477 END IF
2478 IF (qs_control%gapw_xc) THEN
2479 SELECT CASE (qs_control%gapw_control%basis_1c)
2480 CASE (gapw_1c_orb)
2481 WRITE (unit=output_unit, fmt="(T2,A)") &
2482 "QS| GAPW_XC| One center basis from orbital basis primitives"
2483 CASE (gapw_1c_small)
2484 WRITE (unit=output_unit, fmt="(T2,A)") &
2485 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2486 CASE (gapw_1c_medium)
2487 WRITE (unit=output_unit, fmt="(T2,A)") &
2488 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2489 CASE (gapw_1c_large)
2490 WRITE (unit=output_unit, fmt="(T2,A)") &
2491 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2492 CASE (gapw_1c_very_large)
2493 WRITE (unit=output_unit, fmt="(T2,A)") &
2494 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2495 CASE DEFAULT
2496 cpabort("basis_1c incorrect")
2497 END SELECT
2498 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2499 "QS| GAPW_XC| eps_fit:", &
2500 qs_control%gapw_control%eps_fit, &
2501 "QS| GAPW_XC| eps_iso:", &
2502 qs_control%gapw_control%eps_iso, &
2503 "QS| GAPW_XC| eps_svd:", &
2504 qs_control%gapw_control%eps_svd
2505 WRITE (unit=output_unit, fmt="(T2,A,T55,A30)") &
2506 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2507 enum_i2c(enum, qs_control%gapw_control%quadrature)
2508 WRITE (unit=output_unit, fmt="(T2,A,T71,I10)") &
2509 "QS| GAPW_XC| atom-s-grid: max l :", &
2510 qs_control%gapw_control%lmax_sphere
2511 END IF
2512 IF (qs_control%mulliken_restraint) THEN
2513 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2514 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2515 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2516 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2517 WRITE (unit=output_unit, fmt="(T2,A,T73,I8)") &
2518 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2519 WRITE (unit=output_unit, fmt="(5I8)") qs_control%mulliken_restraint_control%atoms
2520 END IF
2521 IF (qs_control%ddapc_restraint) THEN
2522 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
2523 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2524 IF (SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2525 WRITE (unit=output_unit, fmt="(T2,A,T3,I8)") &
2526 "QS| parameters for DDAPC restraint number", i
2527 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2528 "QS| ddapc restraint target", ddapc_restraint_control%target
2529 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2530 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2531 WRITE (unit=output_unit, fmt="(T2,A,T73,I8)") &
2532 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2533 WRITE (unit=output_unit, fmt="(5I8)") ddapc_restraint_control%atoms
2534 WRITE (unit=output_unit, fmt="(T2,A)") "Coefficients:"
2535 WRITE (unit=output_unit, fmt="(5F6.2)") ddapc_restraint_control%coeff
2536 SELECT CASE (ddapc_restraint_control%functional_form)
2537 CASE (do_ddapc_restraint)
2538 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2539 "QS| ddapc restraint functional form :", "RESTRAINT"
2540 CASE (do_ddapc_constraint)
2541 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2542 "QS| ddapc restraint functional form :", "CONSTRAINT"
2543 CASE DEFAULT
2544 cpabort("Unknown ddapc restraint")
2545 END SELECT
2546 END DO
2547 END IF
2548 IF (qs_control%s2_restraint) THEN
2549 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2550 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2551 WRITE (unit=output_unit, fmt="(T2,A,T73,ES8.1)") &
2552 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2553 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2554 CASE (do_s2_restraint)
2555 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2556 "QS| s2 restraint functional form :", "RESTRAINT"
2557 cpabort("Not yet implemented")
2558 CASE (do_s2_constraint)
2559 WRITE (unit=output_unit, fmt="(T2,A,T61,A20)") &
2560 "QS| s2 restraint functional form :", "CONSTRAINT"
2561 CASE DEFAULT
2562 cpabort("Unknown ddapc restraint")
2563 END SELECT
2564 END IF
2565 END IF
2566 CALL cp_print_key_finished_output(output_unit, logger, print_section_vals, &
2567 "DFT_CONTROL_PARAMETERS")
2568
2569 CALL timestop(handle)
2570
2571 END SUBROUTINE write_qs_control
2572
2573! **************************************************************************************************
2574!> \brief reads the input parameters needed for ddapc.
2575!> \param qs_control ...
2576!> \param qs_section ...
2577!> \param ddapc_restraint_section ...
2578!> \author fschiff
2579!> \note
2580!> either reads DFT%QS%DDAPC_RESTRAINT or PROPERTIES%ET_coupling
2581!> if(qs_section is present the DFT part is read, if ddapc_restraint_section
2582!> is present ET_COUPLING is read. Avoid having both!!!
2583! **************************************************************************************************
2584 SUBROUTINE read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
2585
2586 TYPE(qs_control_type), INTENT(INOUT) :: qs_control
2587 TYPE(section_vals_type), OPTIONAL, POINTER :: qs_section, ddapc_restraint_section
2588
2589 INTEGER :: i, j, jj, k, n_rep
2590 INTEGER, DIMENSION(:), POINTER :: tmplist
2591 REAL(kind=dp), DIMENSION(:), POINTER :: rtmplist
2592 TYPE(ddapc_restraint_type), POINTER :: ddapc_restraint_control
2593 TYPE(section_vals_type), POINTER :: ddapc_section
2594
2595 IF (PRESENT(ddapc_restraint_section)) THEN
2596 IF (ASSOCIATED(qs_control%ddapc_restraint_control)) THEN
2597 IF (SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2598 cpabort("ET_COUPLING cannot be used in combination with a normal restraint")
2599 ELSE
2600 ddapc_section => ddapc_restraint_section
2601 ALLOCATE (qs_control%ddapc_restraint_control(1))
2602 END IF
2603 END IF
2604
2605 IF (PRESENT(qs_section)) THEN
2606 NULLIFY (ddapc_section)
2607 ddapc_section => section_vals_get_subs_vals(qs_section, &
2608 "DDAPC_RESTRAINT")
2609 END IF
2610
2611 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
2612
2613 CALL ddapc_control_create(qs_control%ddapc_restraint_control(i))
2614 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2615
2616 CALL section_vals_val_get(ddapc_section, "STRENGTH", i_rep_section=i, &
2617 r_val=ddapc_restraint_control%strength)
2618 CALL section_vals_val_get(ddapc_section, "TARGET", i_rep_section=i, &
2619 r_val=ddapc_restraint_control%target)
2620 CALL section_vals_val_get(ddapc_section, "FUNCTIONAL_FORM", i_rep_section=i, &
2621 i_val=ddapc_restraint_control%functional_form)
2622 CALL section_vals_val_get(ddapc_section, "ATOMS", i_rep_section=i, &
2623 n_rep_val=n_rep)
2624 CALL section_vals_val_get(ddapc_section, "TYPE_OF_DENSITY", i_rep_section=i, &
2625 i_val=ddapc_restraint_control%density_type)
2626
2627 jj = 0
2628 DO k = 1, n_rep
2629 CALL section_vals_val_get(ddapc_section, "ATOMS", i_rep_section=i, &
2630 i_rep_val=k, i_vals=tmplist)
2631 DO j = 1, SIZE(tmplist)
2632 jj = jj + 1
2633 END DO
2634 END DO
2635 IF (jj < 1) cpabort("Need at least 1 atom to use ddapc constraints")
2636 ddapc_restraint_control%natoms = jj
2637 IF (ASSOCIATED(ddapc_restraint_control%atoms)) &
2638 DEALLOCATE (ddapc_restraint_control%atoms)
2639 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2640 jj = 0
2641 DO k = 1, n_rep
2642 CALL section_vals_val_get(ddapc_section, "ATOMS", i_rep_section=i, &
2643 i_rep_val=k, i_vals=tmplist)
2644 DO j = 1, SIZE(tmplist)
2645 jj = jj + 1
2646 ddapc_restraint_control%atoms(jj) = tmplist(j)
2647 END DO
2648 END DO
2649
2650 IF (ASSOCIATED(ddapc_restraint_control%coeff)) &
2651 DEALLOCATE (ddapc_restraint_control%coeff)
2652 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2653 ddapc_restraint_control%coeff = 1.0_dp
2654
2655 CALL section_vals_val_get(ddapc_section, "COEFF", i_rep_section=i, &
2656 n_rep_val=n_rep)
2657 jj = 0
2658 DO k = 1, n_rep
2659 CALL section_vals_val_get(ddapc_section, "COEFF", i_rep_section=i, &
2660 i_rep_val=k, r_vals=rtmplist)
2661 DO j = 1, SIZE(rtmplist)
2662 jj = jj + 1
2663 IF (jj > ddapc_restraint_control%natoms) &
2664 cpabort("Need the same number of coeff as there are atoms ")
2665 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2666 END DO
2667 END DO
2668 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2669 cpabort("Need no or the same number of coeff as there are atoms.")
2670 END DO
2671 k = 0
2672 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
2673 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2674 do_ddapc_constraint) k = k + 1
2675 END DO
2676 IF (k == 2) CALL cp_abort(__location__, &
2677 "Only a single constraint possible yet, try to use restraints instead ")
2678
2679 END SUBROUTINE read_ddapc_section
2680
2681! **************************************************************************************************
2682!> \brief ...
2683!> \param dft_control ...
2684!> \param efield_section ...
2685! **************************************************************************************************
2686 SUBROUTINE read_efield_sections(dft_control, efield_section)
2687 TYPE(dft_control_type), POINTER :: dft_control
2688 TYPE(section_vals_type), POINTER :: efield_section
2689
2690 CHARACTER(len=default_path_length) :: file_name
2691 INTEGER :: i, io, j, n, unit_nr
2692 REAL(kind=dp), DIMENSION(:), POINTER :: tmp_vals
2693 TYPE(efield_type), POINTER :: efield
2694 TYPE(section_vals_type), POINTER :: tmp_section
2695
2696 DO i = 1, SIZE(dft_control%efield_fields)
2697 NULLIFY (dft_control%efield_fields(i)%efield)
2698 ALLOCATE (dft_control%efield_fields(i)%efield)
2699 efield => dft_control%efield_fields(i)%efield
2700 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2701 CALL section_vals_val_get(efield_section, "INTENSITY", i_rep_section=i, &
2702 r_val=efield%strength)
2703
2704 CALL section_vals_val_get(efield_section, "POLARISATION", i_rep_section=i, &
2705 r_vals=tmp_vals)
2706 ALLOCATE (efield%polarisation(SIZE(tmp_vals)))
2707 efield%polarisation = tmp_vals
2708 CALL section_vals_val_get(efield_section, "PHASE", i_rep_section=i, &
2709 r_val=efield%phase_offset)
2710 CALL section_vals_val_get(efield_section, "ENVELOP", i_rep_section=i, &
2711 i_val=efield%envelop_id)
2712 CALL section_vals_val_get(efield_section, "WAVELENGTH", i_rep_section=i, &
2713 r_val=efield%wavelength)
2714 CALL section_vals_val_get(efield_section, "VEC_POT_INITIAL", i_rep_section=i, &
2715 r_vals=tmp_vals)
2716 efield%vec_pot_initial = tmp_vals
2717
2718 IF (efield%envelop_id == constant_env) THEN
2719 ALLOCATE (efield%envelop_i_vars(2))
2720 tmp_section => section_vals_get_subs_vals(efield_section, "CONSTANT_ENV", i_rep_section=i)
2721 CALL section_vals_val_get(tmp_section, "START_STEP", &
2722 i_val=efield%envelop_i_vars(1))
2723 CALL section_vals_val_get(tmp_section, "END_STEP", &
2724 i_val=efield%envelop_i_vars(2))
2725 ELSE IF (efield%envelop_id == gaussian_env) THEN
2726 ALLOCATE (efield%envelop_r_vars(2))
2727 tmp_section => section_vals_get_subs_vals(efield_section, "GAUSSIAN_ENV", i_rep_section=i)
2728 CALL section_vals_val_get(tmp_section, "T0", &
2729 r_val=efield%envelop_r_vars(1))
2730 CALL section_vals_val_get(tmp_section, "SIGMA", &
2731 r_val=efield%envelop_r_vars(2))
2732 ELSE IF (efield%envelop_id == ramp_env) THEN
2733 ALLOCATE (efield%envelop_i_vars(4))
2734 tmp_section => section_vals_get_subs_vals(efield_section, "RAMP_ENV", i_rep_section=i)
2735 CALL section_vals_val_get(tmp_section, "START_STEP_IN", &
2736 i_val=efield%envelop_i_vars(1))
2737 CALL section_vals_val_get(tmp_section, "END_STEP_IN", &
2738 i_val=efield%envelop_i_vars(2))
2739 CALL section_vals_val_get(tmp_section, "START_STEP_OUT", &
2740 i_val=efield%envelop_i_vars(3))
2741 CALL section_vals_val_get(tmp_section, "END_STEP_OUT", &
2742 i_val=efield%envelop_i_vars(4))
2743 ELSE IF (efield%envelop_id == custom_env) THEN
2744 tmp_section => section_vals_get_subs_vals(efield_section, "CUSTOM_ENV", i_rep_section=i)
2745 CALL section_vals_val_get(tmp_section, "EFIELD_FILE_NAME", c_val=file_name)
2746 CALL open_file(file_name=trim(file_name), file_action="READ", file_status="OLD", unit_number=unit_nr)
2747 !Determine the number of lines in file
2748 n = 0
2749 DO WHILE (.true.)
2750 READ (unit_nr, *, iostat=io)
2751 IF (io /= 0) EXIT
2752 n = n + 1
2753 END DO
2754 rewind(unit_nr)
2755 ALLOCATE (efield%envelop_r_vars(n + 1))
2756 !Store the timestep of the list in the first entry of the r_vars
2757 CALL section_vals_val_get(tmp_section, "TIMESTEP", r_val=efield%envelop_r_vars(1))
2758 !Read the file
2759 DO j = 2, n + 1
2760 READ (unit_nr, *) efield%envelop_r_vars(j)
2761 efield%envelop_r_vars(j) = cp_unit_to_cp2k(efield%envelop_r_vars(j), "volt/m")
2762 END DO
2763 CALL close_file(unit_nr)
2764 END IF
2765 END DO
2766 END SUBROUTINE read_efield_sections
2767
2768! **************************************************************************************************
2769!> \brief reads the input parameters needed real time propagation
2770!> \param dft_control ...
2771!> \param rtp_section ...
2772!> \author fschiff
2773! **************************************************************************************************
2774 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2775
2776 TYPE(dft_control_type), INTENT(INOUT) :: dft_control
2777 TYPE(section_vals_type), POINTER :: rtp_section
2778
2779 INTEGER, DIMENSION(:), POINTER :: tmp
2780 LOGICAL :: is_present
2781 TYPE(section_vals_type), POINTER :: proj_mo_section
2782
2783 ALLOCATE (dft_control%rtp_control)
2784 CALL section_vals_val_get(rtp_section, "MAX_ITER", &
2785 i_val=dft_control%rtp_control%max_iter)
2786 CALL section_vals_val_get(rtp_section, "MAT_EXP", &
2787 i_val=dft_control%rtp_control%mat_exp)
2788 CALL section_vals_val_get(rtp_section, "ASPC_ORDER", &
2789 i_val=dft_control%rtp_control%aspc_order)
2790 CALL section_vals_val_get(rtp_section, "EXP_ACCURACY", &
2791 r_val=dft_control%rtp_control%eps_exp)
2792 CALL section_vals_val_get(rtp_section, "RTBSE%_SECTION_PARAMETERS_", &
2793 i_val=dft_control%rtp_control%rtp_method)
2794 CALL section_vals_val_get(rtp_section, "RTBSE%RTBSE_HAMILTONIAN", &
2795 i_val=dft_control%rtp_control%rtbse_ham)
2796 CALL section_vals_val_get(rtp_section, "PROPAGATOR", &
2797 i_val=dft_control%rtp_control%propagator)
2798 CALL section_vals_val_get(rtp_section, "EPS_ITER", &
2799 r_val=dft_control%rtp_control%eps_ener)
2800 CALL section_vals_val_get(rtp_section, "INITIAL_WFN", &
2801 i_val=dft_control%rtp_control%initial_wfn)
2802 CALL section_vals_val_get(rtp_section, "HFX_BALANCE_IN_CORE", &
2803 l_val=dft_control%rtp_control%hfx_redistribute)
2804 CALL section_vals_val_get(rtp_section, "APPLY_WFN_MIX_INIT_RESTART", &
2805 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2806 CALL section_vals_val_get(rtp_section, "APPLY_DELTA_PULSE", &
2807 l_val=dft_control%rtp_control%apply_delta_pulse)
2808 CALL section_vals_val_get(rtp_section, "APPLY_DELTA_PULSE_MAG", &
2809 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2810 CALL section_vals_val_get(rtp_section, "VELOCITY_GAUGE", &
2811 l_val=dft_control%rtp_control%velocity_gauge)
2812 CALL section_vals_val_get(rtp_section, "VG_COM_NL", &
2813 l_val=dft_control%rtp_control%nl_gauge_transform)
2814 CALL section_vals_val_get(rtp_section, "PERIODIC", &
2815 l_val=dft_control%rtp_control%periodic)
2816 CALL section_vals_val_get(rtp_section, "DENSITY_PROPAGATION", &
2817 l_val=dft_control%rtp_control%linear_scaling)
2818 CALL section_vals_val_get(rtp_section, "MCWEENY_MAX_ITER", &
2819 i_val=dft_control%rtp_control%mcweeny_max_iter)
2820 CALL section_vals_val_get(rtp_section, "ACCURACY_REFINEMENT", &
2821 i_val=dft_control%rtp_control%acc_ref)
2822 CALL section_vals_val_get(rtp_section, "MCWEENY_EPS", &
2823 r_val=dft_control%rtp_control%mcweeny_eps)
2824 CALL section_vals_val_get(rtp_section, "DELTA_PULSE_SCALE", &
2825 r_val=dft_control%rtp_control%delta_pulse_scale)
2826 CALL section_vals_val_get(rtp_section, "DELTA_PULSE_DIRECTION", &
2827 i_vals=tmp)
2828 dft_control%rtp_control%delta_pulse_direction = tmp
2829 CALL section_vals_val_get(rtp_section, "SC_CHECK_START", &
2830 i_val=dft_control%rtp_control%sc_check_start)
2831 proj_mo_section => section_vals_get_subs_vals(rtp_section, "PRINT%PROJECTION_MO")
2832 CALL section_vals_get(proj_mo_section, explicit=is_present)
2833 IF (is_present) THEN
2834 IF (dft_control%rtp_control%linear_scaling) &
2835 CALL cp_abort(__location__, &
2836 "You have defined a time dependent projection of mos, but "// &
2837 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2838 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2839 "define any PRINT%PROJECTION_MO section")
2840 dft_control%rtp_control%is_proj_mo = .true.
2841 ELSE
2842 dft_control%rtp_control%is_proj_mo = .false.
2843 END IF
2844
2845 END SUBROUTINE read_rtp_section
2846
2847! **************************************************************************************************
2848!> \brief Parses the BLOCK_LIST keywords from the ADMM section
2849!> \param admm_control ...
2850!> \param dft_section ...
2851! **************************************************************************************************
2852 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2853 TYPE(admm_control_type), POINTER :: admm_control
2854 TYPE(section_vals_type), POINTER :: dft_section
2855
2856 INTEGER :: irep, list_size, n_rep
2857 INTEGER, DIMENSION(:), POINTER :: tmplist
2858
2859 NULLIFY (tmplist)
2860
2861 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
2862 n_rep_val=n_rep)
2863
2864 ALLOCATE (admm_control%blocks(n_rep))
2865
2866 DO irep = 1, n_rep
2867 CALL section_vals_val_get(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
2868 i_rep_val=irep, i_vals=tmplist)
2869 list_size = SIZE(tmplist)
2870 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2871 admm_control%blocks(irep)%list(:) = tmplist(:)
2872 END DO
2873
2874 END SUBROUTINE read_admm_block_list
2875
2876! **************************************************************************************************
2877!> \brief ...
2878!> \param dft_control ...
2879!> \param hairy_probes_section ...
2880!> \param
2881!> \param
2882! **************************************************************************************************
2883 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
2884 TYPE(dft_control_type), POINTER :: dft_control
2885 TYPE(section_vals_type), POINTER :: hairy_probes_section
2886
2887 INTEGER :: i, j, jj, kk, n_rep
2888 INTEGER, DIMENSION(:), POINTER :: tmplist
2889
2890 DO i = 1, SIZE(dft_control%probe)
2891 NULLIFY (dft_control%probe(i)%atom_ids)
2892
2893 CALL section_vals_val_get(hairy_probes_section, "ATOM_IDS", i_rep_section=i, n_rep_val=n_rep)
2894 jj = 0
2895 DO kk = 1, n_rep
2896 CALL section_vals_val_get(hairy_probes_section, "ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2897 jj = jj + SIZE(tmplist)
2898 END DO
2899
2900 dft_control%probe(i)%natoms = jj
2901 IF (dft_control%probe(i)%natoms < 1) &
2902 cpabort("Need at least 1 atom to use hair probes formalism")
2903 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
2904
2905 jj = 0
2906 DO kk = 1, n_rep
2907 CALL section_vals_val_get(hairy_probes_section, "ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2908 DO j = 1, SIZE(tmplist)
2909 jj = jj + 1
2910 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
2911 END DO
2912 END DO
2913
2914 CALL section_vals_val_get(hairy_probes_section, "MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
2915
2916 CALL section_vals_val_get(hairy_probes_section, "T", i_rep_section=i, r_val=dft_control%probe(i)%T)
2917
2918 CALL section_vals_val_get(hairy_probes_section, "ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
2919
2920 CALL section_vals_val_get(hairy_probes_section, "eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
2921 END DO
2922
2923 END SUBROUTINE read_hairy_probes_sections
2924! **************************************************************************************************
2925
2926END 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:308
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:119
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