(git:d5c4d39)
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 !
282 CHARACTER(LEN=default_path_length) :: dispersion_parameter_file = ""
283 REAL(kind=dp) :: epscn = 0.0_dp
284 REAL(kind=dp) :: rcdisp = 0.0_dp
285 REAL(kind=dp) :: s6 = 0.0_dp, s8 = 0.0_dp
286 REAL(kind=dp) :: a1 = 0.0_dp, a2 = 0.0_dp
287 !
288 REAL(kind=dp) :: ks = 0.0_dp, kp = 0.0_dp, kd = 0.0_dp, ksp = 0.0_dp, k2sh = 0.0_dp
289 REAL(kind=dp) :: kg = 0.0_dp, kf = 0.0_dp
290 REAL(kind=dp) :: kcns = 0.0_dp, kcnp = 0.0_dp, kcnd = 0.0_dp
291 REAL(kind=dp) :: ken = 0.0_dp
292 REAL(kind=dp) :: ksen = 0.0_dp, kpen = 0.0_dp, kden = 0.0_dp
293 REAL(kind=dp) :: ben = 0.0_dp
294 REAL(kind=dp) :: kxr = 0.0_dp, kx2 = 0.0_dp
295 REAL(kind=dp) :: enscale = 0.0_dp
296 !
297 LOGICAL :: xb_interaction = .false.
298 LOGICAL :: do_nonbonded = .false.
299 LOGICAL :: coulomb_interaction = .false.
300 LOGICAL :: coulomb_lr = .false.
301 LOGICAL :: tb3_interaction = .false.
302 LOGICAL :: check_atomic_charges = .false.
303 LOGICAL :: var_dipole = .false.
304 !
305 REAL(kind=dp) :: xb_radius = 0.0_dp
306 REAL(kind=dp) :: coulomb_sr_cut = 0.0_dp
307 REAL(kind=dp) :: coulomb_sr_eps = 0.0_dp
308 !
309 CHARACTER(LEN=default_string_length), &
310 DIMENSION(:, :), POINTER :: kab_param => null()
311 INTEGER, DIMENSION(:, :), POINTER :: kab_types => null()
312 INTEGER :: kab_nval = 0
313 REAL, DIMENSION(:), POINTER :: kab_vals => null()
314 !
315 TYPE(pair_potential_p_type), POINTER :: nonbonded => null()
316 REAL(kind=dp) :: eps_pair = 0.0_dp
317 REAL(kind=dp), DIMENSION(:, :), &
318 POINTER :: rcpair => null()
319 !
320 ! SRB terms
321 REAL(kind=dp) :: ksrb = 0.0_dp, esrb = 0.0_dp, gscal = 0.0_dp
322 REAL(kind=dp) :: c1srb = 0.0_dp, c2srb = 0.0_dp, shift = 0.0_dp
323 !
324 ! EN shift in EEQ (molecular=1 or crystaline=2)
325 INTEGER :: enshift_type = 1
326 TYPE(eeq_solver_type) :: eeq_sparam ! parameters for EEQ solver
327 TYPE(xtb_reference_cli_type) :: reference_cli
328 END TYPE xtb_control_type
329
330! **************************************************************************************************
331! \brief Control parameters for semi empirical calculations
332! **************************************************************************************************
334 LOGICAL :: orthogonal_basis = .false.
335 LOGICAL :: analytical_gradients = .false.
336 LOGICAL :: force_kdsod_ex = .false.
337 LOGICAL :: do_ewald = .false., do_ewald_r3 = .false., do_ewald_gks = .false.
338 INTEGER :: integral_screening = 0, periodic_type = 0
339 INTEGER :: max_multipole = 0
340 INTEGER :: ga_ncells = 0
341 REAL(kind=dp) :: delta = 0.0_dp
342 ! Dispersion pair potential
343 LOGICAL :: dispersion = .false.
344 REAL(kind=dp) :: rcdisp = 0.0_dp
345 REAL(kind=dp) :: epscn = 0.0_dp
346 REAL(kind=dp), DIMENSION(3) :: sd3 = 0.0_dp
347 CHARACTER(LEN=default_path_length) :: dispersion_parameter_file = ""
348 ! Parameters controlling the evaluation of the integrals
349 REAL(kind=dp) :: cutoff_lrc = 0.0_dp, taper_lrc = 0.0_dp, range_lrc = 0.0_dp
350 REAL(kind=dp) :: cutoff_cou = 0.0_dp, taper_cou = 0.0_dp, range_cou = 0.0_dp
351 REAL(kind=dp) :: cutoff_exc = 0.0_dp, taper_exc = 0.0_dp, range_exc = 0.0_dp
352 REAL(kind=dp) :: taper_scr = 0.0_dp, range_scr = 0.0_dp
354
355! **************************************************************************************************
356! \brief Control parameters for GAPW method within QUICKSTEP ***
357! **************************************************************************************************
359 INTEGER :: basis_1c = 0
360 REAL(kind=dp) :: eps_fit = 0.0_dp, &
361 eps_iso = 0.0_dp, &
362 eps_vrho0 = 0.0_dp, &
363 eps_svd = 0.0_dp, &
364 eps_cpc = 0.0_dp
365 INTEGER :: ladd_rho0 = 0, &
366 lmax_rho0 = 0, &
367 lmax_sphere = 0, &
368 quadrature = 0
369 LOGICAL :: accurate_xcint = .false.
370 REAL(kind=dp) :: aweights = 0.0_dp
371 REAL(kind=dp), DIMENSION(:), POINTER :: aw => null()
372 LOGICAL :: alpha0_hard_from_input = .false., &
373 force_paw = .false., &
374 non_paw_atoms = .false., &
375 nopaw_as_gpw = .false.
376 REAL(kind=dp) :: alpha0_hard = 0.0_dp
377 REAL(kind=dp) :: max_rad_local = 0.0_dp
378 END TYPE gapw_control_type
379
380! **************************************************************************************************
381! \brief parameters for calculations involving a time dependent electric field
382! **************************************************************************************************
384 REAL(kind=dp) :: actual_time = 0.0_dp
385 REAL(kind=dp), DIMENSION(:), POINTER :: polarisation => null()
386 INTEGER :: envelop_id = 0
387 REAL(kind=dp), DIMENSION(:), POINTER :: envelop_r_vars => null()
388 INTEGER, DIMENSION(:), POINTER :: envelop_i_vars => null()
389 REAL(kind=dp) :: strength = 0.0_dp
390 REAL(kind=dp) :: phase_offset = 0.0_dp
391 REAL(kind=dp) :: wavelength = 0.0_dp
392 REAL(kind=dp), DIMENSION(3) :: vec_pot_initial = 0.0_dp
393 END TYPE efield_type
394
395 TYPE efield_p_type
396 TYPE(efield_type), POINTER :: efield => null()
397 END TYPE efield_p_type
398
399! **************************************************************************************************
400! \brief parameters for calculations involving a time dependent electric field
401! **************************************************************************************************
402 TYPE period_efield_type
403 LOGICAL :: displacement_field = .false.
404 REAL(kind=dp), DIMENSION(3) :: polarisation = 0.0_dp
405 REAL(kind=dp), DIMENSION(3) :: d_filter = 0.0_dp
406 REAL(kind=dp) :: strength = 0.0_dp
407 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: strength_list
408 INTEGER :: start_frame = 0
409 INTEGER :: end_frame = -1
410 END TYPE period_efield_type
411
412! **************************************************************************************************
413! \brief some parameters useful for mulliken_restraints
414! **************************************************************************************************
416 REAL(kind=dp) :: strength = 0.0_dp
417 REAL(kind=dp) :: TARGET = 0.0_dp
418 INTEGER :: natoms = 0
419 INTEGER, POINTER, DIMENSION(:) :: atoms => null()
421
422! **************************************************************************************************
423! \brief some parameters useful for ddapc_restraints
424! **************************************************************************************************
426 INTEGER :: ref_count = 0
427 REAL(kind=dp) :: strength = 0.0_dp
428 REAL(kind=dp) :: TARGET = 0.0_dp
429 REAL(kind=dp) :: ddapc_order_p = 0.0_dp
430 INTEGER :: functional_form = 0
431 INTEGER :: natoms = 0
432 INTEGER, POINTER, DIMENSION(:) :: atoms => null()
433 REAL(kind=dp), POINTER, DIMENSION(:) :: coeff => null()
434 INTEGER :: density_type = 0
435 END TYPE ddapc_restraint_type
436
437! **************************************************************************************************
438! \brief some parameters useful for s2_restraints
439! **************************************************************************************************
441 REAL(kind=dp) :: strength = 0.0_dp
442 REAL(kind=dp) :: TARGET = 0.0_dp
443 REAL(kind=dp) :: s2_order_p = 0.0_dp
444 INTEGER :: functional_form = 0
445 END TYPE s2_restraint_type
446
447! **************************************************************************************************
448! \brief some parameters useful for auxiliary density matrix method
449! **************************************************************************************************
450 TYPE admm_block_type
451 INTEGER, DIMENSION(:), ALLOCATABLE :: list
452 END TYPE admm_block_type
453
455 REAL(kind=dp) :: eps_filter = 0.0_dp
456 INTEGER :: admm_type = 0
457 INTEGER :: purification_method = 0
458 INTEGER :: method = 0
459 LOGICAL :: charge_constrain = .false.
460 INTEGER :: scaling_model = 0
461 INTEGER :: aux_exch_func = 0
462 LOGICAL :: aux_exch_func_param = .false.
463 REAL(kind=dp), DIMENSION(3) :: aux_x_param = 0.0_dp
464 TYPE(admm_block_type), DIMENSION(:), &
465 ALLOCATABLE :: blocks
466 END TYPE admm_control_type
467
468! **************************************************************************************************
469! \brief Parameters for external potential
470! **************************************************************************************************
472 LOGICAL :: read_from_cube = .false.
473 LOGICAL :: maxwell_solver = .false.
474 LOGICAL :: static = .false.
475 REAL(kind=dp) :: scaling_factor = 0.0_dp
476 END TYPE expot_control_type
477
478! **************************************************************************************************
479! \brief Parameters useful for Maxwell equation evaluation of external potential
480! **************************************************************************************************
482 LOGICAL :: log_test = .false.
483 INTEGER :: int_test = 0
484 REAL(kind=dp) :: real_test = 0.0_dp
485 END TYPE maxwell_control_type
486
487! **************************************************************************************************
488! \brief Control parameters for a QUICKSTEP and KIM-GORDON calculation ***
489! eps_pgf_orb: Cutoff value for the interaction of the primitive
490! Gaussian-type functions (primitive basis functions).
491! **************************************************************************************************
493 INTEGER :: method_id = 0
494 REAL(kind=dp) :: eps_core_charge = 0.0_dp, &
495 eps_kg_orb = 0.0_dp, &
496 eps_pgf_orb = 0.0_dp, &
497 eps_ppl = 0.0_dp, &
498 eps_ppnl = 0.0_dp, &
499 eps_rho_gspace = 0.0_dp, &
500 eps_rho_rspace = 0.0_dp, &
501 eps_filter_matrix = 0.0_dp, &
502 eps_gvg_rspace = 0.0_dp, &
503 progression_factor = 0.0_dp, &
504 relative_cutoff = 0.0_dp
505 LOGICAL :: do_almo_scf = .false.
506 LOGICAL :: do_ls_scf = .false.
507 LOGICAL :: do_kg = .false.
508 LOGICAL :: commensurate_mgrids = .false.
509 LOGICAL :: realspace_mgrids = .false.
510 LOGICAL :: gapw = .false., gapw_xc = .false., gpw = .false., pao = .false.
511 LOGICAL :: lrigpw = .false., rigpw = .false.
512 LOGICAL :: lri_optbas = .false.
513 LOGICAL :: ofgpw = .false.
514 LOGICAL :: dftb = .false.
515 LOGICAL :: xtb = .false.
516 LOGICAL :: semi_empirical = .false.
517 LOGICAL :: mulliken_restraint = .false.
518 LOGICAL :: ddapc_restraint = .false.
519 LOGICAL :: ddapc_restraint_is_spin = .false.
520 LOGICAL :: ddapc_explicit_potential = .false.
521 LOGICAL :: cdft = .false.
522 LOGICAL :: et_coupling_calc = .false.
523 LOGICAL :: s2_restraint = .false.
524 INTEGER :: do_ppl_method = 0
525 INTEGER :: wf_interpolation_method_nr = 0
526 INTEGER :: wf_extrapolation_order = 0
527 INTEGER :: periodicity = 0
528 REAL(kind=dp) :: pairlist_radius = 0.0_dp
529 REAL(kind=dp) :: cutoff = 0.0_dp
530 REAL(kind=dp), DIMENSION(:), POINTER :: e_cutoff => null()
532 POINTER :: mulliken_restraint_control => null()
534 DIMENSION(:), POINTER :: ddapc_restraint_control => null()
535 TYPE(cdft_control_type), POINTER :: cdft_control => null()
536 TYPE(s2_restraint_type), POINTER :: s2_restraint_control => null()
537 TYPE(dftb_control_type), POINTER :: dftb_control => null()
538 TYPE(xtb_control_type), POINTER :: xtb_control => null()
540 POINTER :: se_control => null()
541 TYPE(gapw_control_type), POINTER :: gapw_control => null()
542 TYPE(pw_grid_option) :: pw_grid_opt = pw_grid_option()
543 LOGICAL :: skip_load_balance_distributed = .false.
544 ! Types of subsystems for embedding
545 LOGICAL :: ref_embed_subsys = .false.
546 LOGICAL :: cluster_embed_subsys = .false.
547 LOGICAL :: high_level_embed_subsys = .false.
548 LOGICAL :: dfet_embedded = .false.
549 LOGICAL :: dmfet_embedded = .false.
550 END TYPE qs_control_type
551
552! **************************************************************************************************
553! \brief Control parameters for the SCCS models
554! **************************************************************************************************
556 LOGICAL :: sccs_activated = .false.
557 INTEGER :: derivative_method = 0, &
558 max_iter = 0, &
559 method_id = 0
560 REAL(kind=dp) :: alpha_solvent = 0.0_dp, &
561 beta = 0.0_dp, &
562 beta_solvent = 0.0_dp, &
563 delta_rho = 0.0_dp, &
564 eps_sccs = 0.0_dp, &
565 eps_scf = 0.0_dp, &
566 epsilon_solvent = 0.0_dp, &
567 gamma_solvent = 0.0_dp, &
568 mixing = 0.0_dp, &
569 rho_zero = 0.0_dp, &
570 rho_max = 0.0_dp, &
571 rho_min = 0.0_dp
572 END TYPE sccs_control_type
573
574! **************************************************************************************************
575! \brief Control parameters for simplified Tamm Dancoff approximation (sTDA)
576! \par ATTRIBUTES
577! \par NOTES
578! **************************************************************************************************
580 LOGICAL :: do_ewald = .false.
581 LOGICAL :: do_exchange = .false.
582 REAL(kind=dp) :: hfx_fraction = 0.0_dp
583 REAL(kind=dp) :: eps_td_filter = 0.0_dp
584 REAL(kind=dp) :: mn_alpha = 0.0_dp
585 REAL(kind=dp) :: mn_beta = 0.0_dp
586 REAL(kind=dp) :: coulomb_sr_cut = 0.0_dp
587 REAL(kind=dp) :: coulomb_sr_eps = 0.0_dp
588 END TYPE stda_control_type
589
590! **************************************************************************************************
591! \brief Control parameters for smeared occupation
592! \par ATTRIBUTES
593! \par NOTES
594! **************************************************************************************************
596 REAL(kind=dp), DIMENSION(:), POINTER :: fermia => null()
597 REAL(kind=dp), DIMENSION(:, :), POINTER :: fermib => null()
598 END TYPE smeared_type
599
600! **************************************************************************************************
601! \brief Control parameters for the planar averaged Hartree potential
602! **************************************************************************************************
604 INTEGER :: surf_normal = 0
605 END TYPE paep_control_type
606
607! **************************************************************************************************
608! \brief Control parameters for the planar counter charge density
609! **************************************************************************************************
611 INTEGER :: surf_normal = 0
612 REAL(kind=dp) :: dist_edge = 0.0_dp, &
613 gau_a = 0.0_dp, &
614 gau_c = 0.0_dp
615 END TYPE pcc_control_type
616
617! **************************************************************************************************
618! \brief Control parameters for a Time-Dependent DFT calculation.
619! **************************************************************************************************
621 !> compute TDDFPT excitation energies and oscillator strengths
622 LOGICAL :: enabled = .false.
623 !> number of excited states to converge
624 INTEGER :: nstates = 0
625 !> maximal number of iterations to be performed
626 INTEGER :: niters = 0
627 !> maximal number of Krylov space vectors
628 INTEGER :: nkvs = 0
629 !> number of unoccupied (virtual) molecular orbitals to consider
630 INTEGER :: nlumo = 0
631 !> minimal number of MPI processes to be used per excited state
632 INTEGER :: nprocs = 0
633 !> type of kernel function/approximation to use
634 INTEGER :: kernel = 0
635 !> type of spin excitations to compute
636 INTEGER :: spinflip = 0
637 !> for full kernel, do we have HFX/ADMM
638 LOGICAL :: do_hfx = .false.
639 LOGICAL :: do_admm = .false.
640 !> for full kernel, do we have short-range/long-range HFX and/or Kxc potential
641 LOGICAL :: do_hfxsr = .false.
642 LOGICAL :: hfxsr_re_int = .true.
643 INTEGER :: hfxsr_primbas = 0
644 LOGICAL :: do_hfxlr = .false.
645 REAL(kind=dp) :: hfxlr_rcut = 0.0_dp, hfxlr_scale = 0.0_dp
646 LOGICAL :: do_exck = .false.
647 !> options used in sTDA calculation (Kernel)
648 TYPE(stda_control_type) :: stda_control = stda_control_type()
649 !> algorithm to correct orbital energies
650 INTEGER :: oe_corr = 0
651 !> eigenvalue shifts
652 REAL(kind=dp) :: ev_shift = 0.0_dp, eos_shift = 0.0_dp
653 !> active orbitals
654 INTEGER, DIMENSION(2) :: nactive = -1
655 !> target accuracy
656 REAL(kind=dp) :: conv = 0.0_dp
657 !> the smallest excitation amplitude to print
658 REAL(kind=dp) :: min_excitation_amplitude = 0.0_dp
659 !> threshold which controls when two wave functions considered to be orthogonal:
660 !> maxabs(Ci^T * S * Cj) <= orthogonal_eps
661 REAL(kind=dp) :: orthogonal_eps = 0.0_dp
662 !> read guess wave functions from restart file if exists
663 LOGICAL :: is_restart = .false.
664 !> compute triplet excited states using spin-unpolarised molecular orbitals
665 LOGICAL :: rks_triplets = .false.
666 !> local resolution of identity for Coulomb contribution
667 LOGICAL :: do_lrigpw = .false.
668 !> smeared occupation
669 LOGICAL :: do_smearing = .false.
670 !> dynamical correlation
671 LOGICAL :: do_bse = .false.
672 LOGICAL :: do_bse_w_only = .false.
673 LOGICAL :: do_bse_gw_only = .false.
674 ! automatic generation of auxiliary basis for LRI-TDDFT
675 INTEGER :: auto_basis_p_lri_aux = 1
676 !> use symmetric definition of ADMM Kernel correction
677 LOGICAL :: admm_symm = .false.
678 !> Use/Ignore possible ADMM Kernel XC correction
679 LOGICAL :: admm_xc_correction = .false.
680 ! Compute exciton descriptors
681 LOGICAL :: do_exciton_descriptors = .false.
682 LOGICAL :: do_directional_exciton_descriptors = .false.
683 !
684 ! DIPOLE_MOMENTS subsection
685 !
686 ! form of the dipole operator used to compute oscillator strengths
687 INTEGER :: dipole_form = 0
688 !> type of the reference point used for calculation of electrostatic dipole moments
689 INTEGER :: dipole_reference = 0
690 !> user-defined reference point
691 REAL(kind=dp), DIMENSION(:), POINTER :: dipole_ref_point => null()
692 !
693 ! SOC subsection
694 LOGICAL :: do_soc = .false.
695 !
696 ! MGRID subsection
697 !
698 !> number of plain-wave grids
699 INTEGER :: mgrid_ngrids = 0
700 !> create commensurate grids (progression factor and cutoff values of sub-grids will be ignored)
701 LOGICAL :: mgrid_commensurate_mgrids = .false.
702 !> signals that MGRID section has been explicitly given. Other mgrid_* variables
703 !> are not initialised when it is equal to .FALSE. as in this case the default
704 !> set of plain-wave grids will be used
705 LOGICAL :: mgrid_is_explicit = .false.
706 !> same as qs_control%realspace_mgrids
707 LOGICAL :: mgrid_realspace_mgrids = .false.
708 !> do not perform load balancing
709 LOGICAL :: mgrid_skip_load_balance = .false.
710 !> cutoff value at the finest grid level
711 REAL(kind=dp) :: mgrid_cutoff = 0.0_dp
712 !> cutoff at the next grid level will be smaller then the cutoff
713 !> at the current grid by this number of times
714 REAL(kind=dp) :: mgrid_progression_factor = 0.0_dp
715 !> cutoff that determines to which grid a particular Gaussian function will be mapped
716 REAL(kind=dp) :: mgrid_relative_cutoff = 0.0_dp
717 !> manually provided the list of cutoff values for each grid level
718 !> (when it is null(), the cutoff values will be assigned automatically)
719 REAL(kind=dp), DIMENSION(:), POINTER :: mgrid_e_cutoff => null()
720 !> Parameter for smeared occupation TDA
721 TYPE(smeared_type), DIMENSION(:), POINTER :: smeared_occup => null()
722 END TYPE tddfpt2_control_type
723
724! **************************************************************************************************
725!> \brief
726! **************************************************************************************************
728
729 LOGICAL :: enabled = .false.
730 INTEGER :: core_states = 0
731 INTEGER :: valence_states = 0
732
733 TYPE(tddfpt2_control_type), POINTER :: tddfpt2_control => null()
734 TYPE(xas_tdp_control_type), POINTER :: xas_tdp_control => null()
735
736 END TYPE rixs_control_type
737
738! **************************************************************************************************
739! \brief Control parameters for a DFT calculation
740! \par History
741! 10.2019 added variables related to surface dipole correction [Soumya Ghosh]
742! **************************************************************************************************
744 TYPE(admm_control_type), POINTER :: admm_control => null()
745 TYPE(period_efield_type), POINTER :: period_efield => null()
746 TYPE(qs_control_type), POINTER :: qs_control => null()
747 TYPE(rtp_control_type), POINTER :: rtp_control => null()
748 TYPE(sccs_control_type), POINTER :: sccs_control => null()
749 TYPE(tddfpt2_control_type), POINTER :: tddfpt2_control => null()
750 TYPE(rixs_control_type), POINTER :: rixs_control => null()
751 TYPE(xas_control_type), POINTER :: xas_control => null()
752 TYPE(expot_control_type), POINTER :: expot_control => null()
753 TYPE(maxwell_control_type), POINTER :: maxwell_control => null()
754 TYPE(smeagol_control_type), POINTER :: smeagol_control => null()
755 TYPE(paep_control_type), POINTER :: paep_control => null()
756 TYPE(pcc_control_type), POINTER :: pcc_control => null()
757 TYPE(efield_p_type), POINTER, &
758 DIMENSION(:) :: efield_fields => null()
759 TYPE(hairy_probes_type), POINTER, &
760 DIMENSION(:) :: probe => null()
761 INTEGER :: nspins = 0, &
762 charge = 0, &
763 multiplicity = 0, &
764 sic_method_id = 0, &
765 plus_u_method_id = 0, &
766 dir_surf_dip = 0, &
767 nimages = 1
768 INTEGER :: sic_list_id = 0
769 INTEGER :: auto_basis_ri_aux = 1, &
770 auto_basis_aux_fit = 1, &
771 auto_basis_lri_aux = 1, &
772 auto_basis_p_lri_aux = 1, &
773 auto_basis_ri_hxc = 1, &
774 auto_basis_ri_xas = 1, &
775 auto_basis_ri_hfx = 1, &
776 localize_each = 1
777 REAL(kind=dp) :: relax_multiplicity = 0.0_dp, &
778 sic_scaling_a = 0.0_dp, &
779 sic_scaling_b = 0.0_dp, &
780 pos_dir_surf_dip = 0.0_dp
781 LOGICAL :: do_xas_calculation = .false., &
782 do_xas_tdp_calculation = .false., &
783 drho_by_collocation = .false., &
784 use_kinetic_energy_density = .false., &
785 restricted = .false., &
786 roks = .false., &
787 uks = .false., &
788 lsd = .false., &
789 dft_plus_u = .false., &
790 apply_efield = .false., &
791 apply_efield_field = .false., &
792 apply_vector_potential = .false., &
793 apply_period_efield = .false., &
794 apply_external_potential = .false., &
795 eval_external_potential = .false., &
796 do_admm = .false., &
797 do_admm_dm = .false., &
798 do_admm_mo = .false., &
799 smear = .false., &
800 low_spin_roks = .false., &
801 apply_external_density = .false., &
802 read_external_density = .false., &
803 apply_external_vxc = .false., &
804 read_external_vxc = .false., &
805 correct_surf_dip = .false., &
806 surf_dip_correct_switch = .false., &
807 switch_surf_dip = .false., &
808 correct_el_density_dip = .false., &
809 do_sccs = .false., &
810 apply_embed_pot = .false., &
811 apply_dmfet_pot = .false., &
812 hairy_probes = .false., &
813 do_paep = .false., &
814 do_pcc = .false., &
815 ! If true, then no other XC functionals are allowed
816 use_gauxc = .false.
817 END TYPE dft_control_type
818
819 CHARACTER(len=*), PARAMETER, PRIVATE :: modulen = 'cp_control_types'
820
821 ! Public data types
822
823 PUBLIC :: dft_control_type, &
828 proj_mo_type, &
829 efield_type, &
843 smeared_type, &
847
848 ! Public subroutines
849
850 PUBLIC :: dft_control_release, &
859
860CONTAINS
861
862! **************************************************************************************************
863!> \brief create the mulliken_restraint_type
864!> \param mulliken_restraint_control ...
865!> \par History
866!> 02.2005 created [Joost VandeVondele]
867! **************************************************************************************************
868 SUBROUTINE mulliken_control_create(mulliken_restraint_control)
869 TYPE(mulliken_restraint_type), INTENT(OUT) :: mulliken_restraint_control
870
871 mulliken_restraint_control%strength = 0.1_dp
872 mulliken_restraint_control%target = 1.0_dp
873 mulliken_restraint_control%natoms = 0
874 NULLIFY (mulliken_restraint_control%atoms)
875 END SUBROUTINE mulliken_control_create
876
877! **************************************************************************************************
878!> \brief release the mulliken_restraint_type
879!> \param mulliken_restraint_control ...
880!> \par History
881!> 02.2005 created [Joost VandeVondele]
882! **************************************************************************************************
883 SUBROUTINE mulliken_control_release(mulliken_restraint_control)
884 TYPE(mulliken_restraint_type), INTENT(INOUT) :: mulliken_restraint_control
885
886 IF (ASSOCIATED(mulliken_restraint_control%atoms)) &
887 DEALLOCATE (mulliken_restraint_control%atoms)
888 mulliken_restraint_control%strength = 0.0_dp
889 mulliken_restraint_control%target = 0.0_dp
890 mulliken_restraint_control%natoms = 0
891 END SUBROUTINE mulliken_control_release
892
893! **************************************************************************************************
894!> \brief create the ddapc_restraint_type
895!> \param ddapc_restraint_control ...
896!> \par History
897!> 02.2006 created [Joost VandeVondele]
898! **************************************************************************************************
899 SUBROUTINE ddapc_control_create(ddapc_restraint_control)
900 TYPE(ddapc_restraint_type), INTENT(OUT) :: ddapc_restraint_control
901
902 ddapc_restraint_control%density_type = do_full_density
903 ddapc_restraint_control%strength = 0.1_dp
904 ddapc_restraint_control%ddapc_order_p = 0.0_dp
905 ddapc_restraint_control%functional_form = -1
906 ddapc_restraint_control%target = 1.0_dp
907 ddapc_restraint_control%natoms = 0
908 NULLIFY (ddapc_restraint_control%atoms)
909 NULLIFY (ddapc_restraint_control%coeff)
910
911 END SUBROUTINE ddapc_control_create
912
913! **************************************************************************************************
914!> \brief release the ddapc_restraint_type
915!> \param ddapc_restraint_control ...
916!> \par History
917!> 02.2006 created [Joost VandeVondele]
918! **************************************************************************************************
919 SUBROUTINE ddapc_control_release(ddapc_restraint_control)
920 TYPE(ddapc_restraint_type), INTENT(INOUT) :: ddapc_restraint_control
921
922 IF (ASSOCIATED(ddapc_restraint_control%atoms)) &
923 DEALLOCATE (ddapc_restraint_control%atoms)
924 IF (ASSOCIATED(ddapc_restraint_control%coeff)) &
925 DEALLOCATE (ddapc_restraint_control%coeff)
926 ddapc_restraint_control%strength = 0.0_dp
927 ddapc_restraint_control%target = 0.0_dp
928 ddapc_restraint_control%natoms = 0
929 END SUBROUTINE ddapc_control_release
930
931! **************************************************************************************************
932!> \brief create the s2_restraint_type
933!> \param s2_restraint_control ...
934!> \par History
935!> 03.2006 created [Joost VandeVondele]
936! **************************************************************************************************
937 SUBROUTINE s2_control_create(s2_restraint_control)
938 TYPE(s2_restraint_type), INTENT(OUT) :: s2_restraint_control
939
940 s2_restraint_control%strength = 0.1_dp
941 s2_restraint_control%s2_order_p = 0.0_dp
942 s2_restraint_control%functional_form = -1
943 s2_restraint_control%target = 1.0_dp
944 END SUBROUTINE s2_control_create
945
946! **************************************************************************************************
947!> \brief release the s2_restraint_type
948!> \param s2_restraint_control ...
949!> \par History
950!> 03.2006 created [Joost VandeVondele]
951! **************************************************************************************************
952 SUBROUTINE s2_control_release(s2_restraint_control)
953 TYPE(s2_restraint_type), INTENT(INOUT) :: s2_restraint_control
954
955 s2_restraint_control%strength = 0.0_dp
956 s2_restraint_control%target = 0.0_dp
957 END SUBROUTINE s2_control_release
958
959! **************************************************************************************************
960!> \brief allocates and perform a very basic initialization
961!> \param dft_control the object to create
962!> \par History
963!> 02.2003 created [fawzi]
964!> \author fawzi
965! **************************************************************************************************
966 SUBROUTINE dft_control_create(dft_control)
967 TYPE(dft_control_type), INTENT(OUT) :: dft_control
968
969 NULLIFY (dft_control%xas_control)
970 NULLIFY (dft_control%qs_control)
971 NULLIFY (dft_control%tddfpt2_control)
972 NULLIFY (dft_control%rixs_control)
973 NULLIFY (dft_control%efield_fields)
974 NULLIFY (dft_control%period_efield)
975 NULLIFY (dft_control%admm_control)
976 NULLIFY (dft_control%expot_control)
977 NULLIFY (dft_control%maxwell_control)
978 NULLIFY (dft_control%smeagol_control)
979 NULLIFY (dft_control%rtp_control)
980 NULLIFY (dft_control%sccs_control)
981 NULLIFY (dft_control%probe)
982 NULLIFY (dft_control%paep_control)
983 NULLIFY (dft_control%pcc_control)
984 dft_control%do_sccs = .false.
985 dft_control%apply_embed_pot = .false.
986 dft_control%apply_dmfet_pot = .false.
987 dft_control%hairy_probes = .false.
988 dft_control%do_pcc = .false.
989 dft_control%do_paep = .false.
990 CALL qs_control_create(dft_control%qs_control)
991 CALL tddfpt2_control_create(dft_control%tddfpt2_control)
992 CALL rixs_control_create(dft_control%rixs_control)
993 CALL smeagol_control_create(dft_control%smeagol_control)
994 END SUBROUTINE dft_control_create
995
996! **************************************************************************************************
997!> \brief ...
998!> \param dft_control ...
999!> \par History
1000!> 02.2003 created [fawzi]
1001!> \author fawzi
1002! **************************************************************************************************
1003 SUBROUTINE dft_control_release(dft_control)
1004 TYPE(dft_control_type), INTENT(INOUT) :: dft_control
1005
1006 INTEGER :: i
1007
1008 CALL qs_control_release(dft_control%qs_control)
1009 CALL tddfpt2_control_release(dft_control%tddfpt2_control)
1010 CALL rixs_control_release(dft_control%rixs_control) ! maybe check first if allocated
1011 IF (ASSOCIATED(dft_control%xas_control)) THEN
1012 CALL xas_control_release(dft_control%xas_control)
1013 DEALLOCATE (dft_control%xas_control)
1014 END IF
1015 CALL admm_control_release(dft_control%admm_control)
1016 CALL expot_control_release(dft_control%expot_control)
1017 CALL maxwell_control_release(dft_control%maxwell_control)
1018 CALL smeagol_control_release(dft_control%smeagol_control)
1019 CALL efield_fields_release(dft_control%efield_fields)
1020 IF (ASSOCIATED(dft_control%probe)) THEN
1021 DO i = 1, SIZE(dft_control%probe)
1022 DEALLOCATE (dft_control%probe(i)%atom_ids)
1023 END DO
1024 DEALLOCATE (dft_control%probe)
1025 END IF
1026 IF (ASSOCIATED(dft_control%sccs_control)) DEALLOCATE (dft_control%sccs_control)
1027 IF (ASSOCIATED(dft_control%period_efield)) THEN
1028 DEALLOCATE (dft_control%period_efield)
1029 END IF
1030 IF (ASSOCIATED(dft_control%rtp_control)) THEN
1031 CALL proj_mo_list_release(dft_control%rtp_control%proj_mo_list)
1032 DEALLOCATE (dft_control%rtp_control)
1033 END IF
1034 IF (ASSOCIATED(dft_control%pcc_control)) DEALLOCATE (dft_control%pcc_control)
1035 IF (ASSOCIATED(dft_control%paep_control)) DEALLOCATE (dft_control%paep_control)
1036
1037 END SUBROUTINE dft_control_release
1038
1039! **************************************************************************************************
1040!> \brief ...
1041!> \param qs_control ...
1042! **************************************************************************************************
1043 SUBROUTINE qs_control_create(qs_control)
1044 TYPE(qs_control_type), POINTER :: qs_control
1045
1046 cpassert(.NOT. ASSOCIATED(qs_control))
1047 ALLOCATE (qs_control)
1048
1049 NULLIFY (qs_control%e_cutoff)
1050 NULLIFY (qs_control%gapw_control)
1051 NULLIFY (qs_control%mulliken_restraint_control)
1052 NULLIFY (qs_control%ddapc_restraint_control)
1053 NULLIFY (qs_control%s2_restraint_control)
1054 NULLIFY (qs_control%se_control)
1055 NULLIFY (qs_control%dftb_control)
1056 NULLIFY (qs_control%xtb_control)
1057 NULLIFY (qs_control%cdft_control)
1058 NULLIFY (qs_control%ddapc_restraint_control)
1059
1060 ALLOCATE (qs_control%mulliken_restraint_control)
1061 CALL mulliken_control_create(qs_control%mulliken_restraint_control)
1062 ALLOCATE (qs_control%s2_restraint_control)
1063 CALL s2_control_create(qs_control%s2_restraint_control)
1064 ALLOCATE (qs_control%gapw_control)
1065 CALL se_control_create(qs_control%se_control)
1066 CALL dftb_control_create(qs_control%dftb_control)
1067 CALL xtb_control_create(qs_control%xtb_control)
1068 ALLOCATE (qs_control%cdft_control)
1069 CALL cdft_control_create(qs_control%cdft_control)
1070 END SUBROUTINE qs_control_create
1071
1072! **************************************************************************************************
1073!> \brief ...
1074!> \param qs_control ...
1075! **************************************************************************************************
1076 SUBROUTINE qs_control_release(qs_control)
1077 TYPE(qs_control_type), POINTER :: qs_control
1078
1079 INTEGER :: i
1080
1081 IF (ASSOCIATED(qs_control)) THEN
1082 CALL mulliken_control_release(qs_control%mulliken_restraint_control)
1083 DEALLOCATE (qs_control%mulliken_restraint_control)
1084 CALL s2_control_release(qs_control%s2_restraint_control)
1085 DEALLOCATE (qs_control%s2_restraint_control)
1086 CALL se_control_release(qs_control%se_control)
1087 CALL dftb_control_release(qs_control%dftb_control)
1088 CALL xtb_control_release(qs_control%xtb_control)
1089 IF (ASSOCIATED(qs_control%cdft_control)) THEN
1090 CALL cdft_control_release(qs_control%cdft_control)
1091 DEALLOCATE (qs_control%cdft_control)
1092 END IF
1093
1094 IF (ASSOCIATED(qs_control%e_cutoff)) THEN
1095 DEALLOCATE (qs_control%e_cutoff)
1096 END IF
1097 IF (ASSOCIATED(qs_control%gapw_control)) THEN
1098 IF (ASSOCIATED(qs_control%gapw_control%aw)) THEN
1099 DEALLOCATE (qs_control%gapw_control%aw)
1100 END IF
1101 DEALLOCATE (qs_control%gapw_control)
1102 END IF
1103 IF (ASSOCIATED(qs_control%ddapc_restraint_control)) THEN
1104 DO i = 1, SIZE(qs_control%ddapc_restraint_control)
1105 CALL ddapc_control_release(qs_control%ddapc_restraint_control(i))
1106 END DO
1107 DEALLOCATE (qs_control%ddapc_restraint_control)
1108 END IF
1109 DEALLOCATE (qs_control)
1110 END IF
1111 END SUBROUTINE qs_control_release
1112
1113! **************************************************************************************************
1114!> \brief allocate control options for Time-Dependent Density Functional Theory calculation
1115!> \param tddfpt_control an object to create
1116!> \par History
1117!> * 05.2016 created [Sergey Chulkov]
1118! **************************************************************************************************
1119 SUBROUTINE tddfpt2_control_create(tddfpt_control)
1120 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
1121
1122 CHARACTER(len=*), PARAMETER :: routinen = 'tddfpt2_control_create'
1123
1124 INTEGER :: handle
1125
1126 cpassert(.NOT. ASSOCIATED(tddfpt_control))
1127 CALL timeset(routinen, handle)
1128
1129 ALLOCATE (tddfpt_control)
1130 tddfpt_control%do_soc = .false.
1131
1132 CALL timestop(handle)
1133 END SUBROUTINE tddfpt2_control_create
1134
1135! **************************************************************************************************
1136!> \brief release memory allocated for TDDFT control options
1137!> \param tddfpt_control an object to release
1138!> \par History
1139!> * 05.2016 created [Sergey Chulkov]
1140! **************************************************************************************************
1141 SUBROUTINE tddfpt2_control_release(tddfpt_control)
1142 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
1143
1144 CHARACTER(len=*), PARAMETER :: routinen = 'tddfpt2_control_release'
1145
1146 INTEGER :: handle
1147
1148 CALL timeset(routinen, handle)
1149
1150 IF (ASSOCIATED(tddfpt_control)) THEN
1151 DEALLOCATE (tddfpt_control)
1152 END IF
1153
1154 CALL timestop(handle)
1155 END SUBROUTINE tddfpt2_control_release
1156
1157! **************************************************************************************************
1158!> \brief Creates and initializes the rixs_control_type
1159!> \param rixs_control the type to initialize
1160! **************************************************************************************************
1161 SUBROUTINE rixs_control_create(rixs_control)
1162 TYPE(rixs_control_type), POINTER :: rixs_control
1163
1164 cpassert(.NOT. ASSOCIATED(rixs_control))
1165 ALLOCATE (rixs_control)
1166
1167 NULLIFY (rixs_control%tddfpt2_control)
1168 CALL tddfpt2_control_create(rixs_control%tddfpt2_control)
1169 NULLIFY (rixs_control%xas_tdp_control)
1170 CALL xas_tdp_control_create(rixs_control%xas_tdp_control)
1171
1172 END SUBROUTINE rixs_control_create
1173
1174! **************************************************************************************************
1175!> \brief Releases the rixs_control_type
1176!> \param rixs_control ...
1177! **************************************************************************************************
1178 SUBROUTINE rixs_control_release(rixs_control)
1179 TYPE(rixs_control_type), POINTER :: rixs_control
1180
1181 IF (ASSOCIATED(rixs_control)) THEN
1182 CALL tddfpt2_control_release(rixs_control%tddfpt2_control)
1183 CALL xas_tdp_control_release(rixs_control%xas_tdp_control)
1184
1185 DEALLOCATE (rixs_control)
1186 END IF
1187
1188 END SUBROUTINE rixs_control_release
1189
1190! **************************************************************************************************
1191!> \brief ...
1192!> \param proj_mo_list ...
1193! **************************************************************************************************
1194 SUBROUTINE proj_mo_list_release(proj_mo_list)
1195 TYPE(proj_mo_p_type), DIMENSION(:), POINTER :: proj_mo_list
1196
1197 INTEGER :: i, mo_ref_nbr
1198
1199 IF (ASSOCIATED(proj_mo_list)) THEN
1200 DO i = 1, SIZE(proj_mo_list)
1201 IF (ASSOCIATED(proj_mo_list(i)%proj_mo)) THEN
1202 IF (ALLOCATED(proj_mo_list(i)%proj_mo%ref_mo_index)) &
1203 DEALLOCATE (proj_mo_list(i)%proj_mo%ref_mo_index)
1204 IF (ALLOCATED(proj_mo_list(i)%proj_mo%mo_ref)) THEN
1205 DO mo_ref_nbr = 1, SIZE(proj_mo_list(i)%proj_mo%mo_ref)
1206 CALL cp_fm_release(proj_mo_list(i)%proj_mo%mo_ref(mo_ref_nbr))
1207 END DO
1208 DEALLOCATE (proj_mo_list(i)%proj_mo%mo_ref)
1209 END IF
1210 IF (ALLOCATED(proj_mo_list(i)%proj_mo%td_mo_index)) &
1211 DEALLOCATE (proj_mo_list(i)%proj_mo%td_mo_index)
1212 IF (ALLOCATED(proj_mo_list(i)%proj_mo%td_mo_occ)) &
1213 DEALLOCATE (proj_mo_list(i)%proj_mo%td_mo_occ)
1214 DEALLOCATE (proj_mo_list(i)%proj_mo)
1215 END IF
1216 END DO
1217 DEALLOCATE (proj_mo_list)
1218 END IF
1219 END SUBROUTINE proj_mo_list_release
1220
1221! **************************************************************************************************
1222!> \brief ...
1223!> \param efield_fields ...
1224! **************************************************************************************************
1225 SUBROUTINE efield_fields_release(efield_fields)
1226 TYPE(efield_p_type), DIMENSION(:), POINTER :: efield_fields
1227
1228 INTEGER :: i
1229
1230 IF (ASSOCIATED(efield_fields)) THEN
1231 DO i = 1, SIZE(efield_fields)
1232 IF (ASSOCIATED(efield_fields(i)%efield)) THEN
1233 IF (ASSOCIATED(efield_fields(i)%efield%envelop_r_vars)) THEN
1234 DEALLOCATE (efield_fields(i)%efield%envelop_r_vars)
1235 END IF
1236 IF (ASSOCIATED(efield_fields(i)%efield%envelop_i_vars)) THEN
1237 DEALLOCATE (efield_fields(i)%efield%envelop_i_vars)
1238 END IF
1239 IF (ASSOCIATED(efield_fields(i)%efield%polarisation)) &
1240 DEALLOCATE (efield_fields(i)%efield%polarisation)
1241 DEALLOCATE (efield_fields(i)%efield)
1242 END IF
1243 END DO
1244 DEALLOCATE (efield_fields)
1245 END IF
1246 END SUBROUTINE efield_fields_release
1247
1248! **************************************************************************************************
1249!> \brief ...
1250!> \param dftb_control ...
1251! **************************************************************************************************
1252 SUBROUTINE dftb_control_create(dftb_control)
1253 TYPE(dftb_control_type), POINTER :: dftb_control
1254
1255 cpassert(.NOT. ASSOCIATED(dftb_control))
1256 ALLOCATE (dftb_control)
1257
1258 NULLIFY (dftb_control%sk_pair_list)
1259 END SUBROUTINE dftb_control_create
1260
1261! **************************************************************************************************
1262!> \brief ...
1263!> \param dftb_control ...
1264! **************************************************************************************************
1265 SUBROUTINE dftb_control_release(dftb_control)
1266 TYPE(dftb_control_type), POINTER :: dftb_control
1267
1268 IF (ASSOCIATED(dftb_control)) THEN
1269 IF (ASSOCIATED(dftb_control%sk_pair_list)) THEN
1270 DEALLOCATE (dftb_control%sk_pair_list)
1271 END IF
1272 DEALLOCATE (dftb_control)
1273 END IF
1274 END SUBROUTINE dftb_control_release
1275
1276! **************************************************************************************************
1277!> \brief ...
1278!> \param xtb_control ...
1279! **************************************************************************************************
1280 SUBROUTINE xtb_control_create(xtb_control)
1281 TYPE(xtb_control_type), POINTER :: xtb_control
1282
1283 cpassert(.NOT. ASSOCIATED(xtb_control))
1284 ALLOCATE (xtb_control)
1285
1286 NULLIFY (xtb_control%kab_param)
1287 NULLIFY (xtb_control%kab_vals)
1288 NULLIFY (xtb_control%kab_types)
1289 NULLIFY (xtb_control%nonbonded)
1290 NULLIFY (xtb_control%rcpair)
1291
1292 END SUBROUTINE xtb_control_create
1293
1294! **************************************************************************************************
1295!> \brief ...
1296!> \param xtb_control ...
1297! **************************************************************************************************
1298 SUBROUTINE xtb_control_release(xtb_control)
1299 TYPE(xtb_control_type), POINTER :: xtb_control
1300
1301 IF (ASSOCIATED(xtb_control)) THEN
1302 IF (ASSOCIATED(xtb_control%kab_param)) THEN
1303 DEALLOCATE (xtb_control%kab_param)
1304 END IF
1305 IF (ASSOCIATED(xtb_control%kab_vals)) THEN
1306 DEALLOCATE (xtb_control%kab_vals)
1307 END IF
1308 IF (ASSOCIATED(xtb_control%kab_types)) THEN
1309 DEALLOCATE (xtb_control%kab_types)
1310 END IF
1311 IF (ASSOCIATED(xtb_control%rcpair)) THEN
1312 DEALLOCATE (xtb_control%rcpair)
1313 END IF
1314 IF (ASSOCIATED(xtb_control%nonbonded)) THEN
1315 CALL pair_potential_p_release(xtb_control%nonbonded)
1316 END IF
1317 DEALLOCATE (xtb_control)
1318 END IF
1319 END SUBROUTINE xtb_control_release
1320
1321! **************************************************************************************************
1322!> \brief ...
1323!> \param se_control ...
1324! **************************************************************************************************
1325 SUBROUTINE se_control_create(se_control)
1326 TYPE(semi_empirical_control_type), POINTER :: se_control
1327
1328 cpassert(.NOT. ASSOCIATED(se_control))
1329 ALLOCATE (se_control)
1330 END SUBROUTINE se_control_create
1331
1332! **************************************************************************************************
1333!> \brief ...
1334!> \param se_control ...
1335! **************************************************************************************************
1336 SUBROUTINE se_control_release(se_control)
1337 TYPE(semi_empirical_control_type), POINTER :: se_control
1338
1339 IF (ASSOCIATED(se_control)) THEN
1340 DEALLOCATE (se_control)
1341 END IF
1342 END SUBROUTINE se_control_release
1343
1344! **************************************************************************************************
1345!> \brief ...
1346!> \param admm_control ...
1347! **************************************************************************************************
1348 SUBROUTINE admm_control_create(admm_control)
1349 TYPE(admm_control_type), POINTER :: admm_control
1350
1351 cpassert(.NOT. ASSOCIATED(admm_control))
1352 ALLOCATE (admm_control)
1353
1354 END SUBROUTINE admm_control_create
1355
1356! **************************************************************************************************
1357!> \brief ...
1358!> \param admm_control ...
1359! **************************************************************************************************
1360 SUBROUTINE admm_control_release(admm_control)
1361 TYPE(admm_control_type), POINTER :: admm_control
1362
1363 IF (ASSOCIATED(admm_control)) THEN
1364 DEALLOCATE (admm_control)
1365 END IF
1366 END SUBROUTINE admm_control_release
1367
1368! **************************************************************************************************
1369!> \brief ...
1370!> \param expot_control ...
1371! **************************************************************************************************
1372 SUBROUTINE expot_control_create(expot_control)
1373 TYPE(expot_control_type), POINTER :: expot_control
1374
1375 cpassert(.NOT. ASSOCIATED(expot_control))
1376 ALLOCATE (expot_control)
1377 expot_control%read_from_cube = .false.
1378 expot_control%maxwell_solver = .false.
1379 expot_control%static = .true.
1380 expot_control%scaling_factor = 1.0_dp
1381
1382 END SUBROUTINE expot_control_create
1383
1384! **************************************************************************************************
1385!> \brief ...
1386!> \param expot_control ...
1387! **************************************************************************************************
1388 SUBROUTINE expot_control_release(expot_control)
1389 TYPE(expot_control_type), POINTER :: expot_control
1390
1391 IF (ASSOCIATED(expot_control)) THEN
1392 DEALLOCATE (expot_control)
1393 END IF
1394
1395 END SUBROUTINE expot_control_release
1396
1397! **************************************************************************************************
1398!> \brief ...
1399!> \param maxwell_control ...
1400! **************************************************************************************************
1401 SUBROUTINE maxwell_control_create(maxwell_control)
1402 TYPE(maxwell_control_type), POINTER :: maxwell_control
1403
1404 cpassert(.NOT. ASSOCIATED(maxwell_control))
1405 ALLOCATE (maxwell_control)
1406
1407 END SUBROUTINE maxwell_control_create
1408
1409! **************************************************************************************************
1410!> \brief ...
1411!> \param maxwell_control ...
1412! **************************************************************************************************
1413 SUBROUTINE maxwell_control_release(maxwell_control)
1414 TYPE(maxwell_control_type), POINTER :: maxwell_control
1415
1416 IF (ASSOCIATED(maxwell_control)) THEN
1417 DEALLOCATE (maxwell_control)
1418 END IF
1419
1420 END SUBROUTINE maxwell_control_release
1421
1422END 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.