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