LCOV - code coverage report
Current view: top level - src - cp_control_types.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:561f475) Lines: 97.3 % 221 215
Test Date: 2026-06-21 06:48:54 Functions: 41.5 % 65 27

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

Generated by: LCOV version 2.0-1