85#include "./base/base_uses.f90"
91 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_control_utils'
113 CHARACTER(len=default_path_length) :: basis_set_file_name, &
114 intensities_file_name, &
116 CHARACTER(LEN=default_string_length), &
117 DIMENSION(:),
POINTER :: tmpstringlist
118 INTEGER :: admmtype, irep, isize, method_id, nrep, &
120 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, &
121 do_rtp, exopt1, exopt2, exopt3, &
122 explicit, is_present, l_param, not_se, &
124 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
125 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
128 TYPE(
section_vals_type),
POINTER :: hairy_probes_section, hfx_section, maxwell_section, &
129 sccs_section, scf_section, tmp_section, xc_fun_section, xc_section
131 was_present = .false.
135 NULLIFY (tmp_section, xc_fun_section, xc_section)
136 ALLOCATE (dft_control)
142 SELECT CASE (method_id)
150 IF (.NOT. is_present .AND. not_se)
THEN
151 cpabort(
"XC section missing.")
158 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
159 CALL cp_warn(__location__, &
160 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
161 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
162 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
163 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
164 CALL cp_warn(__location__, &
165 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
166 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
167 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
168 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
169 CALL cp_warn(__location__, &
170 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
171 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
172 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
179 IF (.NOT. is_present .AND. not_se)
THEN
180 cpabort(
"XC_FUNCTIONAL section missing.")
185 IF (dft_control%uks .OR. dft_control%roks)
THEN
186 dft_control%nspins = 2
188 dft_control%nspins = 1
191 dft_control%lsd = (dft_control%nspins > 1)
195 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
197 IF (dft_control%drho_by_collocation)
THEN
198 cpabort(
"derivatives by collocation not implemented")
205 IF (
SIZE(tmpstringlist) == 2)
THEN
207 SELECT CASE (tmpstringlist(2))
219 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
222 SELECT CASE (tmpstringlist(1))
225 dft_control%auto_basis_ri_aux = isize
227 dft_control%auto_basis_aux_fit = isize
229 dft_control%auto_basis_lri_aux = isize
231 dft_control%auto_basis_p_lri_aux = isize
233 dft_control%auto_basis_ri_hxc = isize
235 dft_control%auto_basis_ri_xas = isize
237 dft_control%auto_basis_ri_hfx = isize
239 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
242 CALL cp_abort(__location__, &
243 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
254 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
256 dft_control%do_admm = is_present
257 dft_control%do_admm_mo = .false.
258 dft_control%do_admm_dm = .false.
264 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
265 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
266 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
267 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
268 dft_control%admm_control%admm_type = admmtype
269 SELECT CASE (admmtype)
271 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
272 dft_control%admm_control%purification_method = method_id
273 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
274 dft_control%admm_control%method = method_id
275 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
276 dft_control%admm_control%scaling_model = method_id
281 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
282 dft_control%admm_control%purification_method = method_id
314 CALL cp_abort(__location__, &
315 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
319 r_val=dft_control%admm_control%eps_filter)
321 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
322 dft_control%admm_control%aux_exch_func = method_id
325 dft_control%admm_control%aux_exch_func_param = .false.
326 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
327 r_val=dft_control%admm_control%aux_x_param(1))
328 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
329 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
330 r_val=dft_control%admm_control%aux_x_param(2))
331 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
332 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
333 r_val=dft_control%admm_control%aux_x_param(3))
334 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
336 CALL read_admm_block_list(dft_control%admm_control, dft_section)
339 SELECT CASE (admmtype)
341 IF (exopt2)
CALL cp_warn(__location__, &
342 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
343 IF (exopt3)
CALL cp_warn(__location__, &
344 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
346 IF (exopt1)
CALL cp_warn(__location__, &
347 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
348 IF (exopt2)
CALL cp_warn(__location__, &
349 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
350 IF (exopt3)
CALL cp_warn(__location__, &
351 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
360 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
365 CALL cp_abort(__location__, &
366 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
367 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
373 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
375 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
380 dft_control%do_admm_dm = .true.
382 dft_control%do_admm_mo = .true.
390 dft_control%restricted = (dft_control%roks .AND. l_param)
394 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
395 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
396 IF (.NOT. dft_control%uks) &
397 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
398 "unrestricted Kohn-Sham (UKS) calculations")
403 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
406 dft_control%hairy_probes = .true.
407 ALLOCATE (dft_control%probe(nrep))
408 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
415 dft_control%sic_method_id =
sic_none
416 dft_control%sic_scaling_a = 1.0_dp
417 dft_control%sic_scaling_b = 1.0_dp
420 dft_control%dft_plus_u = .false.
422 dft_control%plus_u_method_id = method_id
425 dft_control%smear = .false.
428 dft_control%correct_surf_dip = .false.
429 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
431 dft_control%pos_dir_surf_dip = -1.0_dp
435 dft_control%switch_surf_dip = .false.
436 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
438 dft_control%correct_el_density_dip = .false.
439 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
440 IF (dft_control%correct_el_density_dip)
THEN
441 IF (dft_control%correct_surf_dip)
THEN
444 dft_control%correct_el_density_dip = .false.
445 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
450 c_val=basis_set_file_name)
452 c_val=potential_file_name)
457 i_val=dft_control%sic_method_id)
459 i_val=dft_control%sic_list_id)
461 r_val=dft_control%sic_scaling_a)
463 r_val=dft_control%sic_scaling_b)
469 CALL read_rtp_section(dft_control, tmp_section)
476 IF (dft_control%do_xas_calculation)
THEN
479 l_val=dft_control%do_xas_calculation)
483 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
484 IF (dft_control%do_xas_tdp_calculation)
THEN
487 l_val=dft_control%do_xas_tdp_calculation)
491 dft_control%apply_efield = .false.
492 dft_control%apply_efield_field = .false.
493 dft_control%apply_vector_potential = .false.
497 ALLOCATE (dft_control%efield_fields(nrep))
498 CALL read_efield_sections(dft_control, tmp_section)
500 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
501 dft_control%apply_efield_field = .true.
503 dft_control%apply_vector_potential = .true.
505 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
508 dft_control%apply_efield = .true.
515 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
516 IF (dft_control%apply_period_efield)
THEN
517 ALLOCATE (dft_control%period_efield)
519 dft_control%period_efield%polarisation(1:3) = pol(1:3)
521 dft_control%period_efield%d_filter(1:3) = pol(1:3)
523 r_val=dft_control%period_efield%strength)
524 dft_control%period_efield%displacement_field = .false.
526 l_val=dft_control%period_efield%displacement_field)
532 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
534 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
535 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
536 "or INTENSITIES_FILE_NAME can be specified.")
539 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
540 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
543 IF (intensities_file_name /=
"")
THEN
545 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
546 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
547 "or INTENSITIES_FILE_NAME can be specified.")
560 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
563 ALLOCATE (dft_control%period_efield%strength_list(nrep))
568 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
575 i_val=dft_control%period_efield%start_frame)
577 i_val=dft_control%period_efield%end_frame)
579 IF (dft_control%period_efield%end_frame /= -1)
THEN
583 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
584 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
585 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
586 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
587 ELSE IF (mod(dft_control%period_efield%end_frame - &
588 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
589 CALL cp_abort(__location__, &
590 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
595 cpassert(.NOT. do_rtp)
596 IF (dft_control%period_efield%displacement_field)
THEN
606 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
607 IF (dft_control%apply_external_potential)
THEN
610 l_val=dft_control%expot_control%read_from_cube)
612 l_val=dft_control%expot_control%static)
614 r_val=dft_control%expot_control%scaling_factor)
619 dft_control%expot_control%maxwell_solver = .true.
623 r_val=dft_control%maxwell_control%real_test)
625 i_val=dft_control%maxwell_control%int_test)
627 l_val=dft_control%maxwell_control%log_test)
629 dft_control%expot_control%maxwell_solver = .false.
639 l_val=dft_control%do_sccs)
640 IF (dft_control%do_sccs)
THEN
641 ALLOCATE (dft_control%sccs_control)
643 r_val=dft_control%sccs_control%epsilon_solvent)
645 r_val=dft_control%sccs_control%alpha_solvent)
647 r_val=dft_control%sccs_control%beta_solvent)
649 r_val=dft_control%sccs_control%delta_rho)
651 i_val=dft_control%sccs_control%derivative_method)
653 i_val=dft_control%sccs_control%method_id)
655 r_val=dft_control%sccs_control%eps_sccs)
657 r_val=dft_control%sccs_control%eps_scf)
659 r_val=dft_control%sccs_control%gamma_solvent)
661 i_val=dft_control%sccs_control%max_iter)
663 r_val=dft_control%sccs_control%mixing)
664 SELECT CASE (dft_control%sccs_control%method_id)
668 r_val=dft_control%sccs_control%rho_max)
670 r_val=dft_control%sccs_control%rho_min)
671 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
672 CALL cp_abort(__location__, &
673 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
674 "Please, check your input!")
680 r_val=dft_control%sccs_control%beta)
681 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
682 CALL cp_abort(__location__, &
683 "A value smaller than 0.5 for the SCCS parameter beta "// &
684 "causes numerical problems. Please, check your input!")
687 r_val=dft_control%sccs_control%rho_zero)
690 cpabort(
"Invalid SCCS model specified. Please, check your input!")
699 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
742 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
744 INTEGER :: handle, igrid_level, ngrid_level
745 LOGICAL :: explicit, multigrid_set
747 REAL(
dp),
DIMENSION(:),
POINTER :: cutofflist
750 CALL timeset(routinen, handle)
752 NULLIFY (mgrid_section, cutofflist)
758 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
763 l_val=qs_control%skip_load_balance_distributed)
766 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
768 multigrid_set = .false.
771 IF (.NOT. explicit) cutoff = 1.0_dp
774 ALLOCATE (qs_control%e_cutoff(ngrid_level))
775 qs_control%cutoff = cutoff
777 IF (multigrid_set)
THEN
779 IF (qs_control%commensurate_mgrids)
THEN
780 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
784 IF (
ASSOCIATED(cutofflist))
THEN
785 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
786 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
788 DO igrid_level = 1, ngrid_level
789 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
793 DO igrid_level = ngrid_level, 1, -1
794 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
795 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
799 IF (igrid_level == 1)
THEN
800 qs_control%cutoff = qs_control%e_cutoff(1)
804 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
805 qs_control%e_cutoff(1) = qs_control%cutoff
806 DO igrid_level = 2, ngrid_level
807 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
808 qs_control%progression_factor
812 DO igrid_level = 2, ngrid_level
813 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
814 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
815 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
816 cpabort(
"The same cutoff value was specified for two multi-grids")
819 CALL timestop(handle)
832 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
834 CHARACTER(LEN=default_string_length) :: cval
835 CHARACTER(LEN=default_string_length), &
836 DIMENSION(:),
POINTER :: clist
837 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
839 INTEGER,
DIMENSION(:),
POINTER :: tmplist
840 LOGICAL :: explicit, was_present
841 REAL(
dp) :: tmp, tmpsqrt, value
842 REAL(
dp),
POINTER :: scal(:)
843 TYPE(
section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
844 dftb_parameter, dftb_section, eeq_section, genpot_section, lri_optbas_section, &
845 mull_section, nonbonded_section, s2_restraint_section, se_section, xtb_parameter, &
846 xtb_section, xtb_tblite
848 CALL timeset(routinen, handle)
850 was_present = .false.
851 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
852 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
853 cdft_control_section, genpot_section, eeq_section)
873 tmpsqrt = sqrt(
value)
876 qs_control%eps_core_charge =
value/100.0_dp
879 qs_control%eps_pgf_orb = tmpsqrt
880 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
882 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
884 qs_control%eps_ppl = 1.0e-2_dp
886 qs_control%gapw_control%eps_cpc =
value
888 qs_control%eps_rho_gspace =
value
889 qs_control%eps_rho_rspace =
value
891 qs_control%eps_gvg_rspace = tmpsqrt
908 qs_control%eps_kg_orb = sqrt(tmp)
921 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
945 qs_control%gapw_control%alpha0_hard_from_input = .false.
946 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
948 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
958 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
959 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
970 IF (qs_control%gapw_control%basis_1c /=
gapw_1c_orb)
THEN
971 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
978 qs_control%pw_grid_opt%spherical = .true.
979 qs_control%pw_grid_opt%fullspace = .false.
981 qs_control%pw_grid_opt%spherical = .false.
982 qs_control%pw_grid_opt%fullspace = .true.
984 qs_control%pw_grid_opt%spherical = .false.
985 qs_control%pw_grid_opt%fullspace = .false.
990 qs_control%do_ppl_method = itmp
993 qs_control%pw_grid_opt%distribution_layout = tmplist
997 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
998 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
1002 qs_control%gapw = .false.
1003 qs_control%gapw_xc = .false.
1004 qs_control%gpw = .false.
1005 qs_control%pao = .false.
1006 qs_control%dftb = .false.
1007 qs_control%xtb = .false.
1008 qs_control%semi_empirical = .false.
1009 qs_control%ofgpw = .false.
1010 qs_control%lrigpw = .false.
1011 qs_control%rigpw = .false.
1012 SELECT CASE (qs_control%method_id)
1016 qs_control%gapw = .true.
1018 qs_control%gapw_xc = .true.
1022 qs_control%gpw = .true.
1024 qs_control%ofgpw = .true.
1026 qs_control%lrigpw = .true.
1028 qs_control%rigpw = .true.
1030 qs_control%dftb = .true.
1034 qs_control%xtb = .true.
1039 qs_control%semi_empirical = .true.
1042 qs_control%semi_empirical = .true.
1045 qs_control%semi_empirical = .true.
1048 qs_control%semi_empirical = .true.
1051 qs_control%semi_empirical = .true.
1054 qs_control%semi_empirical = .true.
1057 qs_control%semi_empirical = .true.
1060 qs_control%semi_empirical = .true.
1064 qs_control%semi_empirical = .true.
1067 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1069 IF (qs_control%mulliken_restraint)
THEN
1070 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1071 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1076 jj = jj +
SIZE(tmplist)
1078 qs_control%mulliken_restraint_control%natoms = jj
1079 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1080 cpabort(
"Need at least 1 atom to use mulliken constraints")
1081 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1085 DO j = 1,
SIZE(tmplist)
1087 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1091 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1092 IF (qs_control%ddapc_restraint)
THEN
1093 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1095 qs_control%ddapc_restraint_is_spin = .false.
1096 qs_control%ddapc_explicit_potential = .false.
1099 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1100 IF (qs_control%s2_restraint)
THEN
1102 r_val=qs_control%s2_restraint_control%strength)
1104 r_val=qs_control%s2_restraint_control%target)
1106 i_val=qs_control%s2_restraint_control%functional_form)
1110 IF (qs_control%cdft)
THEN
1115 IF (qs_control%semi_empirical)
THEN
1117 l_val=qs_control%se_control%orthogonal_basis)
1119 r_val=qs_control%se_control%delta)
1121 l_val=qs_control%se_control%analytical_gradients)
1123 l_val=qs_control%se_control%force_kdsod_EX)
1126 i_val=qs_control%se_control%integral_screening)
1129 CALL cp_warn(__location__, &
1130 "PNNL semi-empirical parameterization supports only the Slater type "// &
1131 "integral scheme. Revert to Slater and continue the calculation.")
1136 i_val=qs_control%se_control%ga_ncells)
1139 r_val=qs_control%se_control%cutoff_lrc)
1140 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1145 r_val=qs_control%se_control%taper_lrc)
1148 r_val=qs_control%se_control%range_lrc)
1151 r_val=qs_control%se_control%cutoff_cou)
1152 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1157 r_val=qs_control%se_control%taper_cou)
1160 r_val=qs_control%se_control%range_cou)
1163 r_val=qs_control%se_control%cutoff_exc)
1164 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1169 r_val=qs_control%se_control%taper_exc)
1172 r_val=qs_control%se_control%range_exc)
1176 r_val=qs_control%se_control%taper_scr)
1178 r_val=qs_control%se_control%range_scr)
1182 i_val=qs_control%se_control%periodic_type)
1183 SELECT CASE (qs_control%se_control%periodic_type)
1185 qs_control%se_control%do_ewald = .false.
1186 qs_control%se_control%do_ewald_r3 = .false.
1187 qs_control%se_control%do_ewald_gks = .false.
1189 qs_control%se_control%do_ewald = .true.
1190 qs_control%se_control%do_ewald_r3 = .false.
1191 qs_control%se_control%do_ewald_gks = .false.
1193 qs_control%se_control%do_ewald = .false.
1194 qs_control%se_control%do_ewald_r3 = .false.
1195 qs_control%se_control%do_ewald_gks = .true.
1197 CALL cp_abort(__location__, &
1198 "A periodic semi-empirical calculation was requested with a long-range "// &
1199 "summation on the single integral evaluation. This scheme is supported "// &
1200 "only by the PNNL parameterization.")
1202 qs_control%se_control%do_ewald = .true.
1203 qs_control%se_control%do_ewald_r3 = .true.
1204 qs_control%se_control%do_ewald_gks = .false.
1205 IF (qs_control%se_control%integral_screening /=
do_se_is_kdso) &
1206 CALL cp_abort(__location__, &
1207 "A periodic semi-empirical calculation was requested with a long-range "// &
1208 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1209 "with the integral screening chosen. The only integral screening supported "// &
1210 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1215 l_val=qs_control%se_control%dispersion)
1217 r_val=qs_control%se_control%rcdisp)
1219 r_val=qs_control%se_control%epscn)
1221 qs_control%se_control%sd3(1) = scal(1)
1222 qs_control%se_control%sd3(2) = scal(2)
1223 qs_control%se_control%sd3(3) = scal(3)
1225 c_val=qs_control%se_control%dispersion_parameter_file)
1229 cpabort(
"EWALD_R3 not implemented yet!")
1241 qs_control%se_control%orthogonal_basis = .true.
1246 IF (qs_control%dftb)
THEN
1248 l_val=qs_control%dftb_control%orthogonal_basis)
1250 l_val=qs_control%dftb_control%self_consistent)
1252 l_val=qs_control%dftb_control%dispersion)
1254 l_val=qs_control%dftb_control%dftb3_diagonal)
1256 l_val=qs_control%dftb_control%hb_sr_damp)
1258 r_val=qs_control%dftb_control%eps_disp)
1262 l_val=qs_control%dftb_control%do_ewald)
1264 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1267 c_val=qs_control%dftb_control%sk_file_path)
1269 c_val=qs_control%dftb_control%sk_file_list)
1271 r_val=qs_control%dftb_control%hb_sr_para)
1273 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1277 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1281 i_val=qs_control%dftb_control%dispersion_type)
1283 c_val=qs_control%dftb_control%uff_force_field)
1286 r_val=qs_control%dftb_control%rcdisp)
1288 r_val=qs_control%dftb_control%epscn)
1290 r_val=qs_control%dftb_control%exp_pre)
1292 r_val=qs_control%dftb_control%scaling)
1294 qs_control%dftb_control%sd3(1) = scal(1)
1295 qs_control%dftb_control%sd3(2) = scal(2)
1296 qs_control%dftb_control%sd3(3) = scal(3)
1298 qs_control%dftb_control%sd3bj(1) = scal(1)
1299 qs_control%dftb_control%sd3bj(2) = scal(2)
1300 qs_control%dftb_control%sd3bj(3) = scal(3)
1301 qs_control%dftb_control%sd3bj(4) = scal(4)
1303 c_val=qs_control%dftb_control%dispersion_parameter_file)
1305 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(
zhechkov2005)
1306 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(
elstner1998)
1307 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(
hu2007)
1311 IF (qs_control%xtb)
THEN
1316 l_val=qs_control%xtb_control%do_ewald)
1318 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1336 SELECT CASE (qs_control%xtb_control%gfn_type)
1343 cpabort(
"gfn2-xtb tbd")
1350 qs_control%xtb_control%sto_ng = ngauss
1352 qs_control%xtb_control%h_sto_ng = ngauss
1354 c_val=qs_control%xtb_control%parameter_file_path)
1358 c_val=qs_control%xtb_control%parameter_file_name)
1360 SELECT CASE (qs_control%xtb_control%gfn_type)
1362 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1364 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1366 cpabort(
"gfn2-xtb tbd")
1373 r_val=qs_control%xtb_control%rcdisp)
1375 r_val=qs_control%xtb_control%epscn)
1379 qs_control%xtb_control%s6 = scal(1)
1380 qs_control%xtb_control%s8 = scal(2)
1382 SELECT CASE (qs_control%xtb_control%gfn_type)
1384 qs_control%xtb_control%s6 = 1.00_dp
1385 qs_control%xtb_control%s8 = 2.85_dp
1387 qs_control%xtb_control%s6 = 1.00_dp
1388 qs_control%xtb_control%s8 = 2.40_dp
1390 cpabort(
"gfn2-xtb tbd")
1398 qs_control%xtb_control%a1 = scal(1)
1399 qs_control%xtb_control%a2 = scal(2)
1401 SELECT CASE (qs_control%xtb_control%gfn_type)
1403 qs_control%xtb_control%a1 = 0.80_dp
1404 qs_control%xtb_control%a2 = 4.60_dp
1406 qs_control%xtb_control%a1 = 0.63_dp
1407 qs_control%xtb_control%a2 = 5.00_dp
1409 cpabort(
"gfn2-xtb tbd")
1415 c_val=qs_control%xtb_control%dispersion_parameter_file)
1420 qs_control%xtb_control%ks = scal(1)
1421 qs_control%xtb_control%kp = scal(2)
1422 qs_control%xtb_control%kd = scal(3)
1423 qs_control%xtb_control%ksp = scal(4)
1424 qs_control%xtb_control%k2sh = scal(5)
1425 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1427 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1430 SELECT CASE (qs_control%xtb_control%gfn_type)
1432 qs_control%xtb_control%ks = 2.00_dp
1433 qs_control%xtb_control%kp = 2.4868_dp
1434 qs_control%xtb_control%kd = 2.27_dp
1435 qs_control%xtb_control%ksp = 2.2434_dp
1436 qs_control%xtb_control%k2sh = 1.1241_dp
1438 qs_control%xtb_control%ks = 1.85_dp
1439 qs_control%xtb_control%kp = 2.25_dp
1440 qs_control%xtb_control%kd = 2.00_dp
1441 qs_control%xtb_control%ksp = 2.08_dp
1442 qs_control%xtb_control%k2sh = 2.85_dp
1444 cpabort(
"gfn2-xtb tbd")
1452 qs_control%xtb_control%kg = scal(1)
1453 qs_control%xtb_control%kf = scal(2)
1455 SELECT CASE (qs_control%xtb_control%gfn_type)
1457 qs_control%xtb_control%kg = 2.00_dp
1458 qs_control%xtb_control%kf = 1.50_dp
1460 qs_control%xtb_control%kg = 2.00_dp
1461 qs_control%xtb_control%kf = 1.50_dp
1463 cpabort(
"gfn2-xtb tbd")
1469 qs_control%xtb_control%kcns = scal(1)
1470 qs_control%xtb_control%kcnp = scal(2)
1471 qs_control%xtb_control%kcnd = scal(3)
1476 SELECT CASE (qs_control%xtb_control%gfn_type)
1478 qs_control%xtb_control%ksen = scal(1)
1479 qs_control%xtb_control%kpen = scal(2)
1480 qs_control%xtb_control%kden = scal(3)
1482 qs_control%xtb_control%ken = scal(1)
1484 cpabort(
"gfn2-xtb tbd")
1489 SELECT CASE (qs_control%xtb_control%gfn_type)
1491 qs_control%xtb_control%ksen = 0.006_dp
1492 qs_control%xtb_control%kpen = -0.001_dp
1493 qs_control%xtb_control%kden = -0.002_dp
1495 qs_control%xtb_control%ken = -0.007_dp
1497 cpabort(
"gfn2-xtb tbd")
1504 qs_control%xtb_control%ben = scal(1)
1509 r_val=qs_control%xtb_control%enscale)
1511 SELECT CASE (qs_control%xtb_control%gfn_type)
1513 qs_control%xtb_control%enscale = -0.09_dp
1515 qs_control%xtb_control%enscale = 0._dp
1517 cpabort(
"gfn2-xtb tbd")
1524 l_val=qs_control%xtb_control%xb_interaction)
1526 qs_control%xtb_control%kxr = scal(1)
1527 qs_control%xtb_control%kx2 = scal(2)
1530 l_val=qs_control%xtb_control%do_nonbonded)
1532 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1536 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1540 r_val=qs_control%xtb_control%eps_pair)
1543 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1545 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1551 SELECT CASE (qs_control%xtb_control%gfn_type)
1553 qs_control%xtb_control%coulomb_interaction = .false.
1554 qs_control%xtb_control%coulomb_lr = .false.
1555 qs_control%xtb_control%tb3_interaction = .false.
1556 qs_control%xtb_control%check_atomic_charges = .false.
1558 l_val=qs_control%xtb_control%var_dipole)
1562 l_val=qs_control%xtb_control%coulomb_interaction)
1564 l_val=qs_control%xtb_control%coulomb_lr)
1566 l_val=qs_control%xtb_control%tb3_interaction)
1569 l_val=qs_control%xtb_control%check_atomic_charges)
1570 qs_control%xtb_control%var_dipole = .false.
1572 cpabort(
"gfn2-xtb tbd")
1576 qs_control%xtb_control%kab_nval = n_rep
1578 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1579 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1580 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1583 qs_control%xtb_control%kab_param(1, j) = clist(1)
1585 ielement=qs_control%xtb_control%kab_types(1, j))
1586 qs_control%xtb_control%kab_param(2, j) = clist(2)
1588 ielement=qs_control%xtb_control%kab_types(2, j))
1589 qs_control%xtb_control%kab_param(3, j) = clist(3)
1590 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1594 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1596 qs_control%xtb_control%ksrb = scal(1)
1597 qs_control%xtb_control%esrb = scal(2)
1598 qs_control%xtb_control%gscal = scal(3)
1599 qs_control%xtb_control%c1srb = scal(4)
1600 qs_control%xtb_control%c2srb = scal(5)
1601 qs_control%xtb_control%shift = scal(6)
1606 SELECT CASE (trim(cval))
1608 qs_control%xtb_control%enshift_type = 0
1610 qs_control%xtb_control%enshift_type = 1
1612 qs_control%xtb_control%enshift_type = 2
1614 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1618 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1627 l_val=qs_control%xtb_control%do_tblite)
1629 i_val=qs_control%xtb_control%tblite_method)
1630 IF (qs_control%xtb_control%do_tblite)
THEN
1637 qs_control%xtb_control%do_ewald = .false.
1640 CALL timestop(handle)
1654 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
1656 CHARACTER(LEN=default_string_length), &
1657 DIMENSION(:),
POINTER :: tmpstringlist
1658 INTEGER :: handle, irep, isize, nrep
1659 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1660 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1662 REAL(kind=
dp) :: filter, fval, hfx
1664 soc_section, stda_section, xc_func, &
1667 CALL timeset(routinen, handle)
1683 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
1691 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1692 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1693 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
1694 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
1700 IF (
SIZE(tmpstringlist) == 2)
THEN
1702 SELECT CASE (tmpstringlist(2))
1714 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1717 SELECT CASE (tmpstringlist(1))
1720 t_control%auto_basis_p_lri_aux = isize
1722 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1725 CALL cp_abort(__location__, &
1726 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1730 IF (t_control%conv < 0) &
1731 t_control%conv = abs(t_control%conv)
1739 t_control%dipole_form = 0
1744 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1746 NULLIFY (t_control%dipole_ref_point)
1748 cpabort(
"User-defined reference point should be given explicitly")
1756 t_control%do_soc = .true.
1763 IF (t_control%mgrid_is_explicit)
THEN
1764 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1765 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
1767 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1768 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1771 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1773 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1774 CALL cp_abort(__location__, &
1775 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1777 t_control%mgrid_progression_factor = qs_control%progression_factor
1780 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1781 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1782 IF (t_control%mgrid_commensurate_mgrids)
THEN
1784 t_control%mgrid_progression_factor = 4.0_dp
1786 t_control%mgrid_progression_factor = qs_control%progression_factor
1790 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1791 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1793 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1794 IF (.NOT. explicit) multigrid_set = .false.
1795 IF (multigrid_set)
THEN
1798 NULLIFY (t_control%mgrid_e_cutoff)
1801 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1802 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1805 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1806 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1808 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
1809 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1810 cpabort(
"Inconsistent values for number of multi-grids")
1813 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1814 ALLOCATE (inds(t_control%mgrid_ngrids))
1815 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1817 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1831 t_control%stda_control%hfx_fraction = 0.0_dp
1832 t_control%stda_control%do_exchange = .true.
1833 t_control%stda_control%eps_td_filter = 1.e-10_dp
1834 t_control%stda_control%mn_alpha = -99.0_dp
1835 t_control%stda_control%mn_beta = -99.0_dp
1837 SELECT CASE (qs_control%periodicity)
1839 t_control%stda_control%do_ewald = .false.
1841 t_control%stda_control%do_ewald = .true.
1843 t_control%stda_control%do_ewald = .true.
1845 t_control%stda_control%do_ewald = .true.
1847 cpabort(
"Illegal value for periodiciy")
1852 IF (expl) t_control%stda_control%hfx_fraction = hfx
1854 IF (expl) t_control%stda_control%eps_td_filter = filter
1856 IF (expl) t_control%stda_control%do_ewald = do_ewald
1858 IF (expl) t_control%stda_control%do_exchange = do_exchange
1860 t_control%stda_control%mn_alpha = fval
1862 t_control%stda_control%mn_beta = fval
1865 t_control%stda_control%coulomb_sr_cut = fval
1867 t_control%stda_control%coulomb_sr_eps = fval
1870 CALL timestop(handle)
1882 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
1884 CHARACTER(LEN=20) :: tmpstr
1885 INTEGER :: handle, i, i_rep, n_rep, output_unit
1886 REAL(kind=
dp) :: density_cut, density_smooth_cut_range, &
1887 gradient_cut, tau_cut
1894 IF (dft_control%qs_control%semi_empirical)
RETURN
1895 IF (dft_control%qs_control%dftb)
RETURN
1896 IF (dft_control%qs_control%xtb)
THEN
1897 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1900 CALL timeset(routinen, handle)
1906 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1908 IF (output_unit > 0)
THEN
1912 IF (dft_control%uks)
THEN
1913 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1914 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
1915 ELSE IF (dft_control%roks)
THEN
1916 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
1917 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
1919 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1920 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
1923 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1924 "DFT| Multiplicity", dft_control%multiplicity
1925 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1926 "DFT| Number of spin states", dft_control%nspins
1928 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1929 "DFT| Charge", dft_control%charge
1932 SELECT CASE (dft_control%sic_method_id)
1936 tmpstr =
"SPZ/MAURI SIC"
1938 tmpstr =
"US/MAURI SIC"
1942 tmpstr =
"Explicit Orbital SIC"
1945 cpabort(
"SIC option unknown")
1948 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
1949 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1951 IF (dft_control%sic_method_id /=
sic_none)
THEN
1952 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1953 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1954 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1957 IF (dft_control%sic_method_id ==
sic_eo)
THEN
1959 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1960 "DFT| SIC orbitals",
"ALL"
1963 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1964 "DFT| SIC orbitals",
"UNPAIRED"
1971 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1973 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1974 "DFT| Cutoffs: density ", density_cut, &
1975 "DFT| gradient", gradient_cut, &
1976 "DFT| tau ", tau_cut, &
1977 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1980 WRITE (output_unit,
'( A, T61, A )') &
1981 " DFT| XC density smoothing ", adjustr(tmpstr)
1984 WRITE (output_unit,
'( A, T61, A )') &
1985 " DFT| XC derivatives ", adjustr(tmpstr)
1986 IF (dft_control%dft_plus_u)
THEN
1987 NULLIFY (enum, keyword, section)
1991 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
1992 "DFT+U| Method", adjustr(trim(
enum_i2c(enum, dft_control%plus_u_method_id)))
1993 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1994 "DFT+U| Check atomic kind information for details"
1998 WRITE (unit=output_unit, fmt=
"(A)")
""
1999 CALL xc_write(output_unit, xc_section, dft_control%lsd)
2001 IF (dft_control%apply_period_efield)
THEN
2002 WRITE (unit=output_unit, fmt=
"(A)")
""
2003 IF (dft_control%period_efield%displacement_field)
THEN
2004 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2005 "PERIODIC_EFIELD| Use displacement field formulation"
2006 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2007 "PERIODIC_EFIELD| Displacement field filter: x", &
2008 dft_control%period_efield%d_filter(1), &
2009 "PERIODIC_EFIELD| y", &
2010 dft_control%period_efield%d_filter(2), &
2011 "PERIODIC_EFIELD| z", &
2012 dft_control%period_efield%d_filter(3)
2014 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2015 "PERIODIC_EFIELD| Polarisation vector: x", &
2016 dft_control%period_efield%polarisation(1), &
2017 "PERIODIC_EFIELD| y", &
2018 dft_control%period_efield%polarisation(2), &
2019 "PERIODIC_EFIELD| z", &
2020 dft_control%period_efield%polarisation(3)
2022 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2023 "PERIODIC_EFIELD| Start Frame:", &
2024 dft_control%period_efield%start_frame, &
2025 "PERIODIC_EFIELD| End Frame:", &
2026 dft_control%period_efield%end_frame
2028 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
2029 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2030 "PERIODIC_EFIELD| Number of Intensities:", &
2031 SIZE(dft_control%period_efield%strength_list)
2032 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2033 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2034 1, dft_control%period_efield%strength_list(1)
2035 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
2036 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2037 "PERIODIC_EFIELD| ", &
2038 i, dft_control%period_efield%strength_list(i)
2041 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2042 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2043 dft_control%period_efield%strength
2046 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
2047 dft_control%period_efield%polarisation)) < epsilon(0.0_dp))
THEN
2048 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2052 IF (dft_control%do_sccs)
THEN
2053 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2054 "SCCS| Self-consistent continuum solvation model"
2055 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2056 "SCCS| Relative permittivity of the solvent (medium)", &
2057 dft_control%sccs_control%epsilon_solvent, &
2058 "SCCS| Absolute permittivity [a.u.]", &
2059 dft_control%sccs_control%epsilon_solvent/
fourpi
2060 SELECT CASE (dft_control%sccs_control%method_id)
2062 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2063 "SCCS| Dielectric function proposed by Andreussi et al.", &
2064 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2065 "SCCS| rho_min", dft_control%sccs_control%rho_min
2067 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2068 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2069 "SCCS| beta", dft_control%sccs_control%beta, &
2070 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2072 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2074 SELECT CASE (dft_control%sccs_control%derivative_method)
2076 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2077 "SCCS| Numerical derivative calculation", &
2080 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2081 "SCCS| Numerical derivative calculation", &
2082 adjustr(
"3-point stencil central differences")
2084 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2085 "SCCS| Numerical derivative calculation", &
2086 adjustr(
"5-point stencil central differences")
2088 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2089 "SCCS| Numerical derivative calculation", &
2090 adjustr(
"7-point stencil central differences")
2092 CALL cp_abort(__location__, &
2093 "Invalid derivative method specified for SCCS model. "// &
2094 "Please, check your input!")
2096 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2097 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2099 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2100 "SCCS| Dispersion parameter beta [GPa]", &
2102 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2103 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2105 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2106 "SCCS| Mixing parameter applied during the iteration cycle", &
2107 dft_control%sccs_control%mixing
2108 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2109 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2110 dft_control%sccs_control%eps_sccs
2111 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2112 "SCCS| Maximum number of iteration steps", &
2113 dft_control%sccs_control%max_iter
2114 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2115 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2116 dft_control%sccs_control%eps_scf
2117 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2118 "SCCS| Numerical increment for the cavity surface calculation", &
2119 dft_control%sccs_control%delta_rho
2122 WRITE (unit=output_unit, fmt=
"(A)")
""
2126 IF (dft_control%hairy_probes .EQV. .true.)
THEN
2127 n_rep =
SIZE(dft_control%probe)
2128 IF (output_unit > 0)
THEN
2130 WRITE (unit=output_unit, fmt=
"(T2,A,I5)") &
2131 "HP | hair probe set", i_rep
2132 WRITE (unit=output_unit, fmt=
"(T2,A,T61,*(I5))") &
2133 "HP| atom indexes", &
2134 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2135 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2136 "HP| potential", dft_control%probe(i_rep)%mu
2137 WRITE (unit=output_unit, fmt=
"(T2,A,T61,F20.2)") &
2138 "HP| temperature", dft_control%probe(i_rep)%T
2139 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2140 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2146 "PRINT%DFT_CONTROL_PARAMETERS")
2148 CALL timestop(handle)
2168 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2170 IF (iounit > 0)
THEN
2172 SELECT CASE (admm_control%admm_type)
2174 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2176 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2178 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2180 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2182 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2184 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2186 cpabort(
"admm_type")
2189 SELECT CASE (admm_control%purification_method)
2191 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2193 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2195 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2197 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2199 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2201 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2203 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2205 cpabort(
"admm_purification_method")
2208 SELECT CASE (admm_control%method)
2210 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2212 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2214 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2216 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2218 cpabort(
"admm method")
2221 SELECT CASE (admm_control%scaling_model)
2224 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2226 cpabort(
"admm scaling_model")
2229 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2231 SELECT CASE (admm_control%aux_exch_func)
2233 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2235 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2237 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2239 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2241 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2243 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2245 cpabort(
"admm aux_exch_func")
2248 WRITE (unit=iounit, fmt=
"(A)")
""
2253 "PRINT%DFT_CONTROL_PARAMETERS")
2261 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2265 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2267 INTEGER :: handle, output_unit
2270 CALL timeset(routinen, handle)
2275 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2277 IF (output_unit > 0)
THEN
2279 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2280 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2281 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2282 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2283 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2284 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2285 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2286 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2287 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2288 "xTB| Repulsive enhancement factor", xtb_control%enscale
2289 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2290 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2291 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2292 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2293 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2294 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2295 SELECT CASE (xtb_control%vdw_type)
2297 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2299 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2300 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2301 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2303 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2304 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2305 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2309 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2310 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2311 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2312 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2313 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2314 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2315 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2316 "xTB| Repulsion potential exponent", xtb_control%kf
2317 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2318 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2319 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2320 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2321 "xTB| Electronegativity scaling", xtb_control%ken
2322 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2323 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2324 WRITE (unit=output_unit, fmt=
"(/)")
2329 "PRINT%DFT_CONTROL_PARAMETERS")
2331 CALL timestop(handle)
2333 END SUBROUTINE write_xtb_control
2344 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
2346 CHARACTER(len=20) :: method, quadrature
2347 INTEGER :: handle, i, igrid_level, ngrid_level, &
2356 IF (qs_control%semi_empirical)
RETURN
2357 IF (qs_control%dftb)
RETURN
2358 IF (qs_control%xtb)
RETURN
2359 CALL timeset(routinen, handle)
2360 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2366 NULLIFY (enum, keyword)
2369 method = trim(
enum_i2c(enum, qs_control%method_id))
2371 NULLIFY (enum, keyword)
2374 quadrature = trim(
enum_i2c(enum, qs_control%gapw_control%quadrature))
2377 "DFT_CONTROL_PARAMETERS", extension=
".Log")
2378 IF (output_unit > 0)
THEN
2379 ngrid_level =
SIZE(qs_control%e_cutoff)
2380 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
2381 "QS| Method:", adjustr(method)
2382 IF (qs_control%pw_grid_opt%spherical)
THEN
2383 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
2384 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
2385 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
2386 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2387 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
2389 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2390 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
2392 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2393 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
2394 IF (ngrid_level == 1)
THEN
2395 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2396 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2398 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2399 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2400 IF (qs_control%commensurate_mgrids) &
2401 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
2402 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2403 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2404 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
2405 (
"QS| ", igrid_level,
") grid level", &
2406 qs_control%e_cutoff(igrid_level), &
2407 igrid_level=2,
SIZE(qs_control%e_cutoff))
2409 IF (qs_control%pao)
THEN
2410 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
2412 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2413 "QS| Grid level progression factor:", qs_control%progression_factor
2414 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2415 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2416 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2417 "QS| Interaction thresholds: eps_pgf_orb:", &
2418 qs_control%eps_pgf_orb, &
2419 "QS| eps_filter_matrix:", &
2420 qs_control%eps_filter_matrix, &
2421 "QS| eps_core_charge:", &
2422 qs_control%eps_core_charge, &
2423 "QS| eps_rho_gspace:", &
2424 qs_control%eps_rho_gspace, &
2425 "QS| eps_rho_rspace:", &
2426 qs_control%eps_rho_rspace, &
2427 "QS| eps_gvg_rspace:", &
2428 qs_control%eps_gvg_rspace, &
2430 qs_control%eps_ppl, &
2433 IF (qs_control%gapw)
THEN
2434 SELECT CASE (qs_control%gapw_control%basis_1c)
2436 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2437 "QS| GAPW| One center basis from orbital basis primitives"
2439 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2440 "QS| GAPW| One center basis extended with primitives (small:s)"
2442 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2443 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2445 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2446 "QS| GAPW| One center basis extended with primitives (large:spd)"
2448 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2449 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2451 cpabort(
"basis_1c incorrect")
2453 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2454 "QS| GAPW| eps_fit:", &
2455 qs_control%gapw_control%eps_fit, &
2456 "QS| GAPW| eps_iso:", &
2457 qs_control%gapw_control%eps_iso, &
2458 "QS| GAPW| eps_svd:", &
2459 qs_control%gapw_control%eps_svd, &
2460 "QS| GAPW| eps_cpc:", &
2461 qs_control%gapw_control%eps_cpc
2462 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2463 "QS| GAPW| atom-r-grid: quadrature:", &
2465 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2466 "QS| GAPW| atom-s-grid: max l :", &
2467 qs_control%gapw_control%lmax_sphere, &
2468 "QS| GAPW| max_l_rho0 :", &
2469 qs_control%gapw_control%lmax_rho0
2470 IF (qs_control%gapw_control%non_paw_atoms)
THEN
2471 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2472 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2474 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
2475 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2476 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2479 IF (qs_control%gapw_xc)
THEN
2480 SELECT CASE (qs_control%gapw_control%basis_1c)
2482 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2483 "QS| GAPW_XC| One center basis from orbital basis primitives"
2485 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2486 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2488 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2489 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2491 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2492 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2494 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2495 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2497 cpabort(
"basis_1c incorrect")
2499 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2500 "QS| GAPW_XC| eps_fit:", &
2501 qs_control%gapw_control%eps_fit, &
2502 "QS| GAPW_XC| eps_iso:", &
2503 qs_control%gapw_control%eps_iso, &
2504 "QS| GAPW_XC| eps_svd:", &
2505 qs_control%gapw_control%eps_svd
2506 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
2507 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2508 enum_i2c(enum, qs_control%gapw_control%quadrature)
2509 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2510 "QS| GAPW_XC| atom-s-grid: max l :", &
2511 qs_control%gapw_control%lmax_sphere
2513 IF (qs_control%mulliken_restraint)
THEN
2514 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2515 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2516 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2517 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2518 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2519 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2520 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
2522 IF (qs_control%ddapc_restraint)
THEN
2523 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2524 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2525 IF (
SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2526 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
2527 "QS| parameters for DDAPC restraint number", i
2528 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2529 "QS| ddapc restraint target", ddapc_restraint_control%target
2530 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2531 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2532 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2533 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2534 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
2535 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
2536 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
2537 SELECT CASE (ddapc_restraint_control%functional_form)
2539 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2540 "QS| ddapc restraint functional form :",
"RESTRAINT"
2542 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2543 "QS| ddapc restraint functional form :",
"CONSTRAINT"
2545 cpabort(
"Unknown ddapc restraint")
2549 IF (qs_control%s2_restraint)
THEN
2550 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2551 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2552 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2553 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2554 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2556 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2557 "QS| s2 restraint functional form :",
"RESTRAINT"
2558 cpabort(
"Not yet implemented")
2560 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2561 "QS| s2 restraint functional form :",
"CONSTRAINT"
2563 cpabort(
"Unknown ddapc restraint")
2568 "DFT_CONTROL_PARAMETERS")
2570 CALL timestop(handle)
2588 TYPE(
section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
2590 INTEGER :: i, j, jj, k, n_rep
2591 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2592 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
2596 IF (
PRESENT(ddapc_restraint_section))
THEN
2597 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
2598 IF (
SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2599 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
2601 ddapc_section => ddapc_restraint_section
2602 ALLOCATE (qs_control%ddapc_restraint_control(1))
2606 IF (
PRESENT(qs_section))
THEN
2607 NULLIFY (ddapc_section)
2612 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2615 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2618 r_val=ddapc_restraint_control%strength)
2620 r_val=ddapc_restraint_control%target)
2622 i_val=ddapc_restraint_control%functional_form)
2626 i_val=ddapc_restraint_control%density_type)
2631 i_rep_val=k, i_vals=tmplist)
2632 DO j = 1,
SIZE(tmplist)
2636 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
2637 ddapc_restraint_control%natoms = jj
2638 IF (
ASSOCIATED(ddapc_restraint_control%atoms)) &
2639 DEALLOCATE (ddapc_restraint_control%atoms)
2640 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2644 i_rep_val=k, i_vals=tmplist)
2645 DO j = 1,
SIZE(tmplist)
2647 ddapc_restraint_control%atoms(jj) = tmplist(j)
2651 IF (
ASSOCIATED(ddapc_restraint_control%coeff)) &
2652 DEALLOCATE (ddapc_restraint_control%coeff)
2653 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2654 ddapc_restraint_control%coeff = 1.0_dp
2661 i_rep_val=k, r_vals=rtmplist)
2662 DO j = 1,
SIZE(rtmplist)
2664 IF (jj > ddapc_restraint_control%natoms) &
2665 cpabort(
"Need the same number of coeff as there are atoms ")
2666 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2669 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2670 cpabort(
"Need no or the same number of coeff as there are atoms.")
2673 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2674 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2677 IF (k == 2)
CALL cp_abort(__location__, &
2678 "Only a single constraint possible yet, try to use restraints instead ")
2687 SUBROUTINE read_efield_sections(dft_control, efield_section)
2691 CHARACTER(len=default_path_length) :: file_name
2692 INTEGER :: i, io, j, n, unit_nr
2693 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tmp_vals
2697 DO i = 1,
SIZE(dft_control%efield_fields)
2698 NULLIFY (dft_control%efield_fields(i)%efield)
2699 ALLOCATE (dft_control%efield_fields(i)%efield)
2700 efield => dft_control%efield_fields(i)%efield
2701 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2703 r_val=efield%strength)
2707 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
2708 efield%polarisation = tmp_vals
2710 r_val=efield%phase_offset)
2712 i_val=efield%envelop_id)
2714 r_val=efield%wavelength)
2717 efield%vec_pot_initial = tmp_vals
2720 ALLOCATE (efield%envelop_i_vars(2))
2723 i_val=efield%envelop_i_vars(1))
2725 i_val=efield%envelop_i_vars(2))
2727 ALLOCATE (efield%envelop_r_vars(2))
2730 r_val=efield%envelop_r_vars(1))
2732 r_val=efield%envelop_r_vars(2))
2733 ELSE IF (efield%envelop_id ==
ramp_env)
THEN
2734 ALLOCATE (efield%envelop_i_vars(4))
2737 i_val=efield%envelop_i_vars(1))
2739 i_val=efield%envelop_i_vars(2))
2741 i_val=efield%envelop_i_vars(3))
2743 i_val=efield%envelop_i_vars(4))
2744 ELSE IF (efield%envelop_id ==
custom_env)
THEN
2747 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
2751 READ (unit_nr, *, iostat=io)
2756 ALLOCATE (efield%envelop_r_vars(n + 1))
2761 READ (unit_nr, *) efield%envelop_r_vars(j)
2762 efield%envelop_r_vars(j) =
cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
2767 END SUBROUTINE read_efield_sections
2775 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2780 INTEGER,
DIMENSION(:),
POINTER :: tmp
2781 LOGICAL :: is_present
2784 ALLOCATE (dft_control%rtp_control)
2786 i_val=dft_control%rtp_control%max_iter)
2788 i_val=dft_control%rtp_control%mat_exp)
2790 i_val=dft_control%rtp_control%aspc_order)
2792 r_val=dft_control%rtp_control%eps_exp)
2794 i_val=dft_control%rtp_control%rtp_method)
2796 i_val=dft_control%rtp_control%rtbse_ham)
2798 i_val=dft_control%rtp_control%propagator)
2800 r_val=dft_control%rtp_control%eps_ener)
2802 i_val=dft_control%rtp_control%initial_wfn)
2804 l_val=dft_control%rtp_control%hfx_redistribute)
2806 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2808 l_val=dft_control%rtp_control%apply_delta_pulse)
2810 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2812 l_val=dft_control%rtp_control%velocity_gauge)
2814 l_val=dft_control%rtp_control%nl_gauge_transform)
2816 l_val=dft_control%rtp_control%periodic)
2818 l_val=dft_control%rtp_control%linear_scaling)
2820 i_val=dft_control%rtp_control%mcweeny_max_iter)
2822 i_val=dft_control%rtp_control%acc_ref)
2824 r_val=dft_control%rtp_control%mcweeny_eps)
2826 r_val=dft_control%rtp_control%delta_pulse_scale)
2829 dft_control%rtp_control%delta_pulse_direction = tmp
2831 i_val=dft_control%rtp_control%sc_check_start)
2834 IF (is_present)
THEN
2835 IF (dft_control%rtp_control%linear_scaling) &
2836 CALL cp_abort(__location__, &
2837 "You have defined a time dependent projection of mos, but "// &
2838 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2839 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2840 "define any PRINT%PROJECTION_MO section")
2841 dft_control%rtp_control%is_proj_mo = .true.
2843 dft_control%rtp_control%is_proj_mo = .false.
2846 END SUBROUTINE read_rtp_section
2853 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2857 INTEGER :: irep, list_size, n_rep
2858 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2865 ALLOCATE (admm_control%blocks(n_rep))
2869 i_rep_val=irep, i_vals=tmplist)
2870 list_size =
SIZE(tmplist)
2871 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2872 admm_control%blocks(irep)%list(:) = tmplist(:)
2875 END SUBROUTINE read_admm_block_list
2884 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
2888 INTEGER :: i, j, jj, kk, n_rep
2889 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2891 DO i = 1,
SIZE(dft_control%probe)
2892 NULLIFY (dft_control%probe(i)%atom_ids)
2897 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2898 jj = jj +
SIZE(tmplist)
2901 dft_control%probe(i)%natoms = jj
2902 IF (dft_control%probe(i)%natoms < 1) &
2903 cpabort(
"Need at least 1 atom to use hair probes formalism")
2904 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
2908 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2909 DO j = 1,
SIZE(tmplist)
2911 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
2915 CALL section_vals_val_get(hairy_probes_section,
"MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
2917 CALL section_vals_val_get(hairy_probes_section,
"T", i_rep_section=i, r_val=dft_control%probe(i)%T)
2919 CALL section_vals_val_get(hairy_probes_section,
"ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
2921 CALL section_vals_val_get(hairy_probes_section,
"eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
2924 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 yin2017
integer, save, public stewart2007
integer, save, public caldeweyher2020
integer, save, public stengel2009
integer, save, public vandevondele2005a
integer, save, public caldeweyher2017
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 asgeirsson2017
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 bannwarth2019
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
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_tddfpt2_control(t_control, t_section, qs_control)
Read TDDFPT-related input parameters.
subroutine, public read_dft_control(dft_control, dft_section)
...
subroutine, public read_qs_section(qs_control, qs_section)
...
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, quip, nequip, allegro, 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 of a logger, at the moment it contains just a print level starting at which level it should be l...