93#include "./base/base_uses.f90"
99 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_control_utils'
121 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
123 CHARACTER(len=default_path_length) :: basis_set_file_name, &
124 intensities_file_name, &
126 CHARACTER(LEN=default_string_length), &
127 DIMENSION(:),
POINTER :: tmpstringlist
128 INTEGER :: admmtype, irep, isize, kg_tnadd_method, &
129 method_id, nrep, xc_deriv_method_id
130 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, do_rtp, exopt1, exopt2, exopt3, explicit, &
131 is_present, l_param, local_moment_possible, native_skala_grid, not_se, was_present
132 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
133 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
136 TYPE(
section_vals_type),
POINTER :: hairy_probes_section, hfx_section, kg_xc_fun_section, &
137 kg_xc_section, maxwell_section, sccs_section, scf_section, tmp_section, xc_fun_section, &
138 xc_gauxc_subsection, xc_section
140 was_present = .false.
144 NULLIFY (kg_xc_fun_section, kg_xc_section, tmp_section, xc_fun_section, xc_section, xc_gauxc_subsection)
145 ALLOCATE (dft_control)
151 SELECT CASE (method_id)
159 IF (.NOT. is_present .AND. not_se)
THEN
160 cpabort(
"XC section missing.")
167 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
168 CALL cp_warn(__location__, &
169 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
170 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
171 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
172 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
173 CALL cp_warn(__location__, &
174 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
175 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
176 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
177 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
178 CALL cp_warn(__location__, &
179 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
180 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
181 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
188 IF (.NOT. is_present .AND. not_se)
THEN
189 cpabort(
"XC_FUNCTIONAL section missing.")
192 dft_control%use_gauxc = .false.
201 IF (dft_control%uks .OR. dft_control%roks)
THEN
202 dft_control%nspins = 2
204 dft_control%nspins = 1
207 dft_control%lsd = (dft_control%nspins > 1)
209 IF (dft_control%use_gauxc)
THEN
210 native_skala_grid = .false.
212 IF (native_skala_grid) dft_control%use_kinetic_energy_density = .true.
223 dft_control%use_kinetic_energy_density = dft_control%use_kinetic_energy_density .OR. &
231 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
233 IF (dft_control%drho_by_collocation)
THEN
234 cpabort(
"derivatives by collocation not implemented")
241 IF (
SIZE(tmpstringlist) == 2)
THEN
243 SELECT CASE (tmpstringlist(2))
255 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
258 SELECT CASE (tmpstringlist(1))
261 dft_control%auto_basis_ri_aux = isize
263 dft_control%auto_basis_aux_fit = isize
265 dft_control%auto_basis_lri_aux = isize
267 dft_control%auto_basis_p_lri_aux = isize
269 dft_control%auto_basis_ri_hxc = isize
271 dft_control%auto_basis_ri_xas = isize
273 dft_control%auto_basis_ri_hfx = isize
275 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
278 CALL cp_abort(__location__, &
279 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
290 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
292 dft_control%do_admm = is_present
293 dft_control%do_admm_mo = .false.
294 dft_control%do_admm_dm = .false.
300 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
301 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
302 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
303 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
304 dft_control%admm_control%admm_type = admmtype
305 SELECT CASE (admmtype)
307 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
308 dft_control%admm_control%purification_method = method_id
309 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
310 dft_control%admm_control%method = method_id
311 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
312 dft_control%admm_control%scaling_model = method_id
317 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
318 dft_control%admm_control%purification_method = method_id
350 CALL cp_abort(__location__, &
351 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
355 r_val=dft_control%admm_control%eps_filter)
357 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
358 dft_control%admm_control%aux_exch_func = method_id
361 dft_control%admm_control%aux_exch_func_param = .false.
362 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
363 r_val=dft_control%admm_control%aux_x_param(1))
364 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
365 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
366 r_val=dft_control%admm_control%aux_x_param(2))
367 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
368 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
369 r_val=dft_control%admm_control%aux_x_param(3))
370 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
372 CALL read_admm_block_list(dft_control%admm_control, dft_section)
375 SELECT CASE (admmtype)
377 IF (exopt2)
CALL cp_warn(__location__, &
378 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
379 IF (exopt3)
CALL cp_warn(__location__, &
380 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
382 IF (exopt1)
CALL cp_warn(__location__, &
383 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
384 IF (exopt2)
CALL cp_warn(__location__, &
385 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
386 IF (exopt3)
CALL cp_warn(__location__, &
387 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
396 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
401 CALL cp_abort(__location__, &
402 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
403 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
409 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
411 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
416 dft_control%do_admm_dm = .true.
418 dft_control%do_admm_mo = .true.
426 dft_control%restricted = (dft_control%roks .AND. l_param)
430 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
431 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
432 IF (.NOT. dft_control%uks) &
433 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
434 "unrestricted Kohn-Sham (UKS) calculations")
439 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
442 dft_control%hairy_probes = .true.
443 ALLOCATE (dft_control%probe(nrep))
444 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
451 dft_control%sic_method_id =
sic_none
452 dft_control%sic_scaling_a = 1.0_dp
453 dft_control%sic_scaling_b = 1.0_dp
456 dft_control%dft_plus_u = .false.
458 dft_control%plus_u_method_id = method_id
461 dft_control%smear = .false.
464 dft_control%correct_surf_dip = .false.
465 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
467 dft_control%pos_dir_surf_dip = -1.0_dp
471 dft_control%switch_surf_dip = .false.
472 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
474 dft_control%correct_el_density_dip = .false.
475 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
476 IF (dft_control%correct_el_density_dip)
THEN
477 IF (dft_control%correct_surf_dip)
THEN
480 dft_control%correct_el_density_dip = .false.
481 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
486 c_val=basis_set_file_name)
488 c_val=potential_file_name)
493 i_val=dft_control%sic_method_id)
495 i_val=dft_control%sic_list_id)
497 r_val=dft_control%sic_scaling_a)
499 r_val=dft_control%sic_scaling_b)
505 CALL read_rtp_section(dft_control, tmp_section)
512 IF (dft_control%do_xas_calculation)
THEN
515 l_val=dft_control%do_xas_calculation)
519 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
520 IF (dft_control%do_xas_tdp_calculation)
THEN
523 l_val=dft_control%do_xas_tdp_calculation)
527 dft_control%apply_efield = .false.
528 dft_control%apply_efield_field = .false.
529 dft_control%apply_vector_potential = .false.
533 ALLOCATE (dft_control%efield_fields(nrep))
534 CALL read_efield_sections(dft_control, tmp_section, cell)
536 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
537 dft_control%apply_efield_field = .true.
539 dft_control%apply_vector_potential = .true.
541 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
544 dft_control%apply_efield = .true.
553 local_moment_possible = (dft_control%rtp_control%rtp_method ==
rtp_method_bse) .OR. &
554 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
555 IF (local_moment_possible .AND. (.NOT.
ASSOCIATED(dft_control%rtp_control%print_pol_elements)))
THEN
557 CALL guess_pol_elements(dft_control, &
558 dft_control%rtp_control%print_pol_elements)
564 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
565 IF (dft_control%apply_period_efield)
THEN
566 ALLOCATE (dft_control%period_efield)
568 dft_control%period_efield%polarisation(1:3) = pol(1:3)
569 IF (
PRESENT(cell))
THEN
570 IF (
ASSOCIATED(cell)) &
574 dft_control%period_efield%d_filter(1:3) = pol(1:3)
575 IF (
PRESENT(cell))
THEN
579 r_val=dft_control%period_efield%strength)
580 dft_control%period_efield%displacement_field = .false.
582 l_val=dft_control%period_efield%displacement_field)
588 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
590 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
591 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
592 "or INTENSITIES_FILE_NAME can be specified.")
595 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
596 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
599 IF (intensities_file_name /=
"")
THEN
601 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
602 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
603 "or INTENSITIES_FILE_NAME can be specified.")
616 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
619 ALLOCATE (dft_control%period_efield%strength_list(nrep))
624 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
631 i_val=dft_control%period_efield%start_frame)
633 i_val=dft_control%period_efield%end_frame)
635 IF (dft_control%period_efield%end_frame /= -1)
THEN
639 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
640 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
641 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
642 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
643 ELSE IF (mod(dft_control%period_efield%end_frame - &
644 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
645 CALL cp_abort(__location__, &
646 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
651 cpassert(.NOT. do_rtp)
652 IF (dft_control%period_efield%displacement_field)
THEN
662 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
663 IF (dft_control%apply_external_potential)
THEN
666 l_val=dft_control%expot_control%read_from_cube)
668 l_val=dft_control%expot_control%static)
670 r_val=dft_control%expot_control%scaling_factor)
675 dft_control%expot_control%maxwell_solver = .true.
679 r_val=dft_control%maxwell_control%real_test)
681 i_val=dft_control%maxwell_control%int_test)
683 l_val=dft_control%maxwell_control%log_test)
685 dft_control%expot_control%maxwell_solver = .false.
695 l_val=dft_control%do_sccs)
696 IF (dft_control%do_sccs)
THEN
697 ALLOCATE (dft_control%sccs_control)
699 r_val=dft_control%sccs_control%epsilon_solvent)
701 r_val=dft_control%sccs_control%alpha_solvent)
703 r_val=dft_control%sccs_control%beta_solvent)
705 r_val=dft_control%sccs_control%delta_rho)
707 i_val=dft_control%sccs_control%derivative_method)
709 i_val=dft_control%sccs_control%method_id)
711 r_val=dft_control%sccs_control%eps_sccs)
713 r_val=dft_control%sccs_control%eps_scf)
715 r_val=dft_control%sccs_control%gamma_solvent)
717 i_val=dft_control%sccs_control%max_iter)
719 r_val=dft_control%sccs_control%mixing)
720 SELECT CASE (dft_control%sccs_control%method_id)
724 r_val=dft_control%sccs_control%rho_max)
726 r_val=dft_control%sccs_control%rho_min)
727 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
728 CALL cp_abort(__location__, &
729 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
730 "Please, check your input!")
736 r_val=dft_control%sccs_control%beta)
737 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
738 CALL cp_abort(__location__, &
739 "A value smaller than 0.5 for the SCCS parameter beta "// &
740 "causes numerical problems. Please, check your input!")
743 r_val=dft_control%sccs_control%rho_zero)
746 cpabort(
"Invalid SCCS model specified. Please, check your input!")
758 l_val=dft_control%do_pcc)
759 IF (dft_control%do_pcc)
THEN
760 ALLOCATE (dft_control%pcc_control)
762 r_val=dft_control%pcc_control%dist_edge)
764 r_val=dft_control%pcc_control%gau_c)
766 i_val=dft_control%pcc_control%surf_normal)
776 l_val=dft_control%do_paep)
777 IF (dft_control%do_paep)
THEN
778 ALLOCATE (dft_control%paep_control)
780 i_val=dft_control%paep_control%surf_normal)
787 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
838 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
840 INTEGER :: handle, igrid_level, ngrid_level
841 LOGICAL :: explicit, multigrid_set
843 REAL(
dp),
DIMENSION(:),
POINTER :: cutofflist
846 CALL timeset(routinen, handle)
848 NULLIFY (mgrid_section, cutofflist)
854 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
859 l_val=qs_control%skip_load_balance_distributed)
862 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
864 multigrid_set = .false.
867 IF (.NOT. explicit) cutoff = 1.0_dp
870 ALLOCATE (qs_control%e_cutoff(ngrid_level))
871 qs_control%cutoff = cutoff
873 IF (multigrid_set)
THEN
875 IF (qs_control%commensurate_mgrids)
THEN
876 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
880 IF (
ASSOCIATED(cutofflist))
THEN
881 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
882 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
884 DO igrid_level = 1, ngrid_level
885 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
889 DO igrid_level = ngrid_level, 1, -1
890 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
891 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
895 IF (igrid_level == 1)
THEN
896 qs_control%cutoff = qs_control%e_cutoff(1)
900 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
901 qs_control%e_cutoff(1) = qs_control%cutoff
902 DO igrid_level = 2, ngrid_level
903 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
904 qs_control%progression_factor
908 DO igrid_level = 2, ngrid_level
909 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
910 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
911 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
912 cpabort(
"The same cutoff value was specified for two multi-grids")
915 CALL timestop(handle)
928 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
930 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
932 CHARACTER(LEN=default_string_length) :: cval
933 CHARACTER(LEN=default_string_length), &
934 DIMENSION(:),
POINTER :: clist
935 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
937 INTEGER,
DIMENSION(:),
POINTER :: tmplist
938 LOGICAL :: dftb_scc_mixer_explicit, dftb_tblite_mixer_explicit, explicit, &
939 tblite_reference_cli, tblite_reference_cli_section, tblite_section_active, was_present, &
940 xtb_scc_mixer_explicit, xtb_tblite_mixer_explicit
941 REAL(
dp) :: tmp, tmpsqrt, value
942 REAL(
dp),
POINTER :: scal(:)
943 TYPE(
section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
944 dftb_parameter, dftb_section, dftb_tblite_mixer, eeq_section, genpot_section, &
945 lri_optbas_section, mull_section, nonbonded_section, s2_restraint_section, se_section, &
946 xtb_parameter, xtb_section, xtb_tblite, xtb_tblite_mixer, xtb_tblite_ref_cli
948 CALL timeset(routinen, handle)
950 was_present = .false.
951 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
952 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
953 cdft_control_section, genpot_section, eeq_section, dftb_tblite_mixer, &
954 xtb_tblite_mixer, xtb_tblite_ref_cli)
977 tmpsqrt = sqrt(
value)
980 qs_control%eps_core_charge =
value/100.0_dp
983 qs_control%eps_pgf_orb = tmpsqrt
984 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
986 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
988 qs_control%eps_ppl = 1.0e-2_dp
990 qs_control%gapw_control%eps_cpc =
value
992 qs_control%eps_rho_gspace =
value
993 qs_control%eps_rho_rspace =
value
995 qs_control%eps_gvg_rspace = tmpsqrt
1002 IF (n_rep /= 0)
THEN
1006 IF (n_rep /= 0)
THEN
1010 IF (n_rep /= 0)
THEN
1012 qs_control%eps_kg_orb = sqrt(tmp)
1015 IF (n_rep /= 0)
THEN
1019 IF (n_rep /= 0)
THEN
1023 IF (n_rep /= 0)
THEN
1025 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
1028 IF (n_rep /= 0)
THEN
1032 IF (n_rep /= 0)
THEN
1036 IF (n_rep /= 0)
THEN
1040 IF (n_rep /= 0)
THEN
1048 CALL section_vals_val_get(qs_section,
"ALPHA0_HARD", r_val=qs_control%gapw_control%alpha0_hard)
1049 qs_control%gapw_control%alpha0_hard_from_input = .false.
1050 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
1052 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
1054 CALL section_vals_val_get(qs_section,
"MIN_PAIR_LIST_RADIUS", r_val=qs_control%pairlist_radius)
1062 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
1063 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
1074 IF (qs_control%gapw_control%basis_1c /=
gapw_1c_orb)
THEN
1075 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
1078 CALL section_vals_val_get(qs_section,
"GAPW_ACCURATE_XCINT", l_val=qs_control%gapw_control%accurate_xcint)
1085 qs_control%pw_grid_opt%spherical = .true.
1086 qs_control%pw_grid_opt%fullspace = .false.
1088 qs_control%pw_grid_opt%spherical = .false.
1089 qs_control%pw_grid_opt%fullspace = .true.
1091 qs_control%pw_grid_opt%spherical = .false.
1092 qs_control%pw_grid_opt%fullspace = .false.
1097 qs_control%do_ppl_method = itmp
1100 qs_control%pw_grid_opt%distribution_layout = tmplist
1104 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
1105 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
1109 qs_control%gapw = .false.
1110 qs_control%gapw_xc = .false.
1111 qs_control%gpw = .false.
1112 qs_control%pao = .false.
1113 qs_control%dftb = .false.
1114 qs_control%xtb = .false.
1115 qs_control%semi_empirical = .false.
1116 qs_control%ofgpw = .false.
1117 qs_control%lrigpw = .false.
1118 qs_control%rigpw = .false.
1119 SELECT CASE (qs_control%method_id)
1123 qs_control%gapw = .true.
1125 qs_control%gapw_xc = .true.
1129 qs_control%gpw = .true.
1131 qs_control%ofgpw = .true.
1133 qs_control%lrigpw = .true.
1135 qs_control%rigpw = .true.
1137 qs_control%dftb = .true.
1141 qs_control%xtb = .true.
1146 qs_control%semi_empirical = .true.
1149 qs_control%semi_empirical = .true.
1152 qs_control%semi_empirical = .true.
1155 qs_control%semi_empirical = .true.
1158 qs_control%semi_empirical = .true.
1161 qs_control%semi_empirical = .true.
1164 qs_control%semi_empirical = .true.
1167 qs_control%semi_empirical = .true.
1171 qs_control%semi_empirical = .true.
1174 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1176 IF (qs_control%mulliken_restraint)
THEN
1177 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1178 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1183 jj = jj +
SIZE(tmplist)
1185 qs_control%mulliken_restraint_control%natoms = jj
1186 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1187 cpabort(
"Need at least 1 atom to use mulliken constraints")
1188 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1192 DO j = 1,
SIZE(tmplist)
1194 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1198 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1199 IF (qs_control%ddapc_restraint)
THEN
1200 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1202 qs_control%ddapc_restraint_is_spin = .false.
1203 qs_control%ddapc_explicit_potential = .false.
1206 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1207 IF (qs_control%s2_restraint)
THEN
1209 r_val=qs_control%s2_restraint_control%strength)
1211 r_val=qs_control%s2_restraint_control%target)
1213 i_val=qs_control%s2_restraint_control%functional_form)
1217 IF (qs_control%cdft)
THEN
1222 IF (qs_control%semi_empirical)
THEN
1224 l_val=qs_control%se_control%orthogonal_basis)
1226 r_val=qs_control%se_control%delta)
1228 l_val=qs_control%se_control%analytical_gradients)
1230 l_val=qs_control%se_control%force_kdsod_EX)
1233 i_val=qs_control%se_control%integral_screening)
1236 CALL cp_warn(__location__, &
1237 "PNNL semi-empirical parameterization supports only the Slater type "// &
1238 "integral scheme. Revert to Slater and continue the calculation.")
1243 i_val=qs_control%se_control%ga_ncells)
1246 r_val=qs_control%se_control%cutoff_lrc)
1247 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1252 r_val=qs_control%se_control%taper_lrc)
1255 r_val=qs_control%se_control%range_lrc)
1258 r_val=qs_control%se_control%cutoff_cou)
1259 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1264 r_val=qs_control%se_control%taper_cou)
1267 r_val=qs_control%se_control%range_cou)
1270 r_val=qs_control%se_control%cutoff_exc)
1271 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1276 r_val=qs_control%se_control%taper_exc)
1279 r_val=qs_control%se_control%range_exc)
1283 r_val=qs_control%se_control%taper_scr)
1285 r_val=qs_control%se_control%range_scr)
1289 i_val=qs_control%se_control%periodic_type)
1290 SELECT CASE (qs_control%se_control%periodic_type)
1292 qs_control%se_control%do_ewald = .false.
1293 qs_control%se_control%do_ewald_r3 = .false.
1294 qs_control%se_control%do_ewald_gks = .false.
1296 qs_control%se_control%do_ewald = .true.
1297 qs_control%se_control%do_ewald_r3 = .false.
1298 qs_control%se_control%do_ewald_gks = .false.
1300 qs_control%se_control%do_ewald = .false.
1301 qs_control%se_control%do_ewald_r3 = .false.
1302 qs_control%se_control%do_ewald_gks = .true.
1304 CALL cp_abort(__location__, &
1305 "A periodic semi-empirical calculation was requested with a long-range "// &
1306 "summation on the single integral evaluation. This scheme is supported "// &
1307 "only by the PNNL parameterization.")
1309 qs_control%se_control%do_ewald = .true.
1310 qs_control%se_control%do_ewald_r3 = .true.
1311 qs_control%se_control%do_ewald_gks = .false.
1312 IF (qs_control%se_control%integral_screening /=
do_se_is_kdso) &
1313 CALL cp_abort(__location__, &
1314 "A periodic semi-empirical calculation was requested with a long-range "// &
1315 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1316 "with the integral screening chosen. The only integral screening supported "// &
1317 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1322 l_val=qs_control%se_control%dispersion)
1324 r_val=qs_control%se_control%rcdisp)
1326 r_val=qs_control%se_control%epscn)
1328 qs_control%se_control%sd3(1) = scal(1)
1329 qs_control%se_control%sd3(2) = scal(2)
1330 qs_control%se_control%sd3(3) = scal(3)
1332 c_val=qs_control%se_control%dispersion_parameter_file)
1336 cpabort(
"EWALD_R3 not implemented yet!")
1348 qs_control%se_control%orthogonal_basis = .true.
1353 IF (qs_control%dftb)
THEN
1355 l_val=qs_control%dftb_control%orthogonal_basis)
1357 l_val=qs_control%dftb_control%self_consistent)
1359 l_val=qs_control%dftb_control%dispersion)
1361 l_val=qs_control%dftb_control%dftb3_diagonal)
1363 l_val=qs_control%dftb_control%hb_sr_damp)
1365 explicit=dftb_scc_mixer_explicit)
1367 i_val=qs_control%dftb_control%tblite_scc_mixer)
1368 CALL section_vals_get(dftb_tblite_mixer, explicit=dftb_tblite_mixer_explicit)
1369 CALL read_tblite_mixer_section(dftb_tblite_mixer, &
1370 qs_control%dftb_control%tblite_mixer_iterations, &
1371 qs_control%dftb_control%tblite_mixer_memory, &
1372 qs_control%dftb_control%tblite_mixer_solver, &
1373 qs_control%dftb_control%tblite_mixer_damping, &
1374 qs_control%dftb_control%tblite_mixer_omega0, &
1375 qs_control%dftb_control%tblite_mixer_min_weight, &
1376 qs_control%dftb_control%tblite_mixer_max_weight, &
1377 qs_control%dftb_control%tblite_mixer_weight_factor, &
1378 "DFTB/TBLITE_MIXER")
1379 IF (qs_control%do_ls_scf)
THEN
1380 IF (dftb_scc_mixer_explicit .AND. &
1382 CALL cp_warn(__location__, &
1383 "DFTB/SCC_MIXER is reset to NONE with QS/LS_SCF; LS_SCF optimizes "// &
1384 "the density matrix directly.")
1385 IF (dftb_tblite_mixer_explicit) &
1386 CALL cp_warn(__location__, &
1387 "DFTB/TBLITE_MIXER settings are ignored with QS/LS_SCF; LS_SCF controls "// &
1388 "the density-matrix optimization.")
1391 IF (qs_control%dftb_control%tblite_mixer_damping <= 0.0_dp) &
1392 cpabort(
"DFTB/TBLITE_MIXER/DAMPING must be positive")
1394 r_val=qs_control%dftb_control%eps_disp)
1398 l_val=qs_control%dftb_control%do_ewald)
1400 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1403 c_val=qs_control%dftb_control%sk_file_path)
1405 c_val=qs_control%dftb_control%sk_file_list)
1407 r_val=qs_control%dftb_control%hb_sr_para)
1409 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1413 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1417 i_val=qs_control%dftb_control%dispersion_type)
1419 c_val=qs_control%dftb_control%uff_force_field)
1422 r_val=qs_control%dftb_control%rcdisp)
1424 r_val=qs_control%dftb_control%epscn)
1426 r_val=qs_control%dftb_control%exp_pre)
1428 r_val=qs_control%dftb_control%scaling)
1430 qs_control%dftb_control%sd3(1) = scal(1)
1431 qs_control%dftb_control%sd3(2) = scal(2)
1432 qs_control%dftb_control%sd3(3) = scal(3)
1434 qs_control%dftb_control%sd3bj(1) = scal(1)
1435 qs_control%dftb_control%sd3bj(2) = scal(2)
1436 qs_control%dftb_control%sd3bj(3) = scal(3)
1437 qs_control%dftb_control%sd3bj(4) = scal(4)
1439 c_val=qs_control%dftb_control%dispersion_parameter_file)
1441 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(
zhechkov2005)
1442 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(
elstner1998)
1443 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(
hu2007)
1447 IF (qs_control%xtb)
THEN
1450 qs_control%xtb_control%do_tblite = (qs_control%xtb_control%gfn_type ==
gfn_tblite)
1451 IF (qs_control%xtb_control%do_tblite)
THEN
1452 IF (.NOT. tblite_section_active) &
1453 cpabort(
"XTB/GFN_TYPE TBLITE requires an XTB/TBLITE section")
1455 qs_control%xtb_control%gfn_type =
gfn1xtb
1456 ELSE IF (tblite_section_active)
THEN
1457 cpabort(
"The XTB/TBLITE section requires XTB/GFN_TYPE TBLITE")
1460 explicit=xtb_scc_mixer_explicit)
1462 i_val=qs_control%xtb_control%tblite_scc_mixer)
1463 CALL section_vals_get(xtb_tblite_mixer, explicit=xtb_tblite_mixer_explicit)
1464 CALL read_tblite_mixer_section(xtb_tblite_mixer, &
1465 qs_control%xtb_control%tblite_mixer_iterations, &
1466 qs_control%xtb_control%tblite_mixer_memory, &
1467 qs_control%xtb_control%tblite_mixer_solver, &
1468 qs_control%xtb_control%tblite_mixer_damping, &
1469 qs_control%xtb_control%tblite_mixer_omega0, &
1470 qs_control%xtb_control%tblite_mixer_min_weight, &
1471 qs_control%xtb_control%tblite_mixer_max_weight, &
1472 qs_control%xtb_control%tblite_mixer_weight_factor, &
1474 IF (xtb_tblite_mixer_explicit) &
1476 explicit=qs_control%xtb_control%tblite_mixer_damping_explicit)
1477 IF ((.NOT. qs_control%xtb_control%do_tblite) .AND. &
1478 qs_control%xtb_control%gfn_type == 0)
THEN
1479 IF (xtb_scc_mixer_explicit .AND. &
1482 CALL cp_warn(__location__, &
1483 "XTB/SCC_MIXER is reset to NONE for CP2K-internal GFN0-xTB; "// &
1484 "GFN0-xTB has no SCC variables to mix.")
1485 IF (xtb_tblite_mixer_explicit) &
1486 CALL cp_warn(__location__, &
1487 "XTB/TBLITE_MIXER settings are ignored for CP2K-internal GFN0-xTB; "// &
1488 "GFN0-xTB has no SCC variables to mix.")
1491 IF (qs_control%do_ls_scf)
THEN
1492 IF (xtb_scc_mixer_explicit .AND. &
1494 CALL cp_warn(__location__, &
1495 "XTB/SCC_MIXER is reset to NONE with QS/LS_SCF; LS_SCF optimizes "// &
1496 "the density matrix directly.")
1497 IF (xtb_tblite_mixer_explicit) &
1498 CALL cp_warn(__location__, &
1499 "XTB/TBLITE_MIXER settings are ignored with QS/LS_SCF; LS_SCF controls "// &
1500 "the density-matrix optimization.")
1503 IF (qs_control%xtb_control%tblite_mixer_damping <= 0.0_dp) &
1504 cpabort(
"XTB/TBLITE_MIXER/DAMPING must be positive")
1508 l_val=qs_control%xtb_control%do_ewald)
1510 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1528 SELECT CASE (qs_control%xtb_control%gfn_type)
1535 cpabort(
"gfn2-xtb tbd")
1542 qs_control%xtb_control%sto_ng = ngauss
1544 qs_control%xtb_control%h_sto_ng = ngauss
1546 c_val=qs_control%xtb_control%parameter_file_path)
1550 c_val=qs_control%xtb_control%parameter_file_name)
1552 SELECT CASE (qs_control%xtb_control%gfn_type)
1554 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1556 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1558 cpabort(
"gfn2-xtb tbd")
1565 r_val=qs_control%xtb_control%rcdisp)
1567 r_val=qs_control%xtb_control%epscn)
1571 qs_control%xtb_control%s6 = scal(1)
1572 qs_control%xtb_control%s8 = scal(2)
1574 SELECT CASE (qs_control%xtb_control%gfn_type)
1576 qs_control%xtb_control%s6 = 1.00_dp
1577 qs_control%xtb_control%s8 = 2.85_dp
1579 qs_control%xtb_control%s6 = 1.00_dp
1580 qs_control%xtb_control%s8 = 2.40_dp
1582 cpabort(
"gfn2-xtb tbd")
1590 qs_control%xtb_control%a1 = scal(1)
1591 qs_control%xtb_control%a2 = scal(2)
1593 SELECT CASE (qs_control%xtb_control%gfn_type)
1595 qs_control%xtb_control%a1 = 0.80_dp
1596 qs_control%xtb_control%a2 = 4.60_dp
1598 qs_control%xtb_control%a1 = 0.63_dp
1599 qs_control%xtb_control%a2 = 5.00_dp
1601 cpabort(
"gfn2-xtb tbd")
1607 c_val=qs_control%xtb_control%dispersion_parameter_file)
1612 qs_control%xtb_control%ks = scal(1)
1613 qs_control%xtb_control%kp = scal(2)
1614 qs_control%xtb_control%kd = scal(3)
1615 qs_control%xtb_control%ksp = scal(4)
1616 qs_control%xtb_control%k2sh = scal(5)
1617 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1619 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1622 SELECT CASE (qs_control%xtb_control%gfn_type)
1624 qs_control%xtb_control%ks = 2.00_dp
1625 qs_control%xtb_control%kp = 2.4868_dp
1626 qs_control%xtb_control%kd = 2.27_dp
1627 qs_control%xtb_control%ksp = 2.2434_dp
1628 qs_control%xtb_control%k2sh = 1.1241_dp
1630 qs_control%xtb_control%ks = 1.85_dp
1631 qs_control%xtb_control%kp = 2.25_dp
1632 qs_control%xtb_control%kd = 2.00_dp
1633 qs_control%xtb_control%ksp = 2.08_dp
1634 qs_control%xtb_control%k2sh = 2.85_dp
1636 cpabort(
"gfn2-xtb tbd")
1644 qs_control%xtb_control%kg = scal(1)
1645 qs_control%xtb_control%kf = scal(2)
1647 SELECT CASE (qs_control%xtb_control%gfn_type)
1649 qs_control%xtb_control%kg = 2.00_dp
1650 qs_control%xtb_control%kf = 1.50_dp
1652 qs_control%xtb_control%kg = 2.00_dp
1653 qs_control%xtb_control%kf = 1.50_dp
1655 cpabort(
"gfn2-xtb tbd")
1661 qs_control%xtb_control%kcns = scal(1)
1662 qs_control%xtb_control%kcnp = scal(2)
1663 qs_control%xtb_control%kcnd = scal(3)
1668 SELECT CASE (qs_control%xtb_control%gfn_type)
1670 qs_control%xtb_control%ksen = scal(1)
1671 qs_control%xtb_control%kpen = scal(2)
1672 qs_control%xtb_control%kden = scal(3)
1674 qs_control%xtb_control%ken = scal(1)
1676 cpabort(
"gfn2-xtb tbd")
1681 SELECT CASE (qs_control%xtb_control%gfn_type)
1683 qs_control%xtb_control%ksen = 0.006_dp
1684 qs_control%xtb_control%kpen = -0.001_dp
1685 qs_control%xtb_control%kden = -0.002_dp
1687 qs_control%xtb_control%ken = -0.007_dp
1689 cpabort(
"gfn2-xtb tbd")
1696 qs_control%xtb_control%ben = scal(1)
1701 r_val=qs_control%xtb_control%enscale)
1703 SELECT CASE (qs_control%xtb_control%gfn_type)
1705 qs_control%xtb_control%enscale = -0.09_dp
1707 qs_control%xtb_control%enscale = 0._dp
1709 cpabort(
"gfn2-xtb tbd")
1716 l_val=qs_control%xtb_control%xb_interaction)
1718 qs_control%xtb_control%kxr = scal(1)
1719 qs_control%xtb_control%kx2 = scal(2)
1722 l_val=qs_control%xtb_control%do_nonbonded)
1724 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1728 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1732 r_val=qs_control%xtb_control%eps_pair)
1735 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1737 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1743 SELECT CASE (qs_control%xtb_control%gfn_type)
1745 qs_control%xtb_control%coulomb_interaction = .false.
1746 qs_control%xtb_control%coulomb_lr = .false.
1747 qs_control%xtb_control%tb3_interaction = .false.
1748 qs_control%xtb_control%check_atomic_charges = .false.
1750 l_val=qs_control%xtb_control%var_dipole)
1754 l_val=qs_control%xtb_control%coulomb_interaction)
1756 l_val=qs_control%xtb_control%coulomb_lr)
1758 l_val=qs_control%xtb_control%tb3_interaction)
1761 l_val=qs_control%xtb_control%check_atomic_charges)
1762 qs_control%xtb_control%var_dipole = .false.
1764 cpabort(
"gfn2-xtb tbd")
1768 qs_control%xtb_control%kab_nval = n_rep
1770 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1771 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1772 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1775 qs_control%xtb_control%kab_param(1, j) = clist(1)
1777 ielement=qs_control%xtb_control%kab_types(1, j))
1778 qs_control%xtb_control%kab_param(2, j) = clist(2)
1780 ielement=qs_control%xtb_control%kab_types(2, j))
1781 qs_control%xtb_control%kab_param(3, j) = clist(3)
1782 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1786 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1788 qs_control%xtb_control%ksrb = scal(1)
1789 qs_control%xtb_control%esrb = scal(2)
1790 qs_control%xtb_control%gscal = scal(3)
1791 qs_control%xtb_control%c1srb = scal(4)
1792 qs_control%xtb_control%c2srb = scal(5)
1793 qs_control%xtb_control%shift = scal(6)
1798 SELECT CASE (trim(cval))
1800 qs_control%xtb_control%enshift_type = 0
1802 qs_control%xtb_control%enshift_type = 1
1804 qs_control%xtb_control%enshift_type = 2
1806 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1810 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1817 IF (qs_control%xtb_control%do_tblite)
THEN
1819 i_val=qs_control%xtb_control%tblite_method)
1821 c_val=qs_control%xtb_control%tblite_param_file)
1823 r_val=qs_control%xtb_control%tblite_accuracy)
1824 IF (qs_control%xtb_control%tblite_accuracy <= 0.0_dp) &
1825 cpabort(
"XTB/TBLITE/ACCURACY must be positive")
1826 IF (qs_control%xtb_control%tblite_mixer_damping <= 0.0_dp) &
1827 cpabort(
"XTB/TBLITE_MIXER/DAMPING must be positive")
1829 CALL section_vals_get(xtb_tblite_ref_cli, explicit=tblite_reference_cli_section)
1830 IF (tblite_reference_cli .AND. (.NOT. tblite_reference_cli_section)) &
1831 cpabort(
"XTB/TBLITE/REFERENCE_CLI keyword requires an XTB/TBLITE/REFERENCE_CLI section")
1832 IF (tblite_reference_cli .OR. tblite_reference_cli_section)
THEN
1833 CALL read_xtb_reference_cli_section(xtb_tblite_ref_cli, qs_control%xtb_control%reference_cli, cell)
1834 qs_control%xtb_control%reference_cli%enabled = .true.
1842 CALL timestop(handle)
1858 SUBROUTINE read_tblite_mixer_section(mixer_section, iterations, memory, solver, damping, omega0, min_weight, &
1859 max_weight, weight_factor, section_name)
1861 INTEGER,
INTENT(INOUT) :: iterations, memory, solver
1862 REAL(kind=
dp),
INTENT(INOUT) :: damping, omega0, min_weight, max_weight, &
1864 CHARACTER(LEN=*),
INTENT(IN) :: section_name
1866 LOGICAL :: explicit, memory_explicit
1869 IF (.NOT. explicit)
RETURN
1884 IF (iterations < 1) cpabort(trim(section_name)//
"/ITERATIONS must be positive")
1885 IF (memory < 1) cpabort(trim(section_name)//
"/MEMORY must be positive")
1886 SELECT CASE (solver)
1889 cpabort(trim(section_name)//
"/SOLVER must be GVD or GVR")
1891 IF (damping <= 0.0_dp) cpabort(trim(section_name)//
"/DAMPING must be positive")
1892 IF (omega0 <= 0.0_dp) cpabort(trim(section_name)//
"/OMEGA0 must be positive")
1893 IF (min_weight <= 0.0_dp) cpabort(trim(section_name)//
"/MIN_WEIGHT must be positive")
1894 IF (max_weight <= 0.0_dp) cpabort(trim(section_name)//
"/MAX_WEIGHT must be positive")
1895 IF (max_weight < min_weight) &
1896 cpabort(trim(section_name)//
"/MAX_WEIGHT must not be smaller than MIN_WEIGHT")
1897 IF (weight_factor <= 0.0_dp) cpabort(trim(section_name)//
"/WEIGHT_FACTOR must be positive")
1899 END SUBROUTINE read_tblite_mixer_section
1907 SUBROUTINE read_xtb_reference_cli_section(ref_cli_section, ref_cli, cell)
1910 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
1912 REAL(kind=
dp),
DIMENSION(:),
POINTER :: efield
1914 param_section, solvation_section, &
1928 c_val=ref_cli%post_processing_output_file)
1930 IF (ref_cli%efield_active)
THEN
1933 ref_cli%efield = efield(1:3)
1934 IF (
PRESENT(cell))
THEN
1939 CALL section_vals_get(solvation_section, explicit=ref_cli%solvation_active)
1940 IF (ref_cli%solvation_active)
THEN
1943 CALL section_vals_val_get(solvation_section,
"BORN_KERNEL", i_val=ref_cli%solvation_born_kernel)
1945 IF (len_trim(ref_cli%solvation_solvent) == 0) &
1946 cpabort(
"REFERENCE_CLI implicit solvation needs SOLVENT")
1949 cpabort(
"BORN_KERNEL is invalid with MODEL CPCM")
1951 SELECT CASE (ref_cli%solvation_model)
1955 cpabort(
"SOLUTION_STATE is valid only for ALPB/GBSA")
1960 r_val=ref_cli%electronic_temperature_guess)
1961 IF (ref_cli%electronic_temperature_guess < 0.0_dp) &
1962 cpabort(
"XTB/TBLITE/REFERENCE_CLI/ELECTRONIC_TEMPERATURE_GUESS must not be negative")
1963 IF (ref_cli%electronic_temperature_guess > 0.0_dp .AND. ref_cli%guess /=
tblite_guess_ceh) &
1964 cpabort(
"XTB/TBLITE/REFERENCE_CLI/ELECTRONIC_TEMPERATURE_GUESS requires GUESS CEH")
1967 IF (ref_cli%guess_cli%enabled)
THEN
1970 r_val=ref_cli%guess_cli%electronic_temperature_guess)
1971 IF (ref_cli%guess_cli%electronic_temperature_guess < 0.0_dp) &
1972 cpabort(
"REFERENCE_CLI/GUESS_CLI/ELECTRONIC_TEMPERATURE_GUESS must not be negative")
1975 IF (ref_cli%guess_cli%efield_active)
THEN
1978 ref_cli%guess_cli%efield = efield(1:3)
1979 IF (
PRESENT(cell))
THEN
1990 IF (ref_cli%param_cli%enabled)
THEN
1991 CALL section_vals_val_get(param_section,
"METHOD", explicit=ref_cli%param_cli%method_explicit, &
1992 i_val=ref_cli%param_cli%method)
1998 IF (ref_cli%fit_cli%enabled)
THEN
2003 IF (len_trim(ref_cli%fit_cli%param_file) == 0) &
2004 cpabort(
"XTB/TBLITE/REFERENCE_CLI/FIT_CLI needs PARAM_FILE")
2005 IF (len_trim(ref_cli%fit_cli%input_file) == 0) &
2006 cpabort(
"XTB/TBLITE/REFERENCE_CLI/FIT_CLI needs INPUT_FILE")
2009 CALL section_vals_get(tagdiff_section, explicit=ref_cli%tagdiff_cli%enabled)
2010 IF (ref_cli%tagdiff_cli%enabled)
THEN
2012 CALL section_vals_val_get(tagdiff_section,
"REFERENCE", c_val=ref_cli%tagdiff_cli%reference_file)
2014 IF (len_trim(ref_cli%tagdiff_cli%actual_file) == 0) &
2015 cpabort(
"XTB/TBLITE/REFERENCE_CLI/TAGDIFF_CLI needs ACTUAL")
2016 IF (len_trim(ref_cli%tagdiff_cli%reference_file) == 0) &
2017 cpabort(
"XTB/TBLITE/REFERENCE_CLI/TAGDIFF_CLI needs REFERENCE")
2026 END SUBROUTINE read_xtb_reference_cli_section
2039 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
2041 CHARACTER(LEN=default_string_length), &
2042 DIMENSION(:),
POINTER :: tmpstringlist
2043 INTEGER :: handle, irep, isize, nrep
2044 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
2045 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
2047 REAL(kind=
dp) :: filter, fval, hfx
2049 soc_section, stda_section, xc_func, &
2052 CALL timeset(routinen, handle)
2068 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
2078 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
2079 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
2080 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
2081 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
2087 IF (
SIZE(tmpstringlist) == 2)
THEN
2089 SELECT CASE (tmpstringlist(2))
2101 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
2104 SELECT CASE (tmpstringlist(1))
2107 t_control%auto_basis_p_lri_aux = isize
2109 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
2112 CALL cp_abort(__location__, &
2113 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
2117 IF (t_control%conv < 0) &
2118 t_control%conv = abs(t_control%conv)
2126 t_control%dipole_form = 0
2131 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
2133 NULLIFY (t_control%dipole_ref_point)
2135 cpabort(
"User-defined reference point should be given explicitly")
2143 t_control%do_soc = .true.
2150 IF (t_control%mgrid_is_explicit)
THEN
2151 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
2152 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
2154 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
2155 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
2158 r_val=t_control%mgrid_progression_factor, explicit=explicit)
2160 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
2161 CALL cp_abort(__location__, &
2162 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
2164 t_control%mgrid_progression_factor = qs_control%progression_factor
2167 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
2168 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
2169 IF (t_control%mgrid_commensurate_mgrids)
THEN
2171 t_control%mgrid_progression_factor = 4.0_dp
2173 t_control%mgrid_progression_factor = qs_control%progression_factor
2177 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
2178 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
2180 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
2181 IF (.NOT. explicit) multigrid_set = .false.
2182 IF (multigrid_set)
THEN
2185 NULLIFY (t_control%mgrid_e_cutoff)
2188 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
2189 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
2192 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
2193 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
2195 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
2196 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
2197 cpabort(
"Inconsistent values for number of multi-grids")
2200 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
2201 ALLOCATE (inds(t_control%mgrid_ngrids))
2202 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
2204 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
2218 t_control%stda_control%hfx_fraction = 0.0_dp
2219 t_control%stda_control%do_exchange = .true.
2220 t_control%stda_control%eps_td_filter = 1.e-10_dp
2221 t_control%stda_control%mn_alpha = -99.0_dp
2222 t_control%stda_control%mn_beta = -99.0_dp
2224 SELECT CASE (qs_control%periodicity)
2226 t_control%stda_control%do_ewald = .false.
2228 t_control%stda_control%do_ewald = .true.
2230 t_control%stda_control%do_ewald = .true.
2232 t_control%stda_control%do_ewald = .true.
2234 cpabort(
"Illegal value for periodiciy")
2239 IF (expl) t_control%stda_control%hfx_fraction = hfx
2241 IF (expl) t_control%stda_control%eps_td_filter = filter
2243 IF (expl) t_control%stda_control%do_ewald = do_ewald
2245 IF (expl) t_control%stda_control%do_exchange = do_exchange
2247 t_control%stda_control%mn_alpha = fval
2249 t_control%stda_control%mn_beta = fval
2252 t_control%stda_control%coulomb_sr_cut = fval
2254 t_control%stda_control%coulomb_sr_eps = fval
2257 CALL timestop(handle)
2269 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
2271 CHARACTER(LEN=20) :: tmpstr
2272 INTEGER :: handle, i, i_rep, n_rep, output_unit
2273 REAL(kind=
dp) :: density_cut, density_smooth_cut_range, &
2274 gradient_cut, tau_cut
2281 IF (dft_control%qs_control%semi_empirical)
RETURN
2282 IF (dft_control%qs_control%dftb)
RETURN
2283 IF (dft_control%qs_control%xtb)
THEN
2284 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
2287 CALL timeset(routinen, handle)
2293 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2295 IF (output_unit > 0)
THEN
2299 IF (dft_control%uks)
THEN
2300 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
2301 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
2302 ELSE IF (dft_control%roks)
THEN
2303 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
2304 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
2306 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
2307 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
2310 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2311 "DFT| Multiplicity", dft_control%multiplicity
2312 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2313 "DFT| Number of spin states", dft_control%nspins
2315 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2316 "DFT| Charge", dft_control%charge
2319 SELECT CASE (dft_control%sic_method_id)
2323 tmpstr =
"SPZ/MAURI SIC"
2325 tmpstr =
"US/MAURI SIC"
2329 tmpstr =
"Explicit Orbital SIC"
2332 cpabort(
"SIC option unknown")
2335 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2336 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
2338 IF (dft_control%sic_method_id /=
sic_none)
THEN
2339 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
2340 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
2341 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
2344 IF (dft_control%sic_method_id ==
sic_eo)
THEN
2346 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
2347 "DFT| SIC orbitals",
"ALL"
2350 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
2351 "DFT| SIC orbitals",
"UNPAIRED"
2358 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
2360 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
2361 "DFT| Cutoffs: density ", density_cut, &
2362 "DFT| gradient", gradient_cut, &
2363 "DFT| tau ", tau_cut, &
2364 "DFT| cutoff_smoothing_range", density_smooth_cut_range
2367 WRITE (output_unit,
'( A, T61, A )') &
2368 " DFT| XC density smoothing ", adjustr(tmpstr)
2371 WRITE (output_unit,
'( A, T61, A )') &
2372 " DFT| XC derivatives ", adjustr(tmpstr)
2373 IF (dft_control%dft_plus_u)
THEN
2374 NULLIFY (enum, keyword, section)
2378 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
2379 "DFT+U| Method", adjustr(trim(
enum_i2c(enum, dft_control%plus_u_method_id)))
2380 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2381 "DFT+U| Check atomic kind information for details"
2385 WRITE (unit=output_unit, fmt=
"(A)")
""
2386 CALL xc_write(output_unit, xc_section, dft_control%lsd)
2388 IF (dft_control%apply_period_efield)
THEN
2389 WRITE (unit=output_unit, fmt=
"(A)")
""
2390 IF (dft_control%period_efield%displacement_field)
THEN
2391 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2392 "PERIODIC_EFIELD| Use displacement field formulation"
2393 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2394 "PERIODIC_EFIELD| Displacement field filter: x", &
2395 dft_control%period_efield%d_filter(1), &
2396 "PERIODIC_EFIELD| y", &
2397 dft_control%period_efield%d_filter(2), &
2398 "PERIODIC_EFIELD| z", &
2399 dft_control%period_efield%d_filter(3)
2401 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2402 "PERIODIC_EFIELD| Polarisation vector: x", &
2403 dft_control%period_efield%polarisation(1), &
2404 "PERIODIC_EFIELD| y", &
2405 dft_control%period_efield%polarisation(2), &
2406 "PERIODIC_EFIELD| z", &
2407 dft_control%period_efield%polarisation(3)
2409 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2410 "PERIODIC_EFIELD| Start Frame:", &
2411 dft_control%period_efield%start_frame, &
2412 "PERIODIC_EFIELD| End Frame:", &
2413 dft_control%period_efield%end_frame
2415 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
2416 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2417 "PERIODIC_EFIELD| Number of Intensities:", &
2418 SIZE(dft_control%period_efield%strength_list)
2419 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2420 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2421 1, dft_control%period_efield%strength_list(1)
2422 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
2423 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2424 "PERIODIC_EFIELD| ", &
2425 i, dft_control%period_efield%strength_list(i)
2428 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2429 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2430 dft_control%period_efield%strength
2433 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
2434 dft_control%period_efield%polarisation)) < epsilon(0.0_dp))
THEN
2435 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2439 IF (dft_control%do_sccs)
THEN
2440 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2441 "SCCS| Self-consistent continuum solvation model"
2442 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2443 "SCCS| Relative permittivity of the solvent (medium)", &
2444 dft_control%sccs_control%epsilon_solvent, &
2445 "SCCS| Absolute permittivity [a.u.]", &
2446 dft_control%sccs_control%epsilon_solvent/
fourpi
2447 SELECT CASE (dft_control%sccs_control%method_id)
2449 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2450 "SCCS| Dielectric function proposed by Andreussi et al.", &
2451 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2452 "SCCS| rho_min", dft_control%sccs_control%rho_min
2454 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2455 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2456 "SCCS| beta", dft_control%sccs_control%beta, &
2457 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2459 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2461 SELECT CASE (dft_control%sccs_control%derivative_method)
2463 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2464 "SCCS| Numerical derivative calculation", &
2467 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2468 "SCCS| Numerical derivative calculation", &
2469 adjustr(
"3-point stencil central differences")
2471 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2472 "SCCS| Numerical derivative calculation", &
2473 adjustr(
"5-point stencil central differences")
2475 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2476 "SCCS| Numerical derivative calculation", &
2477 adjustr(
"7-point stencil central differences")
2479 CALL cp_abort(__location__, &
2480 "Invalid derivative method specified for SCCS model. "// &
2481 "Please, check your input!")
2483 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2484 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2486 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2487 "SCCS| Dispersion parameter beta [GPa]", &
2489 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2490 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2492 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2493 "SCCS| Mixing parameter applied during the iteration cycle", &
2494 dft_control%sccs_control%mixing
2495 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2496 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2497 dft_control%sccs_control%eps_sccs
2498 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2499 "SCCS| Maximum number of iteration steps", &
2500 dft_control%sccs_control%max_iter
2501 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2502 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2503 dft_control%sccs_control%eps_scf
2504 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2505 "SCCS| Numerical increment for the cavity surface calculation", &
2506 dft_control%sccs_control%delta_rho
2509 WRITE (unit=output_unit, fmt=
"(A)")
""
2513 IF (dft_control%hairy_probes .EQV. .true.)
THEN
2514 n_rep =
SIZE(dft_control%probe)
2515 IF (output_unit > 0)
THEN
2517 WRITE (unit=output_unit, fmt=
"(T2,A,I5)") &
2518 "HP | hair probe set", i_rep
2519 WRITE (unit=output_unit, fmt=
"(T2,A,T61,*(I5))") &
2520 "HP| atom indexes", &
2521 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2522 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2523 "HP| potential", dft_control%probe(i_rep)%mu
2524 WRITE (unit=output_unit, fmt=
"(T2,A,T61,F20.2)") &
2525 "HP| temperature", dft_control%probe(i_rep)%T
2526 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2527 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2533 "PRINT%DFT_CONTROL_PARAMETERS")
2535 CALL timestop(handle)
2555 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2557 IF (iounit > 0)
THEN
2559 SELECT CASE (admm_control%admm_type)
2561 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2563 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2565 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2567 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2569 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2571 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2573 cpabort(
"admm_type")
2576 SELECT CASE (admm_control%purification_method)
2578 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2580 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2582 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2584 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2586 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2588 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2590 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2592 cpabort(
"admm_purification_method")
2595 SELECT CASE (admm_control%method)
2597 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2599 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2601 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2603 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2605 cpabort(
"admm method")
2608 SELECT CASE (admm_control%scaling_model)
2611 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2613 cpabort(
"admm scaling_model")
2616 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2618 SELECT CASE (admm_control%aux_exch_func)
2620 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2622 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2624 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2626 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2628 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2630 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2632 cpabort(
"admm aux_exch_func")
2635 WRITE (unit=iounit, fmt=
"(A)")
""
2640 "PRINT%DFT_CONTROL_PARAMETERS")
2648 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2652 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2654 CHARACTER(LEN=16) :: scc_mixer_name, solver_name
2655 INTEGER :: handle, output_unit
2658 CALL timeset(routinen, handle)
2663 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2665 IF (output_unit > 0)
THEN
2667 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2668 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2669 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2670 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2671 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2672 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2673 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2674 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2675 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2676 "xTB| Repulsive enhancement factor", xtb_control%enscale
2677 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2678 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2679 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2680 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2681 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2682 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2683 SELECT CASE (xtb_control%vdw_type)
2685 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2687 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2688 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2689 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2691 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2692 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2693 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2697 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2698 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2699 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2700 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2701 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2702 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2703 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2704 "xTB| Repulsion potential exponent", xtb_control%kf
2705 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2706 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2707 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2708 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2709 "xTB| Electronegativity scaling", xtb_control%ken
2710 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2711 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2712 SELECT CASE (xtb_control%tblite_scc_mixer)
2714 scc_mixer_name =
"AUTO"
2716 scc_mixer_name =
"TBLITE"
2718 scc_mixer_name =
"CP2K"
2720 scc_mixer_name =
"NONE"
2722 cpabort(
"Unknown tblite SCC mixer")
2724 SELECT CASE (xtb_control%tblite_mixer_solver)
2730 cpabort(
"Unknown tblite SCC mixer solver")
2732 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)") &
2733 "xTB| SCC mixer:", trim(scc_mixer_name)
2734 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2735 "xTB| tblite accuracy:", xtb_control%tblite_accuracy
2736 IF (len_trim(xtb_control%tblite_param_file) > 0)
THEN
2737 WRITE (unit=output_unit, fmt=
"(T2,A,T33,A)") &
2738 "xTB| tblite parameter file:", trim(xtb_control%tblite_param_file)
2740 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2741 "xTB| tblite SCC mixer damping:", xtb_control%tblite_mixer_damping
2742 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2743 "xTB| tblite SCC mixer iterations:", xtb_control%tblite_mixer_iterations
2744 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2745 "xTB| tblite SCC mixer memory:", xtb_control%tblite_mixer_memory
2746 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)") &
2747 "xTB| tblite SCC mixer solver:", trim(solver_name)
2748 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2749 "xTB| tblite SCC mixer omega0:", xtb_control%tblite_mixer_omega0
2750 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2751 "xTB| tblite SCC mixer min weight:", xtb_control%tblite_mixer_min_weight
2752 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2753 "xTB| tblite SCC mixer max weight:", xtb_control%tblite_mixer_max_weight
2754 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2755 "xTB| tblite SCC mixer weight factor:", xtb_control%tblite_mixer_weight_factor
2756 WRITE (unit=output_unit, fmt=
"(/)")
2761 "PRINT%DFT_CONTROL_PARAMETERS")
2763 CALL timestop(handle)
2765 END SUBROUTINE write_xtb_control
2776 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
2778 CHARACTER(len=20) :: method, quadrature
2779 INTEGER :: handle, i, igrid_level, ngrid_level, &
2788 IF (qs_control%semi_empirical)
RETURN
2789 IF (qs_control%dftb)
RETURN
2790 IF (qs_control%xtb)
RETURN
2791 CALL timeset(routinen, handle)
2792 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2798 NULLIFY (enum, keyword)
2801 method = trim(
enum_i2c(enum, qs_control%method_id))
2803 NULLIFY (enum, keyword)
2806 quadrature = trim(
enum_i2c(enum, qs_control%gapw_control%quadrature))
2809 "DFT_CONTROL_PARAMETERS", extension=
".Log")
2810 IF (output_unit > 0)
THEN
2811 ngrid_level =
SIZE(qs_control%e_cutoff)
2812 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
2813 "QS| Method:", adjustr(method)
2814 IF (qs_control%pw_grid_opt%spherical)
THEN
2815 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
2816 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
2817 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
2818 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2819 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
2821 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2822 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
2824 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2825 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
2826 IF (ngrid_level == 1)
THEN
2827 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2828 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2830 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2831 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2832 IF (qs_control%commensurate_mgrids) &
2833 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
2834 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2835 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2836 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
2837 (
"QS| ", igrid_level,
") grid level", &
2838 qs_control%e_cutoff(igrid_level), &
2839 igrid_level=2,
SIZE(qs_control%e_cutoff))
2841 IF (qs_control%pao)
THEN
2842 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
2844 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2845 "QS| Grid level progression factor:", qs_control%progression_factor
2846 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2847 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2848 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2849 "QS| Interaction thresholds: eps_pgf_orb:", &
2850 qs_control%eps_pgf_orb, &
2851 "QS| eps_filter_matrix:", &
2852 qs_control%eps_filter_matrix, &
2853 "QS| eps_core_charge:", &
2854 qs_control%eps_core_charge, &
2855 "QS| eps_rho_gspace:", &
2856 qs_control%eps_rho_gspace, &
2857 "QS| eps_rho_rspace:", &
2858 qs_control%eps_rho_rspace, &
2859 "QS| eps_gvg_rspace:", &
2860 qs_control%eps_gvg_rspace, &
2862 qs_control%eps_ppl, &
2865 IF (qs_control%gapw)
THEN
2866 IF (qs_control%gapw_control%accurate_xcint)
THEN
2867 WRITE (unit=output_unit, fmt=
"(T2,A,T69,F12.6)") &
2868 "QS| GAPW| XC integration using accurate scheme: Ref. exponent =", &
2869 qs_control%gapw_control%aweights
2872 SELECT CASE (qs_control%gapw_control%basis_1c)
2874 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2875 "QS| GAPW| One center basis from orbital basis primitives"
2877 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2878 "QS| GAPW| One center basis extended with primitives (small:s)"
2880 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2881 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2883 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2884 "QS| GAPW| One center basis extended with primitives (large:spd)"
2886 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2887 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2889 cpabort(
"basis_1c incorrect")
2891 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2892 "QS| GAPW| eps_fit:", &
2893 qs_control%gapw_control%eps_fit, &
2894 "QS| GAPW| eps_iso:", &
2895 qs_control%gapw_control%eps_iso, &
2896 "QS| GAPW| eps_svd:", &
2897 qs_control%gapw_control%eps_svd, &
2898 "QS| GAPW| eps_cpc:", &
2899 qs_control%gapw_control%eps_cpc
2900 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2901 "QS| GAPW| atom-r-grid: quadrature:", &
2903 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2904 "QS| GAPW| atom-s-grid: max l :", &
2905 qs_control%gapw_control%lmax_sphere, &
2906 "QS| GAPW| max_l_rho0 :", &
2907 qs_control%gapw_control%lmax_rho0
2908 IF (qs_control%gapw_control%non_paw_atoms)
THEN
2909 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2910 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2912 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
2913 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2914 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2917 IF (qs_control%gapw_xc)
THEN
2918 SELECT CASE (qs_control%gapw_control%basis_1c)
2920 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2921 "QS| GAPW_XC| One center basis from orbital basis primitives"
2923 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2924 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2926 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2927 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2929 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2930 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2932 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2933 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2935 cpabort(
"basis_1c incorrect")
2937 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2938 "QS| GAPW_XC| eps_fit:", &
2939 qs_control%gapw_control%eps_fit, &
2940 "QS| GAPW_XC| eps_iso:", &
2941 qs_control%gapw_control%eps_iso, &
2942 "QS| GAPW_XC| eps_svd:", &
2943 qs_control%gapw_control%eps_svd
2944 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
2945 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2946 enum_i2c(enum, qs_control%gapw_control%quadrature)
2947 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2948 "QS| GAPW_XC| atom-s-grid: max l :", &
2949 qs_control%gapw_control%lmax_sphere
2951 IF (qs_control%mulliken_restraint)
THEN
2952 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2953 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2954 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2955 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2956 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2957 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2958 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
2960 IF (qs_control%ddapc_restraint)
THEN
2961 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2962 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2963 IF (
SIZE(qs_control%ddapc_restraint_control) > 1) &
2964 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
2965 "QS| parameters for DDAPC restraint number", i
2966 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2967 "QS| ddapc restraint target", ddapc_restraint_control%target
2968 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2969 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2970 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2971 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2972 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
2973 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
2974 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
2975 SELECT CASE (ddapc_restraint_control%functional_form)
2977 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2978 "QS| ddapc restraint functional form :",
"RESTRAINT"
2980 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2981 "QS| ddapc restraint functional form :",
"CONSTRAINT"
2983 cpabort(
"Unknown ddapc restraint")
2987 IF (qs_control%s2_restraint)
THEN
2988 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2989 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2990 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2991 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2992 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2994 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2995 "QS| s2 restraint functional form :",
"RESTRAINT"
2996 cpabort(
"Not yet implemented")
2998 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2999 "QS| s2 restraint functional form :",
"CONSTRAINT"
3001 cpabort(
"Unknown ddapc restraint")
3006 "DFT_CONTROL_PARAMETERS")
3008 CALL timestop(handle)
3026 TYPE(
section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
3028 INTEGER :: i, j, jj, k, n_rep
3029 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3030 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
3034 IF (
PRESENT(ddapc_restraint_section))
THEN
3035 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
3036 IF (
SIZE(qs_control%ddapc_restraint_control) >= 2) &
3037 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
3039 ddapc_section => ddapc_restraint_section
3040 ALLOCATE (qs_control%ddapc_restraint_control(1))
3044 IF (
PRESENT(qs_section))
THEN
3045 NULLIFY (ddapc_section)
3050 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3053 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
3056 r_val=ddapc_restraint_control%strength)
3058 r_val=ddapc_restraint_control%target)
3060 i_val=ddapc_restraint_control%functional_form)
3064 i_val=ddapc_restraint_control%density_type)
3069 i_rep_val=k, i_vals=tmplist)
3070 DO j = 1,
SIZE(tmplist)
3074 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
3075 ddapc_restraint_control%natoms = jj
3076 IF (
ASSOCIATED(ddapc_restraint_control%atoms)) &
3077 DEALLOCATE (ddapc_restraint_control%atoms)
3078 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
3082 i_rep_val=k, i_vals=tmplist)
3083 DO j = 1,
SIZE(tmplist)
3085 ddapc_restraint_control%atoms(jj) = tmplist(j)
3089 IF (
ASSOCIATED(ddapc_restraint_control%coeff)) &
3090 DEALLOCATE (ddapc_restraint_control%coeff)
3091 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
3092 ddapc_restraint_control%coeff = 1.0_dp
3099 i_rep_val=k, r_vals=rtmplist)
3100 DO j = 1,
SIZE(rtmplist)
3102 IF (jj > ddapc_restraint_control%natoms) &
3103 cpabort(
"Need the same number of coeff as there are atoms ")
3104 ddapc_restraint_control%coeff(jj) = rtmplist(j)
3107 IF (jj < ddapc_restraint_control%natoms .AND. jj /= 0) &
3108 cpabort(
"Need no or the same number of coeff as there are atoms.")
3111 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3112 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
3115 IF (k == 2)
CALL cp_abort(__location__, &
3116 "Only a single constraint possible yet, try to use restraints instead ")
3126 SUBROUTINE read_efield_sections(dft_control, efield_section, cell)
3129 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
3131 CHARACTER(len=default_path_length) :: file_name
3132 INTEGER :: i, io, j, n, unit_nr
3133 LOGICAL :: amplitude_explicit, intensity_explicit
3134 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tmp_vals
3138 DO i = 1,
SIZE(dft_control%efield_fields)
3139 NULLIFY (dft_control%efield_fields(i)%efield)
3140 ALLOCATE (dft_control%efield_fields(i)%efield)
3141 efield => dft_control%efield_fields(i)%efield
3142 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
3144 r_val=efield%strength, explicit=intensity_explicit)
3146 r_val=efield%amplitude, explicit=amplitude_explicit)
3148 IF (intensity_explicit .AND. amplitude_explicit)
THEN
3149 cpabort(
"Both INTENSITY and AMPLITUDE provided in EFIELD section.")
3152 IF (intensity_explicit)
THEN
3153 efield%amplitude = sqrt(efield%strength/(3.50944_dp*10.0_dp**16))
3156 IF (amplitude_explicit)
THEN
3157 efield%strength = (3.50944_dp*10.0_dp**16)*(efield%amplitude)**2
3162 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
3163 efield%polarisation = tmp_vals
3164 IF (
PRESENT(cell))
THEN
3168 r_val=efield%phase_offset)
3170 i_val=efield%envelop_id)
3172 r_val=efield%wavelength)
3175 efield%vec_pot_initial = tmp_vals
3176 IF (
PRESENT(cell))
THEN
3181 ALLOCATE (efield%envelop_i_vars(2))
3184 i_val=efield%envelop_i_vars(1))
3186 i_val=efield%envelop_i_vars(2))
3188 ALLOCATE (efield%envelop_r_vars(2))
3191 r_val=efield%envelop_r_vars(1))
3193 r_val=efield%envelop_r_vars(2))
3194 ELSE IF (efield%envelop_id ==
ramp_env)
THEN
3195 ALLOCATE (efield%envelop_i_vars(4))
3198 i_val=efield%envelop_i_vars(1))
3200 i_val=efield%envelop_i_vars(2))
3202 i_val=efield%envelop_i_vars(3))
3204 i_val=efield%envelop_i_vars(4))
3205 ELSE IF (efield%envelop_id ==
custom_env)
THEN
3208 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
3212 READ (unit_nr, *, iostat=io)
3217 ALLOCATE (efield%envelop_r_vars(n + 1))
3222 READ (unit_nr, *) efield%envelop_r_vars(j)
3223 efield%envelop_r_vars(j) =
cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
3228 END SUBROUTINE read_efield_sections
3236 SUBROUTINE read_rtp_section(dft_control, rtp_section)
3241 INTEGER :: i, j, n_elems
3242 INTEGER,
DIMENSION(:),
POINTER :: tmp
3243 LOGICAL :: is_present, local_moment_possible
3246 ALLOCATE (dft_control%rtp_control)
3248 i_val=dft_control%rtp_control%max_iter)
3250 i_val=dft_control%rtp_control%mat_exp)
3252 i_val=dft_control%rtp_control%aspc_order)
3254 r_val=dft_control%rtp_control%eps_exp)
3256 i_val=dft_control%rtp_control%rtp_method)
3258 i_val=dft_control%rtp_control%rtbse_ham)
3260 i_val=dft_control%rtp_control%propagator)
3262 r_val=dft_control%rtp_control%eps_ener)
3264 i_val=dft_control%rtp_control%initial_wfn)
3266 l_val=dft_control%rtp_control%hfx_redistribute)
3268 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
3270 l_val=dft_control%rtp_control%apply_delta_pulse)
3272 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
3274 l_val=dft_control%rtp_control%velocity_gauge)
3276 l_val=dft_control%rtp_control%nl_gauge_transform)
3278 l_val=dft_control%rtp_control%periodic)
3280 l_val=dft_control%rtp_control%linear_scaling)
3282 i_val=dft_control%rtp_control%mcweeny_max_iter)
3284 i_val=dft_control%rtp_control%acc_ref)
3286 r_val=dft_control%rtp_control%mcweeny_eps)
3288 r_val=dft_control%rtp_control%delta_pulse_scale)
3291 dft_control%rtp_control%delta_pulse_direction = tmp
3293 i_val=dft_control%rtp_control%sc_check_start)
3296 IF (is_present)
THEN
3297 IF (dft_control%rtp_control%linear_scaling) &
3298 CALL cp_abort(__location__, &
3299 "You have defined a time dependent projection of mos, but "// &
3300 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
3301 ".TRUE.). Please either use MO-based real time DFT or do not "// &
3302 "define any PRINT%PROJECTION_MO section")
3303 dft_control%rtp_control%is_proj_mo = .true.
3305 dft_control%rtp_control%is_proj_mo = .false.
3308 local_moment_possible = (dft_control%rtp_control%rtp_method ==
rtp_method_bse) .OR. &
3309 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
3314 dft_control%rtp_control%save_local_moments = &
3315 is_present .OR. dft_control%rtp_control%save_local_moments
3316 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3317 CALL cp_abort(__location__,
"Moments trace printing only "// &
3318 "implemented in non-periodic systems in linear scaling. "// &
3319 "Please use DFT%PRINT%MOMENTS for other printing.")
3322 i_val=dft_control%rtp_control%moment_trace_ref_type)
3324 r_vals=dft_control%rtp_control%moment_trace_user_ref_point)
3329 dft_control%rtp_control%save_local_moments = &
3330 is_present .OR. dft_control%rtp_control%save_local_moments
3331 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3333 CALL cp_abort(__location__,
"Moments Fourier transform printing "// &
3334 "implemented only for non-periodic systems in linear scaling.")
3338 r_val=dft_control%rtp_control%ft_damping)
3340 r_val=dft_control%rtp_control%ft_t0)
3344 l_val=dft_control%rtp_control%pade_requested)
3346 r_val=dft_control%rtp_control%pade_e_min)
3348 r_val=dft_control%rtp_control%pade_e_step)
3350 r_val=dft_control%rtp_control%pade_e_max)
3352 r_val=dft_control%rtp_control%pade_fit_e_min)
3354 r_val=dft_control%rtp_control%pade_fit_e_max)
3356 IF (dft_control%rtp_control%pade_fit_e_min < 0)
THEN
3357 dft_control%rtp_control%pade_fit_e_min = dft_control%rtp_control%pade_e_min
3359 IF (dft_control%rtp_control%pade_fit_e_max < 0)
THEN
3360 dft_control%rtp_control%pade_fit_e_max = dft_control%rtp_control%pade_e_max
3366 dft_control%rtp_control%save_local_moments = &
3367 is_present .OR. dft_control%rtp_control%save_local_moments
3368 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3370 CALL cp_abort(__location__,
"Polarizability printing "// &
3371 "implemented only for non-periodic systems.")
3374 NULLIFY (dft_control%rtp_control%print_pol_elements)
3375 IF (is_present)
THEN
3378 ALLOCATE (dft_control%rtp_control%print_pol_elements(n_elems, 2))
3381 dft_control%rtp_control%print_pol_elements(i, :) = tmp(:)
3386 IF (dft_control%rtp_control%print_pol_elements(i, j) > 3 .OR. &
3387 dft_control%rtp_control%print_pol_elements(i, j) < 1) &
3388 cpabort(
"Polarisation tensor element not 1,2 or 3 in at least one index")
3395 dft_control%rtp_control%save_local_moments = &
3396 dft_control%rtp_control%save_local_moments .OR. &
3397 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
3399 END SUBROUTINE read_rtp_section
3407 SUBROUTINE guess_pol_elements(dftc, elems)
3409 INTEGER,
DIMENSION(:, :),
POINTER :: elems
3411 INTEGER :: i, i_nonzero, n_nonzero
3412 LOGICAL :: pol_vector_known
3413 REAL(kind=
dp),
DIMENSION(3) :: pol_vector
3415 pol_vector_known = .false.
3418 IF (dftc%rtp_control%apply_delta_pulse .OR. dftc%rtp_control%apply_delta_pulse_mag)
THEN
3419 pol_vector(:) = real(dftc%rtp_control%delta_pulse_direction(:), kind=
dp)
3422 pol_vector(:) = dftc%efield_fields(1)%efield%polarisation(:)
3424 IF (dot_product(pol_vector, pol_vector) > 0.0_dp) pol_vector_known = .true.
3426 IF (.NOT. pol_vector_known)
THEN
3427 cpabort(
"Cannot guess polarization elements - please specify!")
3432 IF (pol_vector(i) /= 0.0_dp)
THEN
3433 n_nonzero = n_nonzero + 1
3437 IF (n_nonzero > 1)
THEN
3438 CALL cp_abort(__location__, &
3439 "More than one non-zero field elements - "// &
3440 "cannot guess polarizability elements - please specify!")
3441 ELSE IF (n_nonzero == 0)
THEN
3442 CALL cp_abort(__location__, &
3443 "No non-zero field elements - "// &
3444 "cannot guess polarizability elements - please specify!")
3448 ALLOCATE (elems(3, 2))
3451 elems(i, 2) = i_nonzero
3455 END SUBROUTINE guess_pol_elements
3462 SUBROUTINE read_admm_block_list(admm_control, dft_section)
3466 INTEGER :: irep, list_size, n_rep
3467 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3474 ALLOCATE (admm_control%blocks(n_rep))
3478 i_rep_val=irep, i_vals=tmplist)
3479 list_size =
SIZE(tmplist)
3480 ALLOCATE (admm_control%blocks(irep)%list(list_size))
3481 admm_control%blocks(irep)%list(:) = tmplist(:)
3484 END SUBROUTINE read_admm_block_list
3493 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
3497 INTEGER :: i, j, jj, kk, n_rep
3498 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3500 DO i = 1,
SIZE(dft_control%probe)
3501 NULLIFY (dft_control%probe(i)%atom_ids)
3506 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
3507 jj = jj +
SIZE(tmplist)
3510 dft_control%probe(i)%natoms = jj
3511 IF (dft_control%probe(i)%natoms < 1) &
3512 cpabort(
"Need at least 1 atom to use hair probes formalism")
3513 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
3517 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
3518 DO j = 1,
SIZE(tmplist)
3520 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
3524 CALL section_vals_val_get(hairy_probes_section,
"MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
3526 CALL section_vals_val_get(hairy_probes_section,
"T", i_rep_section=i, r_val=dft_control%probe(i)%T)
3528 CALL section_vals_val_get(hairy_probes_section,
"ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
3530 CALL section_vals_val_get(hairy_probes_section,
"eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
3533 END SUBROUTINE read_hairy_probes_sections
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2005b
integer, save, public umari2002
integer, save, public katbashev2025
integer, save, public yin2017
integer, save, public stewart2007
integer, save, public stengel2009
integer, save, public vandevondele2005a
integer, save, public grimme2017
integer, save, public lippert1999
integer, save, public dewar1977
integer, save, public elstner1998
integer, save, public vanvoorhis2015
integer, save, public repasky2002
integer, save, public hu2007
integer, save, public andreussi2012
integer, save, public rocha2006
integer, save, public lippert1997
integer, save, public fattebert2002
integer, save, public thiel1992
integer, save, public pracht2019
integer, save, public porezag1995
integer, save, public souza2002
integer, save, public schenter2008
integer, save, public krack2000
integer, save, public dewar1985
integer, save, public stewart1989
integer, save, public seifert1996
integer, save, public zhechkov2005
Handles all functions related to the CELL.
subroutine, public cell_transform_input_cartesian(cell, vector)
Transform a Cartesian real-space vector from the user input cell frame into CP2K's canonical internal...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dft_control_create(dft_control)
allocates and perform a very basic initialization
subroutine, public expot_control_create(expot_control)
...
subroutine, public maxwell_control_create(maxwell_control)
...
subroutine, public ddapc_control_create(ddapc_restraint_control)
create the ddapc_restraint_type
subroutine, public admm_control_create(admm_control)
...
Utilities to set up the control types.
subroutine, public write_qs_control(qs_control, dft_section)
Purpose: Write the QS control parameters to the output unit.
subroutine, public read_rixs_control(rixs_control, rixs_section, qs_control)
Reads the input and stores in the rixs_control_type.
subroutine, public read_qs_section(qs_control, qs_section, cell)
...
subroutine, public read_tddfpt2_control(t_control, t_section, qs_control)
Read TDDFPT-related input parameters.
subroutine, public read_dft_control(dft_control, dft_section, cell)
...
subroutine, public write_admm_control(admm_control, dft_section)
Write the ADMM control parameters to the output unit.
subroutine, public write_dft_control(dft_control, dft_section)
Write the DFT control parameters to the output unit.
subroutine, public read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
reads the input parameters needed for ddapc.
subroutine, public read_mgrid_section(qs_control, dft_section)
...
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_read_line(parser, nline, at_end)
Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_reset(parser)
Resets the parser: rewinding the unit and re-initializing all parser structures.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Definition of mathematical constants and functions.
real(kind=dp), parameter, public fourpi
subroutine, public pair_potential_reallocate(p, lb1_new, ub1_new, lj, lj_charmm, williams, goodwin, eam, nequip, bmhft, bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
Cleans the potential parameter type.
Periodic Table related data definitions.
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
Utility subroutines for CDFT calculations.
subroutine, public read_cdft_control_section(qs_control, cdft_control_section)
reads the input parameters needed for CDFT with OT
Input control types for NEGF/SMEAGOL transport calculations.
subroutine, public read_smeagol_control(smeagol_control, smeagol_section)
Read SMEAGOL-related input parameters.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
All kind of helpful little routines.
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
subroutine, public read_xas_tdp_control(xas_tdp_control, xas_tdp_section)
Reads the inputs and stores in xas_tdp_control_type.
Writes information on XC functionals to output.
subroutine, public xc_write(iounit, xc_section, lsd)
...
Exchange and Correlation functional calculations.
logical function, public xc_uses_norm_drho(xc_fun_section, lsd)
...
logical function, public xc_uses_kinetic_energy_density(xc_fun_section, lsd)
...
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...