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