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