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