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