21 tddfpt_control_type, xtb_control_type
76 #include "./base/base_uses.f90"
82 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_control_utils'
101 TYPE(dft_control_type),
POINTER :: dft_control
102 TYPE(section_vals_type),
POINTER :: dft_section
104 CHARACTER(len=default_path_length) :: basis_set_file_name, potential_file_name
105 CHARACTER(LEN=default_string_length), &
106 DIMENSION(:),
POINTER :: tmpstringlist
107 INTEGER :: admmtype, excitations, irep, isize, &
108 method_id, nrep, xc_deriv_method_id
109 LOGICAL :: do_ot, do_rtp, exopt1, exopt2, exopt3, &
110 explicit, is_present, l_param, not_se, &
112 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
113 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
114 TYPE(cp_logger_type),
POINTER :: logger
115 TYPE(section_vals_type),
POINTER :: maxwell_section, sccs_section, &
116 scf_section, tmp_section, &
117 xc_fun_section, xc_section
119 was_present = .false.
123 NULLIFY (tmp_section, xc_fun_section, xc_section)
124 ALLOCATE (dft_control)
130 SELECT CASE (method_id)
138 IF (.NOT. is_present .AND. not_se)
THEN
139 cpabort(
"XC section missing.")
146 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
147 CALL cp_warn(__location__, &
148 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
149 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
150 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
151 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
152 CALL cp_warn(__location__, &
153 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
154 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
155 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
156 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
157 CALL cp_warn(__location__, &
158 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
159 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
160 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
167 IF (.NOT. is_present .AND. not_se)
THEN
168 cpabort(
"XC_FUNCTIONAL section missing.")
173 IF (dft_control%uks .OR. dft_control%roks)
THEN
174 dft_control%nspins = 2
176 dft_control%nspins = 1
179 dft_control%lsd = (dft_control%nspins > 1)
183 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
185 IF (dft_control%drho_by_collocation)
THEN
186 cpabort(
"derivatives by collocation not implemented")
193 IF (
SIZE(tmpstringlist) == 2)
THEN
195 SELECT CASE (tmpstringlist(2))
207 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
210 SELECT CASE (tmpstringlist(1))
213 dft_control%auto_basis_ri_aux = isize
215 dft_control%auto_basis_aux_fit = isize
217 dft_control%auto_basis_lri_aux = isize
219 dft_control%auto_basis_p_lri_aux = isize
221 dft_control%auto_basis_ri_hxc = isize
223 dft_control%auto_basis_ri_xas = isize
225 dft_control%auto_basis_ri_hfx = isize
227 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
230 CALL cp_abort(__location__, &
231 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
238 dft_control%do_admm = is_present
239 dft_control%do_admm_mo = .false.
240 dft_control%do_admm_dm = .false.
246 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
247 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
248 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
249 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
250 dft_control%admm_control%admm_type = admmtype
251 SELECT CASE (admmtype)
253 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
254 dft_control%admm_control%purification_method = method_id
255 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
256 dft_control%admm_control%method = method_id
257 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
258 dft_control%admm_control%scaling_model = method_id
263 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
264 dft_control%admm_control%purification_method = method_id
296 CALL cp_abort(__location__, &
297 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
301 r_val=dft_control%admm_control%eps_filter)
303 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
304 dft_control%admm_control%aux_exch_func = method_id
307 dft_control%admm_control%aux_exch_func_param = .false.
308 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
309 r_val=dft_control%admm_control%aux_x_param(1))
310 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
311 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
312 r_val=dft_control%admm_control%aux_x_param(2))
313 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
314 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
315 r_val=dft_control%admm_control%aux_x_param(3))
316 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
318 CALL read_admm_block_list(dft_control%admm_control, dft_section)
321 SELECT CASE (admmtype)
323 IF (exopt2)
CALL cp_warn(__location__, &
324 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
325 IF (exopt3)
CALL cp_warn(__location__, &
326 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
328 IF (exopt1)
CALL cp_warn(__location__, &
329 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
330 IF (exopt2)
CALL cp_warn(__location__, &
331 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
332 IF (exopt3)
CALL cp_warn(__location__, &
333 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
342 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
347 CALL cp_abort(__location__, &
348 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
349 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
355 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
357 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
362 dft_control%do_admm_dm = .true.
364 dft_control%do_admm_mo = .true.
372 dft_control%restricted = (dft_control%roks .AND. l_param)
376 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
377 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
378 IF (.NOT. dft_control%uks) &
379 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
380 "unrestricted Kohn-Sham (UKS) calculations")
387 dft_control%sic_method_id =
sic_none
388 dft_control%sic_scaling_a = 1.0_dp
389 dft_control%sic_scaling_b = 1.0_dp
392 dft_control%dft_plus_u = .false.
394 dft_control%plus_u_method_id = method_id
397 dft_control%smear = .false.
400 dft_control%correct_surf_dip = .false.
401 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
403 dft_control%pos_dir_surf_dip = -1.0_dp
407 dft_control%switch_surf_dip = .false.
408 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
410 dft_control%correct_el_density_dip = .false.
411 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
412 IF (dft_control%correct_el_density_dip)
THEN
413 IF (dft_control%correct_surf_dip)
THEN
416 dft_control%correct_el_density_dip = .false.
417 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
422 c_val=basis_set_file_name)
424 c_val=potential_file_name)
429 i_val=dft_control%sic_method_id)
431 i_val=dft_control%sic_list_id)
433 r_val=dft_control%sic_scaling_a)
435 r_val=dft_control%sic_scaling_b)
440 IF (dft_control%do_tddfpt_calculation)
THEN
448 CALL read_rtp_section(dft_control, tmp_section)
455 IF (dft_control%do_xas_calculation)
THEN
458 l_val=dft_control%do_xas_calculation)
462 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
463 IF (dft_control%do_xas_tdp_calculation)
THEN
466 l_val=dft_control%do_xas_tdp_calculation)
470 dft_control%apply_efield = .false.
471 dft_control%apply_efield_field = .false.
472 dft_control%apply_vector_potential = .false.
476 ALLOCATE (dft_control%efield_fields(nrep))
477 CALL read_efield_sections(dft_control, tmp_section)
479 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
480 dft_control%apply_efield_field = .true.
482 dft_control%apply_vector_potential = .true.
484 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
487 dft_control%apply_efield = .true.
494 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
495 IF (dft_control%apply_period_efield)
THEN
496 ALLOCATE (dft_control%period_efield)
498 dft_control%period_efield%polarisation(1:3) = pol(1:3)
500 dft_control%period_efield%d_filter(1:3) = pol(1:3)
502 r_val=dft_control%period_efield%strength)
503 dft_control%period_efield%displacement_field = .false.
505 l_val=dft_control%period_efield%displacement_field)
507 cpassert(.NOT. do_rtp)
508 IF (dft_control%period_efield%displacement_field)
THEN
518 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
519 IF (dft_control%apply_external_potential)
THEN
522 l_val=dft_control%expot_control%read_from_cube)
524 l_val=dft_control%expot_control%static)
526 r_val=dft_control%expot_control%scaling_factor)
531 dft_control%expot_control%maxwell_solver = .true.
535 r_val=dft_control%maxwell_control%real_test)
537 i_val=dft_control%maxwell_control%int_test)
539 l_val=dft_control%maxwell_control%log_test)
541 dft_control%expot_control%maxwell_solver = .false.
551 l_val=dft_control%do_sccs)
552 IF (dft_control%do_sccs)
THEN
553 ALLOCATE (dft_control%sccs_control)
555 r_val=dft_control%sccs_control%epsilon_solvent)
557 r_val=dft_control%sccs_control%alpha_solvent)
559 r_val=dft_control%sccs_control%beta_solvent)
561 r_val=dft_control%sccs_control%delta_rho)
563 i_val=dft_control%sccs_control%derivative_method)
565 i_val=dft_control%sccs_control%method_id)
567 r_val=dft_control%sccs_control%eps_sccs)
569 r_val=dft_control%sccs_control%eps_scf)
571 r_val=dft_control%sccs_control%gamma_solvent)
573 i_val=dft_control%sccs_control%max_iter)
575 r_val=dft_control%sccs_control%mixing)
576 SELECT CASE (dft_control%sccs_control%method_id)
580 r_val=dft_control%sccs_control%rho_max)
582 r_val=dft_control%sccs_control%rho_min)
583 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
584 CALL cp_abort(__location__, &
585 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
586 "Please, check your input!")
592 r_val=dft_control%sccs_control%beta)
593 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
594 CALL cp_abort(__location__, &
595 "A value smaller than 0.5 for the SCCS parameter beta "// &
596 "causes numerical problems. Please, check your input!")
599 r_val=dft_control%sccs_control%rho_zero)
602 cpabort(
"Invalid SCCS model specified. Please, check your input!")
611 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
626 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
627 TYPE(section_vals_type),
POINTER :: dft_section
629 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
631 INTEGER :: handle, igrid_level, ngrid_level
632 LOGICAL :: explicit, multigrid_set
634 REAL(
dp),
DIMENSION(:),
POINTER :: cutofflist
635 TYPE(section_vals_type),
POINTER :: mgrid_section
637 CALL timeset(routinen, handle)
639 NULLIFY (mgrid_section, cutofflist)
645 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
650 l_val=qs_control%skip_load_balance_distributed)
653 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
655 multigrid_set = .false.
658 IF (.NOT. explicit) cutoff = 1.0_dp
661 ALLOCATE (qs_control%e_cutoff(ngrid_level))
662 qs_control%cutoff = cutoff
664 IF (multigrid_set)
THEN
666 IF (qs_control%commensurate_mgrids)
THEN
667 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
671 IF (
ASSOCIATED(cutofflist))
THEN
672 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
673 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
675 DO igrid_level = 1, ngrid_level
676 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
680 DO igrid_level = ngrid_level, 1, -1
681 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
682 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
686 IF (igrid_level == 1)
THEN
687 qs_control%cutoff = qs_control%e_cutoff(1)
691 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
692 qs_control%e_cutoff(1) = qs_control%cutoff
693 DO igrid_level = 2, ngrid_level
694 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
695 qs_control%progression_factor
699 DO igrid_level = 2, ngrid_level
700 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
701 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
702 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
703 cpabort(
"The same cutoff value was specified for two multi-grids")
706 CALL timestop(handle)
716 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
717 TYPE(section_vals_type),
POINTER :: qs_section
719 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
721 CHARACTER(LEN=default_string_length), &
722 DIMENSION(:),
POINTER :: clist
723 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
725 INTEGER,
DIMENSION(:),
POINTER :: tmplist
726 LOGICAL :: explicit, was_present
727 REAL(
dp) :: tmp, tmpsqrt, value
728 REAL(
dp),
POINTER :: scal(:)
729 TYPE(section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
730 dftb_parameter, dftb_section, genpot_section, lri_optbas_section, mull_section, &
731 nonbonded_section, s2_restraint_section, se_section, xtb_parameter, xtb_section
733 CALL timeset(routinen, handle)
735 was_present = .false.
736 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
737 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
738 cdft_control_section, genpot_section)
756 tmpsqrt = sqrt(
value)
759 qs_control%eps_core_charge =
value/100.0_dp
762 qs_control%eps_pgf_orb = tmpsqrt
763 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
765 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
767 qs_control%eps_ppl = 1.0e-2_dp
769 qs_control%gapw_control%eps_cpc =
value
771 qs_control%eps_rho_gspace =
value
772 qs_control%eps_rho_rspace =
value
774 qs_control%eps_gvg_rspace = tmpsqrt
791 qs_control%eps_kg_orb = sqrt(tmp)
804 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
828 qs_control%gapw_control%lrho1_eq_lrho0 = .false.
829 qs_control%gapw_control%alpha0_hard_from_input = .false.
830 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
832 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
842 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
843 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
854 IF (qs_control%gapw_control%basis_1c /=
gapw_1c_orb)
THEN
855 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
862 qs_control%pw_grid_opt%spherical = .true.
863 qs_control%pw_grid_opt%fullspace = .false.
865 qs_control%pw_grid_opt%spherical = .false.
866 qs_control%pw_grid_opt%fullspace = .true.
868 qs_control%pw_grid_opt%spherical = .false.
869 qs_control%pw_grid_opt%fullspace = .false.
874 qs_control%do_ppl_method = itmp
877 qs_control%pw_grid_opt%distribution_layout = tmplist
881 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
882 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
886 qs_control%gapw = .false.
887 qs_control%gapw_xc = .false.
888 qs_control%gpw = .false.
889 qs_control%pao = .false.
890 qs_control%dftb = .false.
891 qs_control%xtb = .false.
892 qs_control%semi_empirical = .false.
893 qs_control%ofgpw = .false.
894 qs_control%lrigpw = .false.
895 qs_control%rigpw = .false.
896 SELECT CASE (qs_control%method_id)
900 qs_control%gapw = .true.
902 qs_control%gapw_xc = .true.
906 qs_control%gpw = .true.
908 qs_control%ofgpw = .true.
910 qs_control%lrigpw = .true.
912 qs_control%rigpw = .true.
914 qs_control%dftb = .true.
918 qs_control%xtb = .true.
922 qs_control%semi_empirical = .true.
925 qs_control%semi_empirical = .true.
928 qs_control%semi_empirical = .true.
931 qs_control%semi_empirical = .true.
934 qs_control%semi_empirical = .true.
937 qs_control%semi_empirical = .true.
940 qs_control%semi_empirical = .true.
943 qs_control%semi_empirical = .true.
947 qs_control%semi_empirical = .true.
952 IF (qs_control%mulliken_restraint)
THEN
953 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
954 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
959 jj = jj +
SIZE(tmplist)
961 qs_control%mulliken_restraint_control%natoms = jj
962 IF (qs_control%mulliken_restraint_control%natoms < 1) &
963 cpabort(
"Need at least 1 atom to use mulliken constraints")
964 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
968 DO j = 1,
SIZE(tmplist)
970 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
974 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
975 IF (qs_control%ddapc_restraint)
THEN
976 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
978 qs_control%ddapc_restraint_is_spin = .false.
979 qs_control%ddapc_explicit_potential = .false.
982 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
983 IF (qs_control%s2_restraint)
THEN
985 r_val=qs_control%s2_restraint_control%strength)
987 r_val=qs_control%s2_restraint_control%target)
989 i_val=qs_control%s2_restraint_control%functional_form)
993 IF (qs_control%cdft)
THEN
998 IF (qs_control%semi_empirical)
THEN
1000 l_val=qs_control%se_control%orthogonal_basis)
1002 r_val=qs_control%se_control%delta)
1004 l_val=qs_control%se_control%analytical_gradients)
1006 l_val=qs_control%se_control%force_kdsod_EX)
1009 i_val=qs_control%se_control%integral_screening)
1012 CALL cp_warn(__location__, &
1013 "PNNL semi-empirical parameterization supports only the Slater type "// &
1014 "integral scheme. Revert to Slater and continue the calculation.")
1019 i_val=qs_control%se_control%ga_ncells)
1022 r_val=qs_control%se_control%cutoff_lrc)
1023 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1028 r_val=qs_control%se_control%taper_lrc)
1031 r_val=qs_control%se_control%range_lrc)
1034 r_val=qs_control%se_control%cutoff_cou)
1035 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1040 r_val=qs_control%se_control%taper_cou)
1043 r_val=qs_control%se_control%range_cou)
1046 r_val=qs_control%se_control%cutoff_exc)
1047 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1052 r_val=qs_control%se_control%taper_exc)
1055 r_val=qs_control%se_control%range_exc)
1059 r_val=qs_control%se_control%taper_scr)
1061 r_val=qs_control%se_control%range_scr)
1065 i_val=qs_control%se_control%periodic_type)
1066 SELECT CASE (qs_control%se_control%periodic_type)
1068 qs_control%se_control%do_ewald = .false.
1069 qs_control%se_control%do_ewald_r3 = .false.
1070 qs_control%se_control%do_ewald_gks = .false.
1072 qs_control%se_control%do_ewald = .true.
1073 qs_control%se_control%do_ewald_r3 = .false.
1074 qs_control%se_control%do_ewald_gks = .false.
1076 qs_control%se_control%do_ewald = .false.
1077 qs_control%se_control%do_ewald_r3 = .false.
1078 qs_control%se_control%do_ewald_gks = .true.
1080 CALL cp_abort(__location__, &
1081 "A periodic semi-empirical calculation was requested with a long-range "// &
1082 "summation on the single integral evaluation. This scheme is supported "// &
1083 "only by the PNNL parameterization.")
1085 qs_control%se_control%do_ewald = .true.
1086 qs_control%se_control%do_ewald_r3 = .true.
1087 qs_control%se_control%do_ewald_gks = .false.
1088 IF (qs_control%se_control%integral_screening /=
do_se_is_kdso) &
1089 CALL cp_abort(__location__, &
1090 "A periodic semi-empirical calculation was requested with a long-range "// &
1091 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1092 "with the integral screening chosen. The only integral screening supported "// &
1093 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1098 l_val=qs_control%se_control%dispersion)
1100 r_val=qs_control%se_control%rcdisp)
1102 r_val=qs_control%se_control%epscn)
1104 qs_control%se_control%sd3(1) = scal(1)
1105 qs_control%se_control%sd3(2) = scal(2)
1106 qs_control%se_control%sd3(3) = scal(3)
1108 c_val=qs_control%se_control%dispersion_parameter_file)
1112 cpabort(
"EWALD_R3 not implemented yet!")
1124 qs_control%se_control%orthogonal_basis = .true.
1129 IF (qs_control%dftb)
THEN
1131 l_val=qs_control%dftb_control%orthogonal_basis)
1133 l_val=qs_control%dftb_control%self_consistent)
1135 l_val=qs_control%dftb_control%dispersion)
1137 l_val=qs_control%dftb_control%dftb3_diagonal)
1139 l_val=qs_control%dftb_control%hb_sr_damp)
1141 r_val=qs_control%dftb_control%eps_disp)
1145 l_val=qs_control%dftb_control%do_ewald)
1147 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1150 c_val=qs_control%dftb_control%sk_file_path)
1152 c_val=qs_control%dftb_control%sk_file_list)
1154 r_val=qs_control%dftb_control%hb_sr_para)
1156 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1160 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1164 i_val=qs_control%dftb_control%dispersion_type)
1166 c_val=qs_control%dftb_control%uff_force_field)
1169 r_val=qs_control%dftb_control%rcdisp)
1171 r_val=qs_control%dftb_control%epscn)
1173 r_val=qs_control%dftb_control%exp_pre)
1175 r_val=qs_control%dftb_control%scaling)
1177 qs_control%dftb_control%sd3(1) = scal(1)
1178 qs_control%dftb_control%sd3(2) = scal(2)
1179 qs_control%dftb_control%sd3(3) = scal(3)
1181 qs_control%dftb_control%sd3bj(1) = scal(1)
1182 qs_control%dftb_control%sd3bj(2) = scal(2)
1183 qs_control%dftb_control%sd3bj(3) = scal(3)
1184 qs_control%dftb_control%sd3bj(4) = scal(4)
1186 c_val=qs_control%dftb_control%dispersion_parameter_file)
1188 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(
zhechkov2005)
1189 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(
elstner1998)
1190 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(
hu2007)
1194 IF (qs_control%xtb)
THEN
1198 l_val=qs_control%xtb_control%do_ewald)
1200 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1203 qs_control%xtb_control%sto_ng = ngauss
1205 qs_control%xtb_control%h_sto_ng = ngauss
1207 c_val=qs_control%xtb_control%parameter_file_path)
1209 c_val=qs_control%xtb_control%parameter_file_name)
1212 r_val=qs_control%xtb_control%rcdisp)
1214 r_val=qs_control%xtb_control%epscn)
1216 qs_control%xtb_control%s6 = scal(1)
1217 qs_control%xtb_control%s8 = scal(2)
1219 qs_control%xtb_control%a1 = scal(1)
1220 qs_control%xtb_control%a2 = scal(2)
1222 c_val=qs_control%xtb_control%dispersion_parameter_file)
1225 qs_control%xtb_control%ks = scal(1)
1226 qs_control%xtb_control%kp = scal(2)
1227 qs_control%xtb_control%kd = scal(3)
1228 qs_control%xtb_control%ksp = scal(4)
1229 qs_control%xtb_control%k2sh = scal(5)
1231 qs_control%xtb_control%kg = scal(1)
1232 qs_control%xtb_control%kf = scal(2)
1234 qs_control%xtb_control%kcns = scal(1)
1235 qs_control%xtb_control%kcnp = scal(2)
1236 qs_control%xtb_control%kcnd = scal(3)
1238 qs_control%xtb_control%ken = scal(1)
1241 l_val=qs_control%xtb_control%xb_interaction)
1243 qs_control%xtb_control%kxr = scal(1)
1244 qs_control%xtb_control%kx2 = scal(2)
1247 l_val=qs_control%xtb_control%do_nonbonded)
1249 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1253 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1258 l_val=qs_control%xtb_control%old_coulomb_damping)
1260 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1262 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1269 l_val=qs_control%xtb_control%coulomb_interaction)
1271 l_val=qs_control%xtb_control%coulomb_lr)
1273 l_val=qs_control%xtb_control%tb3_interaction)
1276 l_val=qs_control%xtb_control%check_atomic_charges)
1278 qs_control%xtb_control%kab_nval = n_rep
1280 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1281 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1282 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1285 qs_control%xtb_control%kab_param(1, j) = clist(1)
1287 ielement=qs_control%xtb_control%kab_types(1, j))
1288 qs_control%xtb_control%kab_param(2, j) = clist(2)
1290 ielement=qs_control%xtb_control%kab_types(2, j))
1291 qs_control%xtb_control%kab_param(3, j) = clist(3)
1292 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1300 CALL timestop(handle)
1309 TYPE(tddfpt_control_type) :: t_control
1310 TYPE(section_vals_type),
POINTER :: dft_section
1312 LOGICAL :: kenergy_den
1313 TYPE(section_vals_type),
POINTER :: sic_section, t_section
1315 kenergy_den = .false.
1316 NULLIFY (sic_section, t_section)
1332 t_control%use_kinetic_energy_density = .false.
1348 TYPE(tddfpt2_control_type),
POINTER :: t_control
1349 TYPE(section_vals_type),
POINTER :: t_section
1350 TYPE(qs_control_type),
POINTER :: qs_control
1352 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
1354 CHARACTER(LEN=default_string_length), &
1355 DIMENSION(:),
POINTER :: tmpstringlist
1356 INTEGER :: handle, irep, isize, nrep
1357 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1358 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1360 REAL(kind=
dp) :: filter, fval, hfx
1361 TYPE(section_vals_type),
POINTER :: dipole_section, mgrid_section, &
1362 soc_section, stda_section, xc_func, &
1365 CALL timeset(routinen, handle)
1380 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
1386 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1387 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1393 IF (
SIZE(tmpstringlist) == 2)
THEN
1395 SELECT CASE (tmpstringlist(2))
1407 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1410 SELECT CASE (tmpstringlist(1))
1413 t_control%auto_basis_p_lri_aux = isize
1415 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1418 CALL cp_abort(__location__, &
1419 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1423 IF (t_control%conv < 0) &
1424 t_control%conv = abs(t_control%conv)
1432 t_control%dipole_form = 0
1437 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1439 NULLIFY (t_control%dipole_ref_point)
1441 cpabort(
"User-defined reference point should be given explicitly")
1449 t_control%do_soc = .true.
1456 IF (t_control%mgrid_is_explicit)
THEN
1457 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1458 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
1460 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1461 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1464 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1466 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1467 CALL cp_abort(__location__, &
1468 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1470 t_control%mgrid_progression_factor = qs_control%progression_factor
1473 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1474 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1475 IF (t_control%mgrid_commensurate_mgrids)
THEN
1477 t_control%mgrid_progression_factor = 4.0_dp
1479 t_control%mgrid_progression_factor = qs_control%progression_factor
1483 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1484 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1486 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1487 IF (.NOT. explicit) multigrid_set = .false.
1488 IF (multigrid_set)
THEN
1491 NULLIFY (t_control%mgrid_e_cutoff)
1494 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1495 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1498 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1499 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1501 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
1502 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1503 cpabort(
"Inconsistent values for number of multi-grids")
1506 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1507 ALLOCATE (inds(t_control%mgrid_ngrids))
1508 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1510 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1524 t_control%stda_control%hfx_fraction = 0.0_dp
1525 t_control%stda_control%do_exchange = .true.
1526 t_control%stda_control%eps_td_filter = 1.e-10_dp
1527 t_control%stda_control%mn_alpha = -99.0_dp
1528 t_control%stda_control%mn_beta = -99.0_dp
1530 SELECT CASE (qs_control%periodicity)
1532 t_control%stda_control%do_ewald = .false.
1534 t_control%stda_control%do_ewald = .true.
1536 t_control%stda_control%do_ewald = .true.
1538 t_control%stda_control%do_ewald = .true.
1540 cpabort(
"Illegal value for periodiciy")
1545 IF (expl) t_control%stda_control%hfx_fraction = hfx
1547 IF (expl) t_control%stda_control%eps_td_filter = filter
1549 IF (expl) t_control%stda_control%do_ewald = do_ewald
1551 IF (expl) t_control%stda_control%do_exchange = do_exchange
1553 t_control%stda_control%mn_alpha = fval
1555 t_control%stda_control%mn_beta = fval
1558 t_control%stda_control%coulomb_sr_cut = fval
1560 t_control%stda_control%coulomb_sr_eps = fval
1563 CALL timestop(handle)
1572 TYPE(dft_control_type),
POINTER :: dft_control
1573 TYPE(section_vals_type),
POINTER :: dft_section
1575 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
1577 CHARACTER(LEN=20) :: tmpstr
1578 INTEGER :: handle, output_unit
1579 REAL(kind=
dp) :: density_cut, density_smooth_cut_range, &
1580 gradient_cut, tau_cut
1581 TYPE(cp_logger_type),
POINTER :: logger
1582 TYPE(enumeration_type),
POINTER :: enum
1583 TYPE(keyword_type),
POINTER :: keyword
1584 TYPE(section_type),
POINTER :: section
1585 TYPE(section_vals_type),
POINTER :: xc_section
1587 IF (dft_control%qs_control%semi_empirical)
RETURN
1588 IF (dft_control%qs_control%dftb)
RETURN
1589 IF (dft_control%qs_control%xtb)
THEN
1590 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1593 CALL timeset(routinen, handle)
1599 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1601 IF (output_unit > 0)
THEN
1605 IF (dft_control%uks)
THEN
1606 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1607 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
1608 ELSE IF (dft_control%roks)
THEN
1609 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
1610 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
1612 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1613 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
1616 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1617 "DFT| Multiplicity", dft_control%multiplicity
1618 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1619 "DFT| Number of spin states", dft_control%nspins
1621 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1622 "DFT| Charge", dft_control%charge
1625 SELECT CASE (dft_control%sic_method_id)
1629 tmpstr =
"SPZ/MAURI SIC"
1631 tmpstr =
"US/MAURI SIC"
1635 tmpstr =
"Explicit Orbital SIC"
1638 cpabort(
"SIC option unknown")
1641 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
1642 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1644 IF (dft_control%sic_method_id /=
sic_none)
THEN
1645 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1646 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1647 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1650 IF (dft_control%sic_method_id ==
sic_eo)
THEN
1652 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1653 "DFT| SIC orbitals",
"ALL"
1656 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1657 "DFT| SIC orbitals",
"UNPAIRED"
1664 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1666 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1667 "DFT| Cutoffs: density ", density_cut, &
1668 "DFT| gradient", gradient_cut, &
1669 "DFT| tau ", tau_cut, &
1670 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1673 WRITE (output_unit,
'( A, T61, A )') &
1674 " DFT| XC density smoothing ", adjustr(tmpstr)
1677 WRITE (output_unit,
'( A, T61, A )') &
1678 " DFT| XC derivatives ", adjustr(tmpstr)
1679 IF (dft_control%dft_plus_u)
THEN
1680 NULLIFY (enum, keyword, section)
1684 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
1685 "DFT+U| Method", adjustr(trim(
enum_i2c(enum, dft_control%plus_u_method_id)))
1686 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1687 "DFT+U| Check atomic kind information for details"
1691 WRITE (unit=output_unit, fmt=
"(A)")
""
1692 CALL xc_write(output_unit, xc_section, dft_control%lsd)
1694 IF (dft_control%apply_period_efield)
THEN
1695 WRITE (unit=output_unit, fmt=
"(A)")
""
1696 IF (dft_control%period_efield%displacement_field)
THEN
1697 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1698 "PERIODIC_EFIELD| Use displacement field formulation"
1699 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1700 "PERIODIC_EFIELD| Displacement field filter: x", &
1701 dft_control%period_efield%d_filter(1), &
1702 "PERIODIC_EFIELD| y", &
1703 dft_control%period_efield%d_filter(2), &
1704 "PERIODIC_EFIELD| z", &
1705 dft_control%period_efield%d_filter(3)
1707 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1708 "PERIODIC_EFIELD| Polarisation vector: x", &
1709 dft_control%period_efield%polarisation(1), &
1710 "PERIODIC_EFIELD| y", &
1711 dft_control%period_efield%polarisation(2), &
1712 "PERIODIC_EFIELD| z", &
1713 dft_control%period_efield%polarisation(3), &
1714 "PERIODIC_EFIELD| Intensity [a.u.]:", &
1715 dft_control%period_efield%strength
1716 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
1717 dft_control%period_efield%polarisation)) < epsilon(0.0_dp))
THEN
1718 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
1722 IF (dft_control%do_sccs)
THEN
1723 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
1724 "SCCS| Self-consistent continuum solvation model"
1725 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1726 "SCCS| Relative permittivity of the solvent (medium)", &
1727 dft_control%sccs_control%epsilon_solvent, &
1728 "SCCS| Absolute permittivity [a.u.]", &
1729 dft_control%sccs_control%epsilon_solvent/
fourpi
1730 SELECT CASE (dft_control%sccs_control%method_id)
1732 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
1733 "SCCS| Dielectric function proposed by Andreussi et al.", &
1734 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
1735 "SCCS| rho_min", dft_control%sccs_control%rho_min
1737 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
1738 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
1739 "SCCS| beta", dft_control%sccs_control%beta, &
1740 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
1742 cpabort(
"Invalid SCCS model specified. Please, check your input!")
1744 SELECT CASE (dft_control%sccs_control%derivative_method)
1746 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
1747 "SCCS| Numerical derivative calculation", &
1750 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
1751 "SCCS| Numerical derivative calculation", &
1752 adjustr(
"3-point stencil central differences")
1754 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
1755 "SCCS| Numerical derivative calculation", &
1756 adjustr(
"5-point stencil central differences")
1758 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
1759 "SCCS| Numerical derivative calculation", &
1760 adjustr(
"7-point stencil central differences")
1762 CALL cp_abort(__location__, &
1763 "Invalid derivative method specified for SCCS model. "// &
1764 "Please, check your input!")
1766 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1767 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
1769 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1770 "SCCS| Dispersion parameter beta [GPa]", &
1772 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1773 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
1775 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1776 "SCCS| Mixing parameter applied during the iteration cycle", &
1777 dft_control%sccs_control%mixing
1778 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1779 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
1780 dft_control%sccs_control%eps_sccs
1781 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
1782 "SCCS| Maximum number of iteration steps", &
1783 dft_control%sccs_control%max_iter
1784 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1785 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
1786 dft_control%sccs_control%eps_scf
1787 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
1788 "SCCS| Numerical increment for the cavity surface calculation", &
1789 dft_control%sccs_control%delta_rho
1792 WRITE (unit=output_unit, fmt=
"(A)")
""
1797 "PRINT%DFT_CONTROL_PARAMETERS")
1799 CALL timestop(handle)
1809 TYPE(admm_control_type),
POINTER :: admm_control
1810 TYPE(section_vals_type),
POINTER :: dft_section
1813 TYPE(cp_logger_type),
POINTER :: logger
1819 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1821 IF (iounit > 0)
THEN
1823 SELECT CASE (admm_control%admm_type)
1825 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
1827 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
1829 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
1831 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
1833 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
1835 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
1837 cpabort(
"admm_type")
1840 SELECT CASE (admm_control%purification_method)
1842 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
1844 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
1846 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
1848 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
1850 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
1852 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
1854 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
1856 cpabort(
"admm_purification_method")
1859 SELECT CASE (admm_control%method)
1861 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
1863 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
1865 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
1867 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
1869 cpabort(
"admm method")
1872 SELECT CASE (admm_control%scaling_model)
1875 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
1877 cpabort(
"admm scaling_model")
1880 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
1882 SELECT CASE (admm_control%aux_exch_func)
1884 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
1886 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
1888 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
1890 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
1892 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
1894 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
1896 cpabort(
"admm aux_exch_func")
1899 WRITE (unit=iounit, fmt=
"(A)")
""
1904 "PRINT%DFT_CONTROL_PARAMETERS")
1912 SUBROUTINE write_xtb_control(xtb_control, dft_section)
1913 TYPE(xtb_control_type),
POINTER :: xtb_control
1914 TYPE(section_vals_type),
POINTER :: dft_section
1916 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
1918 INTEGER :: handle, output_unit
1919 TYPE(cp_logger_type),
POINTER :: logger
1921 CALL timeset(routinen, handle)
1926 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1928 IF (output_unit > 0)
THEN
1930 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
1931 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
1932 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
1933 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
1934 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
1935 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
1936 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
1937 "xTB| Halogen interaction potential", xtb_control%xb_interaction
1938 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
1939 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
1940 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
1941 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
1942 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
1943 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
1944 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
1945 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
1946 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
1947 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
1948 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
1949 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
1950 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
1951 "xTB| Repulsion potential exponent", xtb_control%kf
1952 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
1953 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
1954 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
1955 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
1956 "xTB| Electronegativity scaling", xtb_control%ken
1957 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
1958 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
1959 WRITE (unit=output_unit, fmt=
"(/)")
1964 "PRINT%DFT_CONTROL_PARAMETERS")
1966 CALL timestop(handle)
1968 END SUBROUTINE write_xtb_control
1976 TYPE(qs_control_type),
INTENT(IN) :: qs_control
1977 TYPE(section_vals_type),
POINTER :: dft_section
1979 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
1981 CHARACTER(len=20) :: method, quadrature
1982 INTEGER :: handle, i, igrid_level, ngrid_level, &
1984 TYPE(cp_logger_type),
POINTER :: logger
1985 TYPE(ddapc_restraint_type),
POINTER :: ddapc_restraint_control
1986 TYPE(enumeration_type),
POINTER :: enum
1987 TYPE(keyword_type),
POINTER :: keyword
1988 TYPE(section_type),
POINTER :: qs_section
1989 TYPE(section_vals_type),
POINTER :: print_section_vals, qs_section_vals
1991 IF (qs_control%semi_empirical)
RETURN
1992 IF (qs_control%dftb)
RETURN
1993 IF (qs_control%xtb)
RETURN
1994 CALL timeset(routinen, handle)
1995 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2001 NULLIFY (enum, keyword)
2004 method =
enum_i2c(enum, qs_control%method_id)
2006 NULLIFY (enum, keyword)
2009 quadrature =
enum_i2c(enum, qs_control%gapw_control%quadrature)
2012 "DFT_CONTROL_PARAMETERS", extension=
".Log")
2013 IF (output_unit > 0)
THEN
2014 ngrid_level =
SIZE(qs_control%e_cutoff)
2015 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
2016 "QS| Method:", adjustr(method)
2017 IF (qs_control%pw_grid_opt%spherical)
THEN
2018 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
2019 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
2020 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
2021 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2022 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
2024 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2025 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
2027 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2028 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
2029 IF (ngrid_level == 1)
THEN
2030 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2031 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2033 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2034 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2035 IF (qs_control%commensurate_mgrids) &
2036 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
2037 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2038 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2039 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
2040 (
"QS| ", igrid_level,
") grid level", &
2041 qs_control%e_cutoff(igrid_level), &
2042 igrid_level=2,
SIZE(qs_control%e_cutoff))
2044 IF (qs_control%pao)
THEN
2045 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
2047 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2048 "QS| Grid level progression factor:", qs_control%progression_factor
2049 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2050 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2051 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2052 "QS| Interaction thresholds: eps_pgf_orb:", &
2053 qs_control%eps_pgf_orb, &
2054 "QS| eps_filter_matrix:", &
2055 qs_control%eps_filter_matrix, &
2056 "QS| eps_core_charge:", &
2057 qs_control%eps_core_charge, &
2058 "QS| eps_rho_gspace:", &
2059 qs_control%eps_rho_gspace, &
2060 "QS| eps_rho_rspace:", &
2061 qs_control%eps_rho_rspace, &
2062 "QS| eps_gvg_rspace:", &
2063 qs_control%eps_gvg_rspace, &
2065 qs_control%eps_ppl, &
2068 IF (qs_control%gapw)
THEN
2069 SELECT CASE (qs_control%gapw_control%basis_1c)
2071 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2072 "QS| GAPW| One center basis from orbital basis primitives"
2074 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2075 "QS| GAPW| One center basis extended with primitives (small:s)"
2077 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2078 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2080 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2081 "QS| GAPW| One center basis extended with primitives (large:spd)"
2083 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2084 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2086 cpabort(
"basis_1c incorrect")
2088 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2089 "QS| GAPW| eps_fit:", &
2090 qs_control%gapw_control%eps_fit, &
2091 "QS| GAPW| eps_iso:", &
2092 qs_control%gapw_control%eps_iso, &
2093 "QS| GAPW| eps_svd:", &
2094 qs_control%gapw_control%eps_svd, &
2095 "QS| GAPW| eps_cpc:", &
2096 qs_control%gapw_control%eps_cpc
2097 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2098 "QS| GAPW| atom-r-grid: quadrature:", &
2100 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2101 "QS| GAPW| atom-s-grid: max l :", &
2102 qs_control%gapw_control%lmax_sphere, &
2103 "QS| GAPW| max_l_rho0 :", &
2104 qs_control%gapw_control%lmax_rho0
2105 IF (qs_control%gapw_control%non_paw_atoms)
THEN
2106 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2107 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2109 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
2110 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2111 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2114 IF (qs_control%gapw_xc)
THEN
2115 SELECT CASE (qs_control%gapw_control%basis_1c)
2117 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2118 "QS| GAPW_XC| One center basis from orbital basis primitives"
2120 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2121 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2123 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2124 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2126 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2127 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2129 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2130 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2132 cpabort(
"basis_1c incorrect")
2134 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2135 "QS| GAPW_XC| eps_fit:", &
2136 qs_control%gapw_control%eps_fit, &
2137 "QS| GAPW_XC| eps_iso:", &
2138 qs_control%gapw_control%eps_iso, &
2139 "QS| GAPW_XC| eps_svd:", &
2140 qs_control%gapw_control%eps_svd
2141 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
2142 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2143 enum_i2c(enum, qs_control%gapw_control%quadrature)
2144 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2145 "QS| GAPW_XC| atom-s-grid: max l :", &
2146 qs_control%gapw_control%lmax_sphere
2148 IF (qs_control%mulliken_restraint)
THEN
2149 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2150 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2151 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2152 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2153 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2154 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2155 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
2157 IF (qs_control%ddapc_restraint)
THEN
2158 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2159 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2160 IF (
SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2161 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
2162 "QS| parameters for DDAPC restraint number", i
2163 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2164 "QS| ddapc restraint target", ddapc_restraint_control%target
2165 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2166 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2167 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2168 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2169 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
2170 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
2171 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
2172 SELECT CASE (ddapc_restraint_control%functional_form)
2174 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2175 "QS| ddapc restraint functional form :",
"RESTRAINT"
2177 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2178 "QS| ddapc restraint functional form :",
"CONSTRAINT"
2180 cpabort(
"Unknown ddapc restraint")
2184 IF (qs_control%s2_restraint)
THEN
2185 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2186 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2187 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2188 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2189 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2191 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2192 "QS| s2 restraint functional form :",
"RESTRAINT"
2193 cpabort(
"Not yet implemented")
2195 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2196 "QS| s2 restraint functional form :",
"CONSTRAINT"
2198 cpabort(
"Unknown ddapc restraint")
2203 "DFT_CONTROL_PARAMETERS")
2205 CALL timestop(handle)
2222 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
2223 TYPE(section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
2225 INTEGER :: i, j, jj, k, n_rep
2226 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2227 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
2228 TYPE(ddapc_restraint_type),
POINTER :: ddapc_restraint_control
2229 TYPE(section_vals_type),
POINTER :: ddapc_section
2231 IF (
PRESENT(ddapc_restraint_section))
THEN
2232 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
2233 IF (
SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2234 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
2236 ddapc_section => ddapc_restraint_section
2237 ALLOCATE (qs_control%ddapc_restraint_control(1))
2241 IF (
PRESENT(qs_section))
THEN
2242 NULLIFY (ddapc_section)
2247 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2250 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2253 r_val=ddapc_restraint_control%strength)
2255 r_val=ddapc_restraint_control%target)
2257 i_val=ddapc_restraint_control%functional_form)
2261 i_val=ddapc_restraint_control%density_type)
2266 i_rep_val=k, i_vals=tmplist)
2267 DO j = 1,
SIZE(tmplist)
2271 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
2272 ddapc_restraint_control%natoms = jj
2273 IF (
ASSOCIATED(ddapc_restraint_control%atoms)) &
2274 DEALLOCATE (ddapc_restraint_control%atoms)
2275 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2279 i_rep_val=k, i_vals=tmplist)
2280 DO j = 1,
SIZE(tmplist)
2282 ddapc_restraint_control%atoms(jj) = tmplist(j)
2286 IF (
ASSOCIATED(ddapc_restraint_control%coeff)) &
2287 DEALLOCATE (ddapc_restraint_control%coeff)
2288 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2289 ddapc_restraint_control%coeff = 1.0_dp
2296 i_rep_val=k, r_vals=rtmplist)
2297 DO j = 1,
SIZE(rtmplist)
2299 IF (jj > ddapc_restraint_control%natoms) &
2300 cpabort(
"Need the same number of coeff as there are atoms ")
2301 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2304 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2305 cpabort(
"Need no or the same number of coeff as there are atoms.")
2308 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2309 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2312 IF (k == 2)
CALL cp_abort(__location__, &
2313 "Only a single constraint possible yet, try to use restraints instead ")
2322 SUBROUTINE read_efield_sections(dft_control, efield_section)
2323 TYPE(dft_control_type),
POINTER :: dft_control
2324 TYPE(section_vals_type),
POINTER :: efield_section
2326 CHARACTER(len=default_path_length) :: file_name
2327 INTEGER :: i, io, j, n, unit_nr
2328 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tmp_vals
2329 TYPE(efield_type),
POINTER :: efield
2330 TYPE(section_vals_type),
POINTER :: tmp_section
2332 DO i = 1,
SIZE(dft_control%efield_fields)
2333 NULLIFY (dft_control%efield_fields(i)%efield)
2334 ALLOCATE (dft_control%efield_fields(i)%efield)
2335 efield => dft_control%efield_fields(i)%efield
2336 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2338 r_val=efield%strength)
2342 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
2343 efield%polarisation = tmp_vals
2345 r_val=efield%phase_offset)
2347 i_val=efield%envelop_id)
2349 r_val=efield%wavelength)
2352 efield%vec_pot_initial = tmp_vals
2355 ALLOCATE (efield%envelop_i_vars(2))
2358 i_val=efield%envelop_i_vars(1))
2360 i_val=efield%envelop_i_vars(2))
2362 ALLOCATE (efield%envelop_r_vars(2))
2365 r_val=efield%envelop_r_vars(1))
2367 r_val=efield%envelop_r_vars(2))
2368 ELSE IF (efield%envelop_id ==
ramp_env)
THEN
2369 ALLOCATE (efield%envelop_i_vars(4))
2372 i_val=efield%envelop_i_vars(1))
2374 i_val=efield%envelop_i_vars(2))
2376 i_val=efield%envelop_i_vars(3))
2378 i_val=efield%envelop_i_vars(4))
2379 ELSE IF (efield%envelop_id ==
custom_env)
THEN
2382 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
2386 READ (unit_nr, *, iostat=io)
2391 ALLOCATE (efield%envelop_r_vars(n + 1))
2396 READ (unit_nr, *) efield%envelop_r_vars(j)
2397 efield%envelop_r_vars(j) =
cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
2402 END SUBROUTINE read_efield_sections
2410 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2412 TYPE(dft_control_type),
INTENT(INOUT) :: dft_control
2413 TYPE(section_vals_type),
POINTER :: rtp_section
2415 INTEGER,
DIMENSION(:),
POINTER :: tmp
2416 LOGICAL :: is_present
2417 TYPE(section_vals_type),
POINTER :: proj_mo_section
2419 ALLOCATE (dft_control%rtp_control)
2421 i_val=dft_control%rtp_control%max_iter)
2423 i_val=dft_control%rtp_control%mat_exp)
2425 i_val=dft_control%rtp_control%aspc_order)
2427 r_val=dft_control%rtp_control%eps_exp)
2429 i_val=dft_control%rtp_control%propagator)
2431 r_val=dft_control%rtp_control%eps_ener)
2433 i_val=dft_control%rtp_control%initial_wfn)
2435 l_val=dft_control%rtp_control%hfx_redistribute)
2437 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2439 l_val=dft_control%rtp_control%apply_delta_pulse)
2441 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2443 l_val=dft_control%rtp_control%velocity_gauge)
2445 l_val=dft_control%rtp_control%nl_gauge_transform)
2447 l_val=dft_control%rtp_control%periodic)
2449 l_val=dft_control%rtp_control%linear_scaling)
2451 i_val=dft_control%rtp_control%mcweeny_max_iter)
2453 i_val=dft_control%rtp_control%acc_ref)
2455 r_val=dft_control%rtp_control%mcweeny_eps)
2457 r_val=dft_control%rtp_control%delta_pulse_scale)
2460 dft_control%rtp_control%delta_pulse_direction = tmp
2462 i_val=dft_control%rtp_control%sc_check_start)
2465 IF (is_present)
THEN
2466 IF (dft_control%rtp_control%linear_scaling) &
2467 CALL cp_abort(__location__, &
2468 "You have defined a time dependent projection of mos, but "// &
2469 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2470 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2471 "define any PRINT%PROJECTION_MO section")
2472 dft_control%rtp_control%is_proj_mo = .true.
2474 dft_control%rtp_control%is_proj_mo = .false.
2477 END SUBROUTINE read_rtp_section
2484 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2485 TYPE(admm_control_type),
POINTER :: admm_control
2486 TYPE(section_vals_type),
POINTER :: dft_section
2488 INTEGER :: irep, list_size, n_rep
2489 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2496 ALLOCATE (admm_control%blocks(n_rep))
2500 i_rep_val=irep, i_vals=tmplist)
2501 list_size =
SIZE(tmplist)
2502 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2503 admm_control%blocks(irep)%list(:) = tmplist(:)
2506 END SUBROUTINE read_admm_block_list
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 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 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
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)
...
subroutine, public tddfpt_control_create(tddfpt_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_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 read_tddfpt_control(t_control, dft_section)
...
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,...
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)
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
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.
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)
...