(git:42db5d2)
Loading...
Searching...
No Matches
cp_control_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Defines control structures, which contain the parameters and the
10!> settings for the DFT-based calculations.
11! **************************************************************************************************
13 USE cp_fm_types, ONLY: cp_fm_release,&
15 USE eeq_input, ONLY: eeq_solver_type
16 USE input_constants, ONLY: &
23 USE kinds, ONLY: default_path_length,&
25 dp
39#include "./base/base_uses.f90"
40
41 IMPLICIT NONE
42
43 PRIVATE
44
45!***************************************************************************************************
46!\brief Control parameters for hairy-probes DFT
47!***************************************************************************************************
49 REAL(kind=dp) :: alpha = 0.0_dp ! solution probes parameter
50 REAL(kind=dp) :: mu = 0.0_dp ! chemical potenatial of electrons in reservoir
51 REAL(kind=dp) :: t = 0.0_dp ! temperature of electrons in reservoir
52 REAL(kind=dp) :: eps_hp = 0.0_dp ! tolerance for accuracy checks on occupation numbers
53 INTEGER :: natoms = 0, &
54 last_ao = 0, &
55 first_ao = 0
56 INTEGER, DIMENSION(:), POINTER :: atom_ids => null() ! atom ids to which the probes are attached
57 END TYPE hairy_probes_type
58
59! **************************************************************************************************
60! \brief Control parameters for pw grids
61! **************************************************************************************************
62 TYPE pw_grid_option
63 LOGICAL :: spherical = .false.
64 LOGICAL :: fullspace = .false.
65 INTEGER, DIMENSION(2) :: distribution_layout = 0
66 INTEGER :: blocked = 0
67 END TYPE pw_grid_option
68
69! **************************************************************************************************
70! \brief parameters for EMD/RTP calculations involving MO projections
71! **************************************************************************************************
73 INTEGER, DIMENSION(:), ALLOCATABLE :: ref_mo_index
74 INTEGER :: ref_mo_spin = 1
75 INTEGER :: ref_nlumo = 0
76 LOGICAL :: sum_on_all_ref = .false.
77 INTEGER, DIMENSION(:), ALLOCATABLE :: td_mo_index
78 REAL(dp), DIMENSION(:), ALLOCATABLE :: td_mo_occ
79 INTEGER :: td_mo_spin = 1
80 LOGICAL :: sum_on_all_td = .false.
81 CHARACTER(LEN=default_path_length) :: ref_mo_file_name = ""
82 LOGICAL :: propagate_ref = .false.
83 TYPE(cp_fm_type), DIMENSION(:), &
84 ALLOCATABLE :: mo_ref
85 END TYPE proj_mo_type
86
87 TYPE proj_mo_p_type
88 TYPE(proj_mo_type), POINTER :: proj_mo => null()
89 END TYPE proj_mo_p_type
90
91! **************************************************************************************************
92! \brief Control parameters for REAL_TIME_PROPAGATION calculations
93! **************************************************************************************************
95 LOGICAL :: converged = .false.
96 REAL(kind=dp) :: eps_ener = 0.0_dp
97 INTEGER :: max_iter = 0
98 INTEGER :: mat_exp = 0
99 INTEGER :: propagator = 0
100 LOGICAL :: fixed_ions = .false.
101 INTEGER :: rtp_method = rtp_method_tddft
102 INTEGER :: rtbse_ham = rtp_bse_ham_g0w0
103 INTEGER :: initial_wfn = 0
104 REAL(dp) :: eps_exp = 0.0_dp
105 LOGICAL :: initial_step = .false.
106 LOGICAL :: hfx_redistribute = .false.
107 INTEGER :: aspc_order = 0
108 INTEGER :: sc_check_start = 0
109 LOGICAL :: apply_wfn_mix_init_restart = .false.
110 LOGICAL :: apply_delta_pulse = .false.
111 LOGICAL :: apply_delta_pulse_mag = .false.
112 LOGICAL :: periodic = .false.
113 LOGICAL :: linear_scaling = .false.
114 LOGICAL :: write_restart = .false.
115 INTEGER :: mcweeny_max_iter = 0
116 INTEGER :: acc_ref = 0
117 REAL(dp) :: mcweeny_eps = 0.0_dp
118 INTEGER, DIMENSION(3) :: delta_pulse_direction = 0
119 REAL(kind=dp) :: delta_pulse_scale = 0.0_dp
120 LOGICAL :: velocity_gauge = .false.
121 REAL(kind=dp), DIMENSION(3) :: field = 0.0_dp
122 REAL(kind=dp), DIMENSION(3) :: vec_pot = 0.0_dp
123 LOGICAL :: nl_gauge_transform = .false.
124 LOGICAL :: is_proj_mo = .false.
125 TYPE(proj_mo_p_type), DIMENSION(:), &
126 POINTER :: proj_mo_list => null()
127 ! Switch to turn on moments trace saving
128 LOGICAL :: save_local_moments = .false.
129 INTEGER :: moment_trace_ref_type = use_mom_ref_coac
130 REAL(dp), DIMENSION(:), POINTER :: moment_trace_user_ref_point => null()
131 REAL(dp) :: ft_damping = -1.0_dp
132 REAL(dp) :: ft_t0 = 0.0_dp
133 ! Index 1 : number of the element, Index 2 : coordinates
134 ! e.g. if xx and xz elements are to be printed
135 ! print_pol_elements(1,1) = 1
136 ! print_pol_elements(1,2) = 1
137 ! print_pol_elements(2,1) = 1
138 ! print_pol_elements(2,2) = 3
139 INTEGER, DIMENSION(:, :), POINTER :: print_pol_elements => null()
140 LOGICAL :: pade_requested = .false.
141 REAL(dp) :: pade_e_min = 0.0_dp
142 REAL(dp) :: pade_e_step = 0.02_dp
143 REAL(dp) :: pade_e_max = 100.0_dp
144 REAL(dp) :: pade_fit_e_min = 0.0_dp
145 REAL(dp) :: pade_fit_e_max = 300.0_dp
146 END TYPE rtp_control_type
147
148! **************************************************************************************************
149! \brief Control parameters for DFTB calculations
150! **************************************************************************************************
152 LOGICAL :: self_consistent = .false.
153 LOGICAL :: orthogonal_basis = .false.
154 LOGICAL :: dispersion = .false.
156 INTEGER :: dispersion_type = 0
157 INTEGER :: tblite_mixer_iterations = tblite_mixer_iterations_default
158 INTEGER :: tblite_mixer_memory = tblite_mixer_iterations_default
159 INTEGER :: tblite_mixer_solver = tblite_solver_gvd
160 LOGICAL :: dftb3_diagonal = .false.
161 LOGICAL :: hb_sr_damp = .false.
162 REAL(kind=dp) :: hb_sr_para = 0.0_dp
163 REAL(kind=dp) :: tblite_mixer_damping = tblite_mixer_damping_default
164 REAL(kind=dp) :: tblite_mixer_max_weight = tblite_mixer_max_weight_default
165 REAL(kind=dp) :: tblite_mixer_min_weight = tblite_mixer_min_weight_default
166 REAL(kind=dp) :: tblite_mixer_omega0 = tblite_mixer_omega0_default
167 REAL(kind=dp) :: tblite_mixer_weight_factor = tblite_mixer_weight_factor_default
168 REAL(kind=dp) :: eps_disp = 0.0_dp
169 REAL(kind=dp) :: epscn = 0.0_dp
170 REAL(kind=dp) :: exp_pre = 0.0_dp
171 REAL(kind=dp) :: scaling = 0.0_dp
172 REAL(kind=dp) :: rcdisp = 0.0_dp
173 REAL(kind=dp), DIMENSION(3) :: sd3 = 0.0_dp
174 REAL(kind=dp), DIMENSION(4) :: sd3bj = 0.0_dp
175 LOGICAL :: do_ewald = .false.
176 CHARACTER(LEN=default_path_length) :: sk_file_path = ""
177 CHARACTER(LEN=default_path_length) :: sk_file_list = ""
178 CHARACTER(LEN=default_string_length), &
179 DIMENSION(:, :), POINTER :: sk_pair_list => null()
180 CHARACTER(LEN=default_path_length) :: uff_force_field = ""
181 CHARACTER(LEN=default_path_length) :: dispersion_parameter_file = ""
182 END TYPE dftb_control_type
183
184! **************************************************************************************************
185! \brief Control parameters for xTB calculations
186! **************************************************************************************************
187 TYPE xtb_reference_cli_guess_type
188 LOGICAL :: enabled = .false.
189 LOGICAL :: efield_active = .false.
190 LOGICAL :: grad = .false.
191 INTEGER :: method = tblite_guess_ceh
192 INTEGER :: solver = tblite_solver_gvd
193 REAL(kind=dp), DIMENSION(3) :: efield = 0.0_dp
194 REAL(kind=dp) :: electronic_temperature_guess = 0.0_dp
195 CHARACTER(LEN=default_path_length) :: input_file = ""
196 CHARACTER(LEN=default_path_length) :: json_file = ""
197 CHARACTER(LEN=default_string_length) :: input_format = "gen"
198 END TYPE xtb_reference_cli_guess_type
199
200 TYPE xtb_reference_cli_param_type
201 LOGICAL :: enabled = .false.
202 LOGICAL :: method_explicit = .false.
203 INTEGER :: method = 0
204 CHARACTER(LEN=default_path_length) :: input_file = ""
205 CHARACTER(LEN=default_path_length) :: output_file = ""
206 END TYPE xtb_reference_cli_param_type
207
208 TYPE xtb_reference_cli_fit_type
209 LOGICAL :: enabled = .false.
210 LOGICAL :: dry_run = .false.
211 CHARACTER(LEN=default_path_length) :: copy_file = ""
212 CHARACTER(LEN=default_path_length) :: input_file = ""
213 CHARACTER(LEN=default_path_length) :: param_file = ""
214 END TYPE xtb_reference_cli_fit_type
215
216 TYPE xtb_reference_cli_tagdiff_type
217 LOGICAL :: enabled = .false.
218 LOGICAL :: fit = .false.
219 CHARACTER(LEN=default_path_length) :: actual_file = ""
220 CHARACTER(LEN=default_path_length) :: reference_file = ""
221 END TYPE xtb_reference_cli_tagdiff_type
222
224 LOGICAL :: enabled = .false.
225 LOGICAL :: check_energy = .true.
226 LOGICAL :: check_forces = .true.
227 LOGICAL :: check_virial = .false.
228 LOGICAL :: keep_files = .false.
229 LOGICAL :: stop_on_error = .false.
230 LOGICAL :: efield_active = .false.
231 LOGICAL :: solvation_active = .false.
232 INTEGER :: guess = tblite_guess_sad
233 INTEGER :: solvation_born_kernel = tblite_cli_born_kernel_auto
234 INTEGER :: solvation_model = tblite_cli_solvation_none
235 INTEGER :: solvation_state = tblite_cli_solution_state_gsolv
236 REAL(kind=dp), DIMENSION(3) :: efield = 0.0_dp
237 REAL(kind=dp) :: electronic_temperature_guess = 0.0_dp
238 REAL(kind=dp) :: error_limit = 1.0e-8_dp
239 CHARACTER(LEN=default_path_length) :: program_name = "tblite"
240 CHARACTER(LEN=default_path_length) :: grad_file = ""
241 CHARACTER(LEN=default_path_length) :: json_file = ""
242 CHARACTER(LEN=default_path_length) :: post_processing = ""
243 CHARACTER(LEN=default_path_length) :: post_processing_output_file = ""
244 CHARACTER(LEN=default_path_length) :: restart_file = ""
245 CHARACTER(LEN=default_path_length) :: solvation_solvent = ""
246 CHARACTER(LEN=default_path_length) :: work_directory = "."
247 CHARACTER(LEN=default_path_length) :: prefix = "tblite-reference"
248 CHARACTER(LEN=default_string_length) :: input_format = "gen"
249 TYPE(xtb_reference_cli_guess_type) :: guess_cli
250 TYPE(xtb_reference_cli_param_type) :: param_cli
251 TYPE(xtb_reference_cli_fit_type) :: fit_cli
252 TYPE(xtb_reference_cli_tagdiff_type) :: tagdiff_cli
254
256 !
257 INTEGER :: gfn_type = 1
258 !
259 LOGICAL :: do_ewald = .false.
260 LOGICAL :: do_tblite = .false.
261 LOGICAL :: tblite_mixer_damping_explicit = .false.
262 !
263 INTEGER :: sto_ng = 0
264 INTEGER :: h_sto_ng = 0
265 INTEGER :: tblite_method = 0
267 INTEGER :: tblite_mixer_iterations = tblite_mixer_iterations_default
268 INTEGER :: tblite_mixer_memory = tblite_mixer_iterations_default
269 INTEGER :: tblite_mixer_solver = tblite_solver_gvd
270 REAL(kind=dp) :: tblite_accuracy = 1.0_dp
271 REAL(kind=dp) :: tblite_mixer_damping = tblite_mixer_damping_default
272 REAL(kind=dp) :: tblite_mixer_max_weight = tblite_mixer_max_weight_default
273 REAL(kind=dp) :: tblite_mixer_min_weight = tblite_mixer_min_weight_default
274 REAL(kind=dp) :: tblite_mixer_omega0 = tblite_mixer_omega0_default
275 REAL(kind=dp) :: tblite_mixer_weight_factor = tblite_mixer_weight_factor_default
276 CHARACTER(LEN=default_path_length) :: tblite_param_file = ""
277 !
278 INTEGER :: vdw_type = -1
279 CHARACTER(LEN=default_path_length) :: parameter_file_path = ""
280 CHARACTER(LEN=default_path_length) :: parameter_file_name = ""
281 CHARACTER(LEN=default_path_length) :: spinpol_param_file_name = ""
282 !
283 CHARACTER(LEN=default_path_length) :: dispersion_parameter_file = ""
284 REAL(kind=dp) :: epscn = 0.0_dp
285 REAL(kind=dp) :: rcdisp = 0.0_dp
286 REAL(kind=dp) :: s6 = 0.0_dp, s8 = 0.0_dp
287 REAL(kind=dp) :: a1 = 0.0_dp, a2 = 0.0_dp
288 !
289 REAL(kind=dp) :: ks = 0.0_dp, kp = 0.0_dp, kd = 0.0_dp, ksp = 0.0_dp, k2sh = 0.0_dp
290 REAL(kind=dp) :: kg = 0.0_dp, kf = 0.0_dp
291 REAL(kind=dp) :: kcns = 0.0_dp, kcnp = 0.0_dp, kcnd = 0.0_dp
292 REAL(kind=dp) :: ken = 0.0_dp
293 REAL(kind=dp) :: ksen = 0.0_dp, kpen = 0.0_dp, kden = 0.0_dp
294 REAL(kind=dp) :: ben = 0.0_dp
295 REAL(kind=dp) :: kxr = 0.0_dp, kx2 = 0.0_dp
296 REAL(kind=dp) :: enscale = 0.0_dp
297 !
298 LOGICAL :: xb_interaction = .false.
299 LOGICAL :: do_nonbonded = .false.
300 LOGICAL :: do_spinpol = .false.
301 LOGICAL :: coulomb_interaction = .false.
302 LOGICAL :: coulomb_lr = .false.
303 LOGICAL :: tb3_interaction = .false.
304 LOGICAL :: check_atomic_charges = .false.
305 LOGICAL :: var_dipole = .false.
306 !
307 REAL(kind=dp) :: xb_radius = 0.0_dp
308 REAL(kind=dp) :: coulomb_sr_cut = 0.0_dp
309 REAL(kind=dp) :: coulomb_sr_eps = 0.0_dp
310 !
311 CHARACTER(LEN=default_string_length), &
312 DIMENSION(:, :), POINTER :: kab_param => null()
313 INTEGER, DIMENSION(:, :), POINTER :: kab_types => null()
314 INTEGER :: kab_nval = 0
315 REAL(kind=dp), DIMENSION(:), POINTER :: kab_vals => null()
316 !
317 INTEGER, DIMENSION(:), POINTER :: spinpol_type => null()
318 REAL(kind=dp), DIMENSION(:, :), &
319 POINTER :: spinpol_vals => null()
320 !
321 TYPE(pair_potential_p_type), POINTER :: nonbonded => null()
322 REAL(kind=dp) :: eps_pair = 0.0_dp
323 REAL(kind=dp), DIMENSION(:, :), &
324 POINTER :: rcpair => null()
325 !
326 ! SRB terms
327 REAL(kind=dp) :: ksrb = 0.0_dp, esrb = 0.0_dp, gscal = 0.0_dp
328 REAL(kind=dp) :: c1srb = 0.0_dp, c2srb = 0.0_dp, shift = 0.0_dp
329 !
330 ! EN shift in EEQ (molecular=1 or crystaline=2)
331 INTEGER :: enshift_type = 1
332 TYPE(eeq_solver_type) :: eeq_sparam ! parameters for EEQ solver
333 TYPE(xtb_reference_cli_type) :: reference_cli
334 END TYPE xtb_control_type
335
336! **************************************************************************************************
337! \brief Control parameters for semi empirical calculations
338! **************************************************************************************************
340 LOGICAL :: orthogonal_basis = .false.
341 LOGICAL :: analytical_gradients = .false.
342 LOGICAL :: force_kdsod_ex = .false.
343 LOGICAL :: do_ewald = .false., do_ewald_r3 = .false., do_ewald_gks = .false.
344 INTEGER :: integral_screening = 0, periodic_type = 0
345 INTEGER :: max_multipole = 0
346 INTEGER :: ga_ncells = 0
347 REAL(kind=dp) :: delta = 0.0_dp
348 ! Dispersion pair potential
349 LOGICAL :: dispersion = .false.
350 REAL(kind=dp) :: rcdisp = 0.0_dp
351 REAL(kind=dp) :: epscn = 0.0_dp
352 REAL(kind=dp), DIMENSION(3) :: sd3 = 0.0_dp
353 CHARACTER(LEN=default_path_length) :: dispersion_parameter_file = ""
354 ! Parameters controlling the evaluation of the integrals
355 REAL(kind=dp) :: cutoff_lrc = 0.0_dp, taper_lrc = 0.0_dp, range_lrc = 0.0_dp
356 REAL(kind=dp) :: cutoff_cou = 0.0_dp, taper_cou = 0.0_dp, range_cou = 0.0_dp
357 REAL(kind=dp) :: cutoff_exc = 0.0_dp, taper_exc = 0.0_dp, range_exc = 0.0_dp
358 REAL(kind=dp) :: taper_scr = 0.0_dp, range_scr = 0.0_dp
360
361! **************************************************************************************************
362! \brief Control parameters for GAPW method within QUICKSTEP ***
363! **************************************************************************************************
365 INTEGER :: basis_1c = 0
366 REAL(kind=dp) :: eps_fit = 0.0_dp, &
367 eps_iso = 0.0_dp, &
368 eps_vrho0 = 0.0_dp, &
369 eps_svd = 0.0_dp, &
370 eps_cpc = 0.0_dp
371 INTEGER :: ladd_rho0 = 0, &
372 lmax_rho0 = 0, &
373 lmax_sphere = 0, &
374 quadrature = 0
375 LOGICAL :: accurate_xcint = .false.
376 REAL(kind=dp) :: aweights = 0.0_dp
377 REAL(kind=dp), DIMENSION(:), POINTER :: aw => null()
378 LOGICAL :: alpha0_hard_from_input = .false., &
379 force_paw = .false., &
380 non_paw_atoms = .false., &
381 nopaw_as_gpw = .false.
382 REAL(kind=dp) :: alpha0_hard = 0.0_dp
383 REAL(kind=dp) :: max_rad_local = 0.0_dp
384 END TYPE gapw_control_type
385
386! **************************************************************************************************
387! \brief parameters for calculations involving a time dependent electric field
388! **************************************************************************************************
390 REAL(kind=dp) :: actual_time = 0.0_dp
391 REAL(kind=dp), DIMENSION(:), POINTER :: polarisation => null()
392 INTEGER :: envelop_id = 0
393 REAL(kind=dp), DIMENSION(:), POINTER :: envelop_r_vars => null()
394 INTEGER, DIMENSION(:), POINTER :: envelop_i_vars => null()
395 REAL(kind=dp) :: strength = 0.0_dp
396 REAL(kind=dp) :: amplitude = 0.0_dp
397 REAL(kind=dp) :: phase_offset = 0.0_dp
398 REAL(kind=dp) :: wavelength = 0.0_dp
399 REAL(kind=dp), DIMENSION(3) :: vec_pot_initial = 0.0_dp
400 END TYPE efield_type
401
402 TYPE efield_p_type
403 TYPE(efield_type), POINTER :: efield => null()
404 END TYPE efield_p_type
405
406! **************************************************************************************************
407! \brief parameters for calculations involving a time dependent electric field
408! **************************************************************************************************
409 TYPE period_efield_type
410 LOGICAL :: displacement_field = .false.
411 REAL(kind=dp), DIMENSION(3) :: polarisation = 0.0_dp
412 REAL(kind=dp), DIMENSION(3) :: d_filter = 0.0_dp
413 REAL(kind=dp) :: strength = 0.0_dp
414 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: strength_list
415 INTEGER :: start_frame = 0
416 INTEGER :: end_frame = -1
417 END TYPE period_efield_type
418
419! **************************************************************************************************
420! \brief some parameters useful for mulliken_restraints
421! **************************************************************************************************
423 REAL(kind=dp) :: strength = 0.0_dp
424 REAL(kind=dp) :: TARGET = 0.0_dp
425 INTEGER :: natoms = 0
426 INTEGER, POINTER, DIMENSION(:) :: atoms => null()
428
429! **************************************************************************************************
430! \brief some parameters useful for ddapc_restraints
431! **************************************************************************************************
433 INTEGER :: ref_count = 0
434 REAL(kind=dp) :: strength = 0.0_dp
435 REAL(kind=dp) :: TARGET = 0.0_dp
436 REAL(kind=dp) :: ddapc_order_p = 0.0_dp
437 INTEGER :: functional_form = 0
438 INTEGER :: natoms = 0
439 INTEGER, POINTER, DIMENSION(:) :: atoms => null()
440 REAL(kind=dp), POINTER, DIMENSION(:) :: coeff => null()
441 INTEGER :: density_type = 0
442 END TYPE ddapc_restraint_type
443
444! **************************************************************************************************
445! \brief some parameters useful for s2_restraints
446! **************************************************************************************************
448 REAL(kind=dp) :: strength = 0.0_dp
449 REAL(kind=dp) :: TARGET = 0.0_dp
450 REAL(kind=dp) :: s2_order_p = 0.0_dp
451 INTEGER :: functional_form = 0
452 END TYPE s2_restraint_type
453
454! **************************************************************************************************
455! \brief some parameters useful for auxiliary density matrix method
456! **************************************************************************************************
457 TYPE admm_block_type
458 INTEGER, DIMENSION(:), ALLOCATABLE :: list
459 END TYPE admm_block_type
460
462 REAL(kind=dp) :: eps_filter = 0.0_dp
463 INTEGER :: admm_type = 0
464 INTEGER :: purification_method = 0
465 INTEGER :: method = 0
466 LOGICAL :: charge_constrain = .false.
467 INTEGER :: scaling_model = 0
468 INTEGER :: aux_exch_func = 0
469 LOGICAL :: aux_exch_func_param = .false.
470 REAL(kind=dp), DIMENSION(3) :: aux_x_param = 0.0_dp
471 TYPE(admm_block_type), DIMENSION(:), &
472 ALLOCATABLE :: blocks
473 END TYPE admm_control_type
474
475! **************************************************************************************************
476! \brief Parameters for external potential
477! **************************************************************************************************
479 LOGICAL :: read_from_cube = .false.
480 LOGICAL :: maxwell_solver = .false.
481 LOGICAL :: static = .false.
482 REAL(kind=dp) :: scaling_factor = 0.0_dp
483 END TYPE expot_control_type
484
485! **************************************************************************************************
486! \brief Parameters useful for Maxwell equation evaluation of external potential
487! **************************************************************************************************
489 LOGICAL :: log_test = .false.
490 INTEGER :: int_test = 0
491 REAL(kind=dp) :: real_test = 0.0_dp
492 END TYPE maxwell_control_type
493
494! **************************************************************************************************
495! \brief Control parameters for a QUICKSTEP and KIM-GORDON calculation ***
496! eps_pgf_orb: Cutoff value for the interaction of the primitive
497! Gaussian-type functions (primitive basis functions).
498! **************************************************************************************************
500 INTEGER :: method_id = 0
501 REAL(kind=dp) :: eps_core_charge = 0.0_dp, &
502 eps_kg_orb = 0.0_dp, &
503 eps_pgf_orb = 0.0_dp, &
504 eps_ppl = 0.0_dp, &
505 eps_ppnl = 0.0_dp, &
506 eps_rho_gspace = 0.0_dp, &
507 eps_rho_rspace = 0.0_dp, &
508 eps_filter_matrix = 0.0_dp, &
509 eps_gvg_rspace = 0.0_dp, &
510 progression_factor = 0.0_dp, &
511 relative_cutoff = 0.0_dp
512 LOGICAL :: do_almo_scf = .false.
513 LOGICAL :: do_ls_scf = .false.
514 LOGICAL :: do_kg = .false.
515 LOGICAL :: commensurate_mgrids = .false.
516 LOGICAL :: realspace_mgrids = .false.
517 LOGICAL :: gapw = .false., gapw_xc = .false., gpw = .false., pao = .false.
518 LOGICAL :: lrigpw = .false., rigpw = .false.
519 LOGICAL :: lri_optbas = .false.
520 LOGICAL :: ofgpw = .false.
521 LOGICAL :: dftb = .false.
522 LOGICAL :: xtb = .false.
523 LOGICAL :: semi_empirical = .false.
524 LOGICAL :: mulliken_restraint = .false.
525 LOGICAL :: ddapc_restraint = .false.
526 LOGICAL :: ddapc_restraint_is_spin = .false.
527 LOGICAL :: ddapc_explicit_potential = .false.
528 LOGICAL :: cdft = .false.
529 LOGICAL :: et_coupling_calc = .false.
530 LOGICAL :: s2_restraint = .false.
531 INTEGER :: do_ppl_method = 0
532 INTEGER :: wf_interpolation_method_nr = 0
533 INTEGER :: wf_extrapolation_order = 0
534 INTEGER :: periodicity = 0
535 REAL(kind=dp) :: pairlist_radius = 0.0_dp
536 REAL(kind=dp) :: cutoff = 0.0_dp
537 REAL(kind=dp), DIMENSION(:), POINTER :: e_cutoff => null()
539 POINTER :: mulliken_restraint_control => null()
541 DIMENSION(:), POINTER :: ddapc_restraint_control => null()
542 TYPE(cdft_control_type), POINTER :: cdft_control => null()
543 TYPE(s2_restraint_type), POINTER :: s2_restraint_control => null()
544 TYPE(dftb_control_type), POINTER :: dftb_control => null()
545 TYPE(xtb_control_type), POINTER :: xtb_control => null()
547 POINTER :: se_control => null()
548 TYPE(gapw_control_type), POINTER :: gapw_control => null()
549 TYPE(pw_grid_option) :: pw_grid_opt = pw_grid_option()
550 LOGICAL :: skip_load_balance_distributed = .false.
551 ! Types of subsystems for embedding
552 LOGICAL :: ref_embed_subsys = .false.
553 LOGICAL :: cluster_embed_subsys = .false.
554 LOGICAL :: high_level_embed_subsys = .false.
555 LOGICAL :: dfet_embedded = .false.
556 LOGICAL :: dmfet_embedded = .false.
557 END TYPE qs_control_type
558
559! **************************************************************************************************
560! \brief Control parameters for the SCCS models
561! **************************************************************************************************
563 LOGICAL :: sccs_activated = .false., &
564 saa_activated = .false.
565 INTEGER :: derivative_method = 0, &
566 max_iter = 0, &
567 method_id = 0
568 REAL(kind=dp) :: alpha_solvent = 0.0_dp, &
569 beta = 0.0_dp, &
570 beta_solvent = 0.0_dp, &
571 delta_rho = 0.0_dp, &
572 eps_sccs = 0.0_dp, &
573 eps_scf = 0.0_dp, &
574 epsilon_solvent = 0.0_dp, &
575 gamma_solvent = 0.0_dp, &
576 mixing = 0.0_dp, &
577 rho_zero = 0.0_dp, &
578 rho_max = 0.0_dp, &
579 rho_min = 0.0_dp, &
580 f0 = 0.0_dp, &
581 delta_eta = 0.0_dp, &
582 alpha_zeta = 0.0_dp, &
583 delta_zeta = 0.0_dp, &
584 r_solv = 0.0_dp
585 END TYPE sccs_control_type
586
587! **************************************************************************************************
588! \brief Control parameters for simplified Tamm Dancoff approximation (sTDA)
589! \par ATTRIBUTES
590! \par NOTES
591! **************************************************************************************************
593 LOGICAL :: do_ewald = .false.
594 LOGICAL :: do_exchange = .false.
595 REAL(kind=dp) :: hfx_fraction = 0.0_dp
596 REAL(kind=dp) :: eps_td_filter = 0.0_dp
597 REAL(kind=dp) :: mn_alpha = 0.0_dp
598 REAL(kind=dp) :: mn_beta = 0.0_dp
599 REAL(kind=dp) :: coulomb_sr_cut = 0.0_dp
600 REAL(kind=dp) :: coulomb_sr_eps = 0.0_dp
601 END TYPE stda_control_type
602
603! **************************************************************************************************
604! \brief Control parameters for smeared occupation
605! \par ATTRIBUTES
606! \par NOTES
607! **************************************************************************************************
609 REAL(kind=dp), DIMENSION(:), POINTER :: fermia => null()
610 REAL(kind=dp), DIMENSION(:, :), POINTER :: fermib => null()
611 END TYPE smeared_type
612
613! **************************************************************************************************
614! \brief Control parameters for the planar averaged Hartree potential
615! **************************************************************************************************
617 INTEGER :: surf_normal = 0
618 END TYPE paep_control_type
619
620! **************************************************************************************************
621! \brief Control parameters for the planar counter charge density
622! **************************************************************************************************
624 INTEGER :: surf_normal = 0
625 REAL(kind=dp) :: dist_edge = 0.0_dp, &
626 gau_a = 0.0_dp, &
627 gau_c = 0.0_dp, &
628 charge = 0.0_dp
629 END TYPE pcc_control_type
630
631! **************************************************************************************************
632! \brief Control parameters for a Time-Dependent DFT calculation.
633! **************************************************************************************************
635 !> compute TDDFPT excitation energies and oscillator strengths
636 LOGICAL :: enabled = .false.
637 !> number of excited states to converge
638 INTEGER :: nstates = 0
639 !> maximal number of iterations to be performed
640 INTEGER :: niters = 0
641 !> maximal number of Krylov space vectors
642 INTEGER :: nkvs = 0
643 !> number of unoccupied (virtual) molecular orbitals to consider
644 INTEGER :: nlumo = 0
645 !> minimal number of MPI processes to be used per excited state
646 INTEGER :: nprocs = 0
647 !> type of kernel function/approximation to use
648 INTEGER :: kernel = 0
649 !> type of spin excitations to compute
650 INTEGER :: spinflip = 0
651 !> for full kernel, do we have HFX/ADMM
652 LOGICAL :: do_hfx = .false.
653 LOGICAL :: do_admm = .false.
654 !> for full kernel, do we have short-range/long-range HFX and/or Kxc potential
655 LOGICAL :: do_hfxsr = .false.
656 LOGICAL :: hfxsr_re_int = .true.
657 INTEGER :: hfxsr_primbas = 0
658 LOGICAL :: do_hfxlr = .false.
659 REAL(kind=dp) :: hfxlr_rcut = 0.0_dp, hfxlr_scale = 0.0_dp
660 LOGICAL :: do_exck = .false.
661 !> options used in sTDA calculation (Kernel)
662 TYPE(stda_control_type) :: stda_control = stda_control_type()
663 !> algorithm to correct orbital energies
664 INTEGER :: oe_corr = 0
665 !> eigenvalue shifts
666 REAL(kind=dp) :: ev_shift = 0.0_dp, eos_shift = 0.0_dp
667 !> active orbitals
668 INTEGER, DIMENSION(2) :: nactive = -1
669 !> target accuracy
670 REAL(kind=dp) :: conv = 0.0_dp
671 !> the smallest excitation amplitude to print
672 REAL(kind=dp) :: min_excitation_amplitude = 0.0_dp
673 !> threshold which controls when two wave functions considered to be orthogonal:
674 !> maxabs(Ci^T * S * Cj) <= orthogonal_eps
675 REAL(kind=dp) :: orthogonal_eps = 0.0_dp
676 !> read guess wave functions from restart file if exists
677 LOGICAL :: is_restart = .false.
678 !> compute triplet excited states using spin-unpolarised molecular orbitals
679 LOGICAL :: rks_triplets = .false.
680 !> local resolution of identity for Coulomb contribution
681 LOGICAL :: do_lrigpw = .false.
682 !> smeared occupation
683 LOGICAL :: do_smearing = .false.
684 !> dynamical correlation
685 LOGICAL :: do_bse = .false.
686 LOGICAL :: do_bse_w_only = .false.
687 LOGICAL :: do_bse_gw_only = .false.
688 ! automatic generation of auxiliary basis for LRI-TDDFT
689 INTEGER :: auto_basis_p_lri_aux = 1
690 !> use symmetric definition of ADMM Kernel correction
691 LOGICAL :: admm_symm = .false.
692 !> Use/Ignore possible ADMM Kernel XC correction
693 LOGICAL :: admm_xc_correction = .false.
694 ! Compute exciton descriptors
695 LOGICAL :: do_exciton_descriptors = .false.
696 LOGICAL :: do_directional_exciton_descriptors = .false.
697 !
698 ! DIPOLE_MOMENTS subsection
699 !
700 ! form of the dipole operator used to compute oscillator strengths
701 INTEGER :: dipole_form = 0
702 !> type of the reference point used for calculation of electrostatic dipole moments
703 INTEGER :: dipole_reference = 0
704 !> user-defined reference point
705 REAL(kind=dp), DIMENSION(:), POINTER :: dipole_ref_point => null()
706 !
707 ! SOC subsection
708 LOGICAL :: do_soc = .false.
709 !
710 ! MGRID subsection
711 !
712 !> number of plain-wave grids
713 INTEGER :: mgrid_ngrids = 0
714 !> create commensurate grids (progression factor and cutoff values of sub-grids will be ignored)
715 LOGICAL :: mgrid_commensurate_mgrids = .false.
716 !> signals that MGRID section has been explicitly given. Other mgrid_* variables
717 !> are not initialised when it is equal to .FALSE. as in this case the default
718 !> set of plain-wave grids will be used
719 LOGICAL :: mgrid_is_explicit = .false.
720 !> same as qs_control%realspace_mgrids
721 LOGICAL :: mgrid_realspace_mgrids = .false.
722 !> do not perform load balancing
723 LOGICAL :: mgrid_skip_load_balance = .false.
724 !> cutoff value at the finest grid level
725 REAL(kind=dp) :: mgrid_cutoff = 0.0_dp
726 !> cutoff at the next grid level will be smaller then the cutoff
727 !> at the current grid by this number of times
728 REAL(kind=dp) :: mgrid_progression_factor = 0.0_dp
729 !> cutoff that determines to which grid a particular Gaussian function will be mapped
730 REAL(kind=dp) :: mgrid_relative_cutoff = 0.0_dp
731 !> manually provided the list of cutoff values for each grid level
732 !> (when it is null(), the cutoff values will be assigned automatically)
733 REAL(kind=dp), DIMENSION(:), POINTER :: mgrid_e_cutoff => null()
734 !> Parameter for smeared occupation TDA
735 TYPE(smeared_type), DIMENSION(:), POINTER :: smeared_occup => null()
736 END TYPE tddfpt2_control_type
737
738! **************************************************************************************************
739!> \brief
740! **************************************************************************************************
742
743 LOGICAL :: enabled = .false.
744 INTEGER :: core_states = 0
745 INTEGER :: valence_states = 0
746
747 TYPE(tddfpt2_control_type), POINTER :: tddfpt2_control => null()
748 TYPE(xas_tdp_control_type), POINTER :: xas_tdp_control => null()
749
750 END TYPE rixs_control_type
751
752! **************************************************************************************************
753! \brief Control parameters for a DFT calculation
754! \par History
755! 10.2019 added variables related to surface dipole correction [Soumya Ghosh]
756! **************************************************************************************************
758 TYPE(admm_control_type), POINTER :: admm_control => null()
759 TYPE(period_efield_type), POINTER :: period_efield => null()
760 TYPE(qs_control_type), POINTER :: qs_control => null()
761 TYPE(rtp_control_type), POINTER :: rtp_control => null()
762 TYPE(sccs_control_type), POINTER :: sccs_control => null()
763 TYPE(tddfpt2_control_type), POINTER :: tddfpt2_control => null()
764 TYPE(rixs_control_type), POINTER :: rixs_control => null()
765 TYPE(xas_control_type), POINTER :: xas_control => null()
766 TYPE(expot_control_type), POINTER :: expot_control => null()
767 TYPE(maxwell_control_type), POINTER :: maxwell_control => null()
768 TYPE(smeagol_control_type), POINTER :: smeagol_control => null()
769 TYPE(paep_control_type), POINTER :: paep_control => null()
770 TYPE(pcc_control_type), POINTER :: pcc_control => null()
771 TYPE(efield_p_type), POINTER, &
772 DIMENSION(:) :: efield_fields => null()
773 TYPE(hairy_probes_type), POINTER, &
774 DIMENSION(:) :: probe => null()
775 INTEGER :: nspins = 0, &
776 charge = 0, &
777 multiplicity = 0, &
778 sic_method_id = 0, &
779 plus_u_method_id = 0, &
780 dir_surf_dip = 0, &
781 nimages = 1
782 INTEGER :: sic_list_id = 0
783 INTEGER :: auto_basis_ri_aux = 1, &
784 auto_basis_aux_fit = 1, &
785 auto_basis_lri_aux = 1, &
786 auto_basis_p_lri_aux = 1, &
787 auto_basis_ri_hxc = 1, &
788 auto_basis_ri_xas = 1, &
789 auto_basis_ri_hfx = 1, &
790 localize_each = 1, &
791 mtlr_ikind = 1, &
792 max_mtlr_iter = 10
793 REAL(kind=dp) :: eps_u_j_loop = 0.01_dp, &
794 relax_multiplicity = 0.0_dp, &
795 sic_scaling_a = 0.0_dp, &
796 sic_scaling_b = 0.0_dp, &
797 pos_dir_surf_dip = 0.0_dp, &
798 perturbation_strength = 0.0_dp, &
799 trq(2) = 0.0_dp, &
800 vhxc(2) = 0.0_dp
801 LOGICAL :: do_xas_calculation = .false., &
802 do_xas_tdp_calculation = .false., &
803 drho_by_collocation = .false., &
804 use_kinetic_energy_density = .false., &
805 restricted = .false., &
806 roks = .false., &
807 uks = .false., &
808 lsd = .false., &
809 dft_plus_u = .false., &
810 mtlr_u_j = .false., &
811 apply_efield = .false., &
812 apply_efield_field = .false., &
813 apply_vector_potential = .false., &
814 apply_period_efield = .false., &
815 apply_external_potential = .false., &
816 eval_external_potential = .false., &
817 do_admm = .false., &
818 do_admm_dm = .false., &
819 do_admm_mo = .false., &
820 smear = .false., &
821 low_spin_roks = .false., &
822 apply_external_density = .false., &
823 read_external_density = .false., &
824 apply_external_vxc = .false., &
825 read_external_vxc = .false., &
826 correct_surf_dip = .false., &
827 surf_dip_correct_switch = .false., &
828 switch_surf_dip = .false., &
829 correct_el_density_dip = .false., &
830 do_sccs = .false., &
831 apply_embed_pot = .false., &
832 apply_dmfet_pot = .false., &
833 hairy_probes = .false., &
834 do_paep = .false., &
835 do_pcc = .false., &
836 ! If true, then no other XC functionals are allowed
837 use_gauxc = .false., &
838 mtlr_dft_with_perturbation = .false.
839 END TYPE dft_control_type
840
841 CHARACTER(len=*), PARAMETER, PRIVATE :: modulen = 'cp_control_types'
842
843 ! Public data types
844
845 PUBLIC :: dft_control_type, &
850 proj_mo_type, &
851 efield_type, &
865 smeared_type, &
869
870 ! Public subroutines
871
872 PUBLIC :: dft_control_release, &
881
882CONTAINS
883
884! **************************************************************************************************
885!> \brief create the mulliken_restraint_type
886!> \param mulliken_restraint_control ...
887!> \par History
888!> 02.2005 created [Joost VandeVondele]
889! **************************************************************************************************
890 SUBROUTINE mulliken_control_create(mulliken_restraint_control)
891 TYPE(mulliken_restraint_type), INTENT(OUT) :: mulliken_restraint_control
892
893 mulliken_restraint_control%strength = 0.1_dp
894 mulliken_restraint_control%target = 1.0_dp
895 mulliken_restraint_control%natoms = 0
896 NULLIFY (mulliken_restraint_control%atoms)
897 END SUBROUTINE mulliken_control_create
898
899! **************************************************************************************************
900!> \brief release the mulliken_restraint_type
901!> \param mulliken_restraint_control ...
902!> \par History
903!> 02.2005 created [Joost VandeVondele]
904! **************************************************************************************************
905 SUBROUTINE mulliken_control_release(mulliken_restraint_control)
906 TYPE(mulliken_restraint_type), INTENT(INOUT) :: mulliken_restraint_control
907
908 IF (ASSOCIATED(mulliken_restraint_control%atoms)) THEN
909 DEALLOCATE (mulliken_restraint_control%atoms)
910 END IF
911 mulliken_restraint_control%strength = 0.0_dp
912 mulliken_restraint_control%target = 0.0_dp
913 mulliken_restraint_control%natoms = 0
914 END SUBROUTINE mulliken_control_release
915
916! **************************************************************************************************
917!> \brief create the ddapc_restraint_type
918!> \param ddapc_restraint_control ...
919!> \par History
920!> 02.2006 created [Joost VandeVondele]
921! **************************************************************************************************
922 SUBROUTINE ddapc_control_create(ddapc_restraint_control)
923 TYPE(ddapc_restraint_type), INTENT(OUT) :: ddapc_restraint_control
924
925 ddapc_restraint_control%density_type = do_full_density
926 ddapc_restraint_control%strength = 0.1_dp
927 ddapc_restraint_control%ddapc_order_p = 0.0_dp
928 ddapc_restraint_control%functional_form = -1
929 ddapc_restraint_control%target = 1.0_dp
930 ddapc_restraint_control%natoms = 0
931 NULLIFY (ddapc_restraint_control%atoms)
932 NULLIFY (ddapc_restraint_control%coeff)
933
934 END SUBROUTINE ddapc_control_create
935
936! **************************************************************************************************
937!> \brief release the ddapc_restraint_type
938!> \param ddapc_restraint_control ...
939!> \par History
940!> 02.2006 created [Joost VandeVondele]
941! **************************************************************************************************
942 SUBROUTINE ddapc_control_release(ddapc_restraint_control)
943 TYPE(ddapc_restraint_type), INTENT(INOUT) :: ddapc_restraint_control
944
945 IF (ASSOCIATED(ddapc_restraint_control%atoms)) THEN
946 DEALLOCATE (ddapc_restraint_control%atoms)
947 END IF
948 IF (ASSOCIATED(ddapc_restraint_control%coeff)) THEN
949 DEALLOCATE (ddapc_restraint_control%coeff)
950 END IF
951 ddapc_restraint_control%strength = 0.0_dp
952 ddapc_restraint_control%target = 0.0_dp
953 ddapc_restraint_control%natoms = 0
954 END SUBROUTINE ddapc_control_release
955
956! **************************************************************************************************
957!> \brief create the s2_restraint_type
958!> \param s2_restraint_control ...
959!> \par History
960!> 03.2006 created [Joost VandeVondele]
961! **************************************************************************************************
962 SUBROUTINE s2_control_create(s2_restraint_control)
963 TYPE(s2_restraint_type), INTENT(OUT) :: s2_restraint_control
964
965 s2_restraint_control%strength = 0.1_dp
966 s2_restraint_control%s2_order_p = 0.0_dp
967 s2_restraint_control%functional_form = -1
968 s2_restraint_control%target = 1.0_dp
969 END SUBROUTINE s2_control_create
970
971! **************************************************************************************************
972!> \brief release the s2_restraint_type
973!> \param s2_restraint_control ...
974!> \par History
975!> 03.2006 created [Joost VandeVondele]
976! **************************************************************************************************
977 SUBROUTINE s2_control_release(s2_restraint_control)
978 TYPE(s2_restraint_type), INTENT(INOUT) :: s2_restraint_control
979
980 s2_restraint_control%strength = 0.0_dp
981 s2_restraint_control%target = 0.0_dp
982 END SUBROUTINE s2_control_release
983
984! **************************************************************************************************
985!> \brief allocates and perform a very basic initialization
986!> \param dft_control the object to create
987!> \par History
988!> 02.2003 created [fawzi]
989!> \author fawzi
990! **************************************************************************************************
991 SUBROUTINE dft_control_create(dft_control)
992 TYPE(dft_control_type), INTENT(OUT) :: dft_control
993
994 NULLIFY (dft_control%xas_control)
995 NULLIFY (dft_control%qs_control)
996 NULLIFY (dft_control%tddfpt2_control)
997 NULLIFY (dft_control%rixs_control)
998 NULLIFY (dft_control%efield_fields)
999 NULLIFY (dft_control%period_efield)
1000 NULLIFY (dft_control%admm_control)
1001 NULLIFY (dft_control%expot_control)
1002 NULLIFY (dft_control%maxwell_control)
1003 NULLIFY (dft_control%smeagol_control)
1004 NULLIFY (dft_control%rtp_control)
1005 NULLIFY (dft_control%sccs_control)
1006 NULLIFY (dft_control%probe)
1007 NULLIFY (dft_control%paep_control)
1008 NULLIFY (dft_control%pcc_control)
1009 dft_control%do_sccs = .false.
1010 dft_control%apply_embed_pot = .false.
1011 dft_control%apply_dmfet_pot = .false.
1012 dft_control%hairy_probes = .false.
1013 dft_control%do_pcc = .false.
1014 dft_control%do_paep = .false.
1015 CALL qs_control_create(dft_control%qs_control)
1016 CALL tddfpt2_control_create(dft_control%tddfpt2_control)
1017 CALL rixs_control_create(dft_control%rixs_control)
1018 CALL smeagol_control_create(dft_control%smeagol_control)
1019 END SUBROUTINE dft_control_create
1020
1021! **************************************************************************************************
1022!> \brief ...
1023!> \param dft_control ...
1024!> \par History
1025!> 02.2003 created [fawzi]
1026!> \author fawzi
1027! **************************************************************************************************
1028 SUBROUTINE dft_control_release(dft_control)
1029 TYPE(dft_control_type), INTENT(INOUT) :: dft_control
1030
1031 INTEGER :: i
1032
1033 CALL qs_control_release(dft_control%qs_control)
1034 CALL tddfpt2_control_release(dft_control%tddfpt2_control)
1035 CALL rixs_control_release(dft_control%rixs_control) ! maybe check first if allocated
1036 IF (ASSOCIATED(dft_control%xas_control)) THEN
1037 CALL xas_control_release(dft_control%xas_control)
1038 DEALLOCATE (dft_control%xas_control)
1039 END IF
1040 CALL admm_control_release(dft_control%admm_control)
1041 CALL expot_control_release(dft_control%expot_control)
1042 CALL maxwell_control_release(dft_control%maxwell_control)
1043 CALL smeagol_control_release(dft_control%smeagol_control)
1044 CALL efield_fields_release(dft_control%efield_fields)
1045 IF (ASSOCIATED(dft_control%probe)) THEN
1046 DO i = 1, SIZE(dft_control%probe)
1047 DEALLOCATE (dft_control%probe(i)%atom_ids)
1048 END DO
1049 DEALLOCATE (dft_control%probe)
1050 END IF
1051 IF (ASSOCIATED(dft_control%sccs_control)) DEALLOCATE (dft_control%sccs_control)
1052 IF (ASSOCIATED(dft_control%period_efield)) THEN
1053 DEALLOCATE (dft_control%period_efield)
1054 END IF
1055 IF (ASSOCIATED(dft_control%rtp_control)) THEN
1056 CALL proj_mo_list_release(dft_control%rtp_control%proj_mo_list)
1057 DEALLOCATE (dft_control%rtp_control)
1058 END IF
1059 IF (ASSOCIATED(dft_control%pcc_control)) DEALLOCATE (dft_control%pcc_control)
1060 IF (ASSOCIATED(dft_control%paep_control)) DEALLOCATE (dft_control%paep_control)
1061
1062 END SUBROUTINE dft_control_release
1063
1064! **************************************************************************************************
1065!> \brief ...
1066!> \param qs_control ...
1067! **************************************************************************************************
1068 SUBROUTINE qs_control_create(qs_control)
1069 TYPE(qs_control_type), POINTER :: qs_control
1070
1071 cpassert(.NOT. ASSOCIATED(qs_control))
1072 ALLOCATE (qs_control)
1073
1074 NULLIFY (qs_control%e_cutoff)
1075 NULLIFY (qs_control%gapw_control)
1076 NULLIFY (qs_control%mulliken_restraint_control)
1077 NULLIFY (qs_control%ddapc_restraint_control)
1078 NULLIFY (qs_control%s2_restraint_control)
1079 NULLIFY (qs_control%se_control)
1080 NULLIFY (qs_control%dftb_control)
1081 NULLIFY (qs_control%xtb_control)
1082 NULLIFY (qs_control%cdft_control)
1083 NULLIFY (qs_control%ddapc_restraint_control)
1084
1085 ALLOCATE (qs_control%mulliken_restraint_control)
1086 CALL mulliken_control_create(qs_control%mulliken_restraint_control)
1087 ALLOCATE (qs_control%s2_restraint_control)
1088 CALL s2_control_create(qs_control%s2_restraint_control)
1089 ALLOCATE (qs_control%gapw_control)
1090 CALL se_control_create(qs_control%se_control)
1091 CALL dftb_control_create(qs_control%dftb_control)
1092 CALL xtb_control_create(qs_control%xtb_control)
1093 ALLOCATE (qs_control%cdft_control)
1094 CALL cdft_control_create(qs_control%cdft_control)
1095 END SUBROUTINE qs_control_create
1096
1097! **************************************************************************************************
1098!> \brief ...
1099!> \param qs_control ...
1100! **************************************************************************************************
1101 SUBROUTINE qs_control_release(qs_control)
1102 TYPE(qs_control_type), POINTER :: qs_control
1103
1104 INTEGER :: i
1105
1106 IF (ASSOCIATED(qs_control)) THEN
1107 CALL mulliken_control_release(qs_control%mulliken_restraint_control)
1108 DEALLOCATE (qs_control%mulliken_restraint_control)
1109 CALL s2_control_release(qs_control%s2_restraint_control)
1110 DEALLOCATE (qs_control%s2_restraint_control)
1111 CALL se_control_release(qs_control%se_control)
1112 CALL dftb_control_release(qs_control%dftb_control)
1113 CALL xtb_control_release(qs_control%xtb_control)
1114 IF (ASSOCIATED(qs_control%cdft_control)) THEN
1115 CALL cdft_control_release(qs_control%cdft_control)
1116 DEALLOCATE (qs_control%cdft_control)
1117 END IF
1118
1119 IF (ASSOCIATED(qs_control%e_cutoff)) THEN
1120 DEALLOCATE (qs_control%e_cutoff)
1121 END IF
1122 IF (ASSOCIATED(qs_control%gapw_control)) THEN
1123 IF (ASSOCIATED(qs_control%gapw_control%aw)) THEN
1124 DEALLOCATE (qs_control%gapw_control%aw)
1125 END IF
1126 DEALLOCATE (qs_control%gapw_control)
1127 END IF
1128 IF (ASSOCIATED(qs_control%ddapc_restraint_control)) THEN
1129 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
1130 CALL ddapc_control_release(qs_control%ddapc_restraint_control(i))
1131 END DO
1132 DEALLOCATE (qs_control%ddapc_restraint_control)
1133 END IF
1134 DEALLOCATE (qs_control)
1135 END IF
1136 END SUBROUTINE qs_control_release
1137
1138! **************************************************************************************************
1139!> \brief allocate control options for Time-Dependent Density Functional Theory calculation
1140!> \param tddfpt_control an object to create
1141!> \par History
1142!> * 05.2016 created [Sergey Chulkov]
1143! **************************************************************************************************
1144 SUBROUTINE tddfpt2_control_create(tddfpt_control)
1145 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
1146
1147 CHARACTER(len=*), PARAMETER :: routinen = 'tddfpt2_control_create'
1148
1149 INTEGER :: handle
1150
1151 cpassert(.NOT. ASSOCIATED(tddfpt_control))
1152 CALL timeset(routinen, handle)
1153
1154 ALLOCATE (tddfpt_control)
1155 tddfpt_control%do_soc = .false.
1156
1157 CALL timestop(handle)
1158 END SUBROUTINE tddfpt2_control_create
1159
1160! **************************************************************************************************
1161!> \brief release memory allocated for TDDFT control options
1162!> \param tddfpt_control an object to release
1163!> \par History
1164!> * 05.2016 created [Sergey Chulkov]
1165! **************************************************************************************************
1166 SUBROUTINE tddfpt2_control_release(tddfpt_control)
1167 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
1168
1169 CHARACTER(len=*), PARAMETER :: routinen = 'tddfpt2_control_release'
1170
1171 INTEGER :: handle
1172
1173 CALL timeset(routinen, handle)
1174
1175 IF (ASSOCIATED(tddfpt_control)) THEN
1176 DEALLOCATE (tddfpt_control)
1177 END IF
1178
1179 CALL timestop(handle)
1180 END SUBROUTINE tddfpt2_control_release
1181
1182! **************************************************************************************************
1183!> \brief Creates and initializes the rixs_control_type
1184!> \param rixs_control the type to initialize
1185! **************************************************************************************************
1186 SUBROUTINE rixs_control_create(rixs_control)
1187 TYPE(rixs_control_type), POINTER :: rixs_control
1188
1189 cpassert(.NOT. ASSOCIATED(rixs_control))
1190 ALLOCATE (rixs_control)
1191
1192 NULLIFY (rixs_control%tddfpt2_control)
1193 CALL tddfpt2_control_create(rixs_control%tddfpt2_control)
1194 NULLIFY (rixs_control%xas_tdp_control)
1195 CALL xas_tdp_control_create(rixs_control%xas_tdp_control)
1196
1197 END SUBROUTINE rixs_control_create
1198
1199! **************************************************************************************************
1200!> \brief Releases the rixs_control_type
1201!> \param rixs_control ...
1202! **************************************************************************************************
1203 SUBROUTINE rixs_control_release(rixs_control)
1204 TYPE(rixs_control_type), POINTER :: rixs_control
1205
1206 IF (ASSOCIATED(rixs_control)) THEN
1207 CALL tddfpt2_control_release(rixs_control%tddfpt2_control)
1208 CALL xas_tdp_control_release(rixs_control%xas_tdp_control)
1209
1210 DEALLOCATE (rixs_control)
1211 END IF
1212
1213 END SUBROUTINE rixs_control_release
1214
1215! **************************************************************************************************
1216!> \brief ...
1217!> \param proj_mo_list ...
1218! **************************************************************************************************
1219 SUBROUTINE proj_mo_list_release(proj_mo_list)
1220 TYPE(proj_mo_p_type), DIMENSION(:), POINTER :: proj_mo_list
1221
1222 INTEGER :: i, mo_ref_nbr
1223
1224 IF (ASSOCIATED(proj_mo_list)) THEN
1225 DO i = 1, SIZE(proj_mo_list)
1226 IF (ASSOCIATED(proj_mo_list(i)%proj_mo)) THEN
1227 IF (ALLOCATED(proj_mo_list(i)%proj_mo%ref_mo_index)) THEN
1228 DEALLOCATE (proj_mo_list(i)%proj_mo%ref_mo_index)
1229 END IF
1230 IF (ALLOCATED(proj_mo_list(i)%proj_mo%mo_ref)) THEN
1231 DO mo_ref_nbr = 1, SIZE(proj_mo_list(i)%proj_mo%mo_ref)
1232 CALL cp_fm_release(proj_mo_list(i)%proj_mo%mo_ref(mo_ref_nbr))
1233 END DO
1234 DEALLOCATE (proj_mo_list(i)%proj_mo%mo_ref)
1235 END IF
1236 IF (ALLOCATED(proj_mo_list(i)%proj_mo%td_mo_index)) THEN
1237 DEALLOCATE (proj_mo_list(i)%proj_mo%td_mo_index)
1238 END IF
1239 IF (ALLOCATED(proj_mo_list(i)%proj_mo%td_mo_occ)) THEN
1240 DEALLOCATE (proj_mo_list(i)%proj_mo%td_mo_occ)
1241 END IF
1242 DEALLOCATE (proj_mo_list(i)%proj_mo)
1243 END IF
1244 END DO
1245 DEALLOCATE (proj_mo_list)
1246 END IF
1247 END SUBROUTINE proj_mo_list_release
1248
1249! **************************************************************************************************
1250!> \brief ...
1251!> \param efield_fields ...
1252! **************************************************************************************************
1253 SUBROUTINE efield_fields_release(efield_fields)
1254 TYPE(efield_p_type), DIMENSION(:), POINTER :: efield_fields
1255
1256 INTEGER :: i
1257
1258 IF (ASSOCIATED(efield_fields)) THEN
1259 DO i = 1, SIZE(efield_fields)
1260 IF (ASSOCIATED(efield_fields(i)%efield)) THEN
1261 IF (ASSOCIATED(efield_fields(i)%efield%envelop_r_vars)) THEN
1262 DEALLOCATE (efield_fields(i)%efield%envelop_r_vars)
1263 END IF
1264 IF (ASSOCIATED(efield_fields(i)%efield%envelop_i_vars)) THEN
1265 DEALLOCATE (efield_fields(i)%efield%envelop_i_vars)
1266 END IF
1267 IF (ASSOCIATED(efield_fields(i)%efield%polarisation)) THEN
1268 DEALLOCATE (efield_fields(i)%efield%polarisation)
1269 END IF
1270 DEALLOCATE (efield_fields(i)%efield)
1271 END IF
1272 END DO
1273 DEALLOCATE (efield_fields)
1274 END IF
1275 END SUBROUTINE efield_fields_release
1276
1277! **************************************************************************************************
1278!> \brief ...
1279!> \param dftb_control ...
1280! **************************************************************************************************
1281 SUBROUTINE dftb_control_create(dftb_control)
1282 TYPE(dftb_control_type), POINTER :: dftb_control
1283
1284 cpassert(.NOT. ASSOCIATED(dftb_control))
1285 ALLOCATE (dftb_control)
1286
1287 NULLIFY (dftb_control%sk_pair_list)
1288 END SUBROUTINE dftb_control_create
1289
1290! **************************************************************************************************
1291!> \brief ...
1292!> \param dftb_control ...
1293! **************************************************************************************************
1294 SUBROUTINE dftb_control_release(dftb_control)
1295 TYPE(dftb_control_type), POINTER :: dftb_control
1296
1297 IF (ASSOCIATED(dftb_control)) THEN
1298 IF (ASSOCIATED(dftb_control%sk_pair_list)) THEN
1299 DEALLOCATE (dftb_control%sk_pair_list)
1300 END IF
1301 DEALLOCATE (dftb_control)
1302 END IF
1303 END SUBROUTINE dftb_control_release
1304
1305! **************************************************************************************************
1306!> \brief ...
1307!> \param xtb_control ...
1308! **************************************************************************************************
1309 SUBROUTINE xtb_control_create(xtb_control)
1310 TYPE(xtb_control_type), POINTER :: xtb_control
1311
1312 cpassert(.NOT. ASSOCIATED(xtb_control))
1313 ALLOCATE (xtb_control)
1314
1315 NULLIFY (xtb_control%kab_param)
1316 NULLIFY (xtb_control%kab_vals)
1317 NULLIFY (xtb_control%kab_types)
1318 NULLIFY (xtb_control%nonbonded)
1319 NULLIFY (xtb_control%rcpair)
1320 NULLIFY (xtb_control%spinpol_type)
1321 NULLIFY (xtb_control%spinpol_vals)
1322
1323 END SUBROUTINE xtb_control_create
1324
1325! **************************************************************************************************
1326!> \brief ...
1327!> \param xtb_control ...
1328! **************************************************************************************************
1329 SUBROUTINE xtb_control_release(xtb_control)
1330 TYPE(xtb_control_type), POINTER :: xtb_control
1331
1332 IF (ASSOCIATED(xtb_control)) THEN
1333 IF (ASSOCIATED(xtb_control%kab_param)) THEN
1334 DEALLOCATE (xtb_control%kab_param)
1335 END IF
1336 IF (ASSOCIATED(xtb_control%kab_vals)) THEN
1337 DEALLOCATE (xtb_control%kab_vals)
1338 END IF
1339 IF (ASSOCIATED(xtb_control%kab_types)) THEN
1340 DEALLOCATE (xtb_control%kab_types)
1341 END IF
1342 IF (ASSOCIATED(xtb_control%rcpair)) THEN
1343 DEALLOCATE (xtb_control%rcpair)
1344 END IF
1345 IF (ASSOCIATED(xtb_control%nonbonded)) THEN
1346 CALL pair_potential_p_release(xtb_control%nonbonded)
1347 END IF
1348 IF (ASSOCIATED(xtb_control%spinpol_type)) THEN
1349 DEALLOCATE (xtb_control%spinpol_type)
1350 END IF
1351 IF (ASSOCIATED(xtb_control%spinpol_vals)) THEN
1352 DEALLOCATE (xtb_control%spinpol_vals)
1353 END IF
1354 DEALLOCATE (xtb_control)
1355 END IF
1356 END SUBROUTINE xtb_control_release
1357
1358! **************************************************************************************************
1359!> \brief ...
1360!> \param se_control ...
1361! **************************************************************************************************
1362 SUBROUTINE se_control_create(se_control)
1363 TYPE(semi_empirical_control_type), POINTER :: se_control
1364
1365 cpassert(.NOT. ASSOCIATED(se_control))
1366 ALLOCATE (se_control)
1367 END SUBROUTINE se_control_create
1368
1369! **************************************************************************************************
1370!> \brief ...
1371!> \param se_control ...
1372! **************************************************************************************************
1373 SUBROUTINE se_control_release(se_control)
1374 TYPE(semi_empirical_control_type), POINTER :: se_control
1375
1376 IF (ASSOCIATED(se_control)) THEN
1377 DEALLOCATE (se_control)
1378 END IF
1379 END SUBROUTINE se_control_release
1380
1381! **************************************************************************************************
1382!> \brief ...
1383!> \param admm_control ...
1384! **************************************************************************************************
1385 SUBROUTINE admm_control_create(admm_control)
1386 TYPE(admm_control_type), POINTER :: admm_control
1387
1388 cpassert(.NOT. ASSOCIATED(admm_control))
1389 ALLOCATE (admm_control)
1390
1391 END SUBROUTINE admm_control_create
1392
1393! **************************************************************************************************
1394!> \brief ...
1395!> \param admm_control ...
1396! **************************************************************************************************
1397 SUBROUTINE admm_control_release(admm_control)
1398 TYPE(admm_control_type), POINTER :: admm_control
1399
1400 IF (ASSOCIATED(admm_control)) THEN
1401 DEALLOCATE (admm_control)
1402 END IF
1403 END SUBROUTINE admm_control_release
1404
1405! **************************************************************************************************
1406!> \brief ...
1407!> \param expot_control ...
1408! **************************************************************************************************
1409 SUBROUTINE expot_control_create(expot_control)
1410 TYPE(expot_control_type), POINTER :: expot_control
1411
1412 cpassert(.NOT. ASSOCIATED(expot_control))
1413 ALLOCATE (expot_control)
1414 expot_control%read_from_cube = .false.
1415 expot_control%maxwell_solver = .false.
1416 expot_control%static = .true.
1417 expot_control%scaling_factor = 1.0_dp
1418
1419 END SUBROUTINE expot_control_create
1420
1421! **************************************************************************************************
1422!> \brief ...
1423!> \param expot_control ...
1424! **************************************************************************************************
1425 SUBROUTINE expot_control_release(expot_control)
1426 TYPE(expot_control_type), POINTER :: expot_control
1427
1428 IF (ASSOCIATED(expot_control)) THEN
1429 DEALLOCATE (expot_control)
1430 END IF
1431
1432 END SUBROUTINE expot_control_release
1433
1434! **************************************************************************************************
1435!> \brief ...
1436!> \param maxwell_control ...
1437! **************************************************************************************************
1438 SUBROUTINE maxwell_control_create(maxwell_control)
1439 TYPE(maxwell_control_type), POINTER :: maxwell_control
1440
1441 cpassert(.NOT. ASSOCIATED(maxwell_control))
1442 ALLOCATE (maxwell_control)
1443
1444 END SUBROUTINE maxwell_control_create
1445
1446! **************************************************************************************************
1447!> \brief ...
1448!> \param maxwell_control ...
1449! **************************************************************************************************
1450 SUBROUTINE maxwell_control_release(maxwell_control)
1451 TYPE(maxwell_control_type), POINTER :: maxwell_control
1452
1453 IF (ASSOCIATED(maxwell_control)) THEN
1454 DEALLOCATE (maxwell_control)
1455 END IF
1456
1457 END SUBROUTINE maxwell_control_release
1458
1459END MODULE cp_control_types
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public rixs_control_release(rixs_control)
Releases the rixs_control_type.
subroutine, public admm_control_release(admm_control)
...
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)
...
subroutine, public dft_control_release(dft_control)
...
subroutine, public rixs_control_create(rixs_control)
Creates and initializes the rixs_control_type.
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
Add the DFT+U contribution to the Hamiltonian matrix.
Definition dft_plus_u.F:18
Input definition and setup for EEQ model.
Definition eeq_input.F:12
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public use_mom_ref_coac
integer, parameter, public tblite_guess_sad
integer, parameter, public tblite_solver_gvd
real(kind=dp), parameter, public tblite_mixer_damping_default
integer, parameter, public tblite_cli_solution_state_gsolv
integer, parameter, public tblite_mixer_iterations_default
real(kind=dp), parameter, public tblite_mixer_max_weight_default
integer, parameter, public tblite_cli_born_kernel_auto
real(kind=dp), parameter, public tblite_mixer_omega0_default
integer, parameter, public tblite_scc_mixer_auto
integer, parameter, public rtp_method_tddft
integer, parameter, public rtp_bse_ham_g0w0
integer, parameter, public tblite_guess_ceh
real(kind=dp), parameter, public tblite_mixer_weight_factor_default
real(kind=dp), parameter, public tblite_mixer_min_weight_default
integer, parameter, public do_full_density
integer, parameter, public tblite_cli_solvation_none
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
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Definition list.F:24
subroutine, public pair_potential_p_release(potparm)
Release Data-structure that constains potential parameters.
Defines CDFT control structures.
subroutine, public cdft_control_release(cdft_control)
release the cdft_control_type
subroutine, public cdft_control_create(cdft_control)
create the cdft_control_type
Input control types for NEGF/SMEAGOL transport calculations.
subroutine, public smeagol_control_release(smeagol_control)
release SMEAGOL control object
subroutine, public smeagol_control_create(smeagol_control)
allocate control options for SMEAGOL calculation
CP2K-side tblite-compatible SCC Broyden mixer.
Defines control structures, which contain the parameters and the settings for the calculations.
Definition xas_control.F:12
subroutine, public xas_control_release(xas_control)
...
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
subroutine, public xas_tdp_control_release(xas_tdp_control)
Releases the xas_tdp_control_type.
subroutine, public xas_tdp_control_create(xas_tdp_control)
Creates and initializes the xas_tdp_control_type.
represent a full matrix
A type that holds controlling information for a xas calculation.
Definition xas_control.F:40
Type containing control information for TDP XAS calculations.