(git:b76ce4e)
Loading...
Searching...
No Matches
qs_scf_output.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
9 USE admm_types, ONLY: admm_type
14 USE cp_dbcsr_api, ONLY: dbcsr_p_type,&
24 USE cp_output_handling, ONLY: cp_p_file,&
29 USE input_constants, ONLY: &
42 USE kahan_sum, ONLY: accurate_sum
43 USE kinds, ONLY: default_string_length,&
44 dp
45 USE kpoint_types, ONLY: kpoint_type
46 USE machine, ONLY: m_flush
49 USE physcon, ONLY: evolt,&
52 USE ps_implicit_types, ONLY: mixed_bc,&
56 USE pw_env_types, ONLY: pw_env_type
71 USE qs_mo_types, ONLY: allocate_mo_set,&
77 USE qs_rho_types, ONLY: qs_rho_get,&
80 USE qs_scf_types, ONLY: ot_method_nr,&
84#include "./base/base_uses.f90"
85
86 IMPLICIT NONE
87
88 PRIVATE
89
90 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_scf_output'
91
92 PUBLIC :: qs_scf_loop_info, &
101
102CONTAINS
103
104! **************************************************************************************************
105!> \brief writes a summary of information after scf
106!> \param output_unit ...
107!> \param qs_env ...
108! **************************************************************************************************
109 SUBROUTINE qs_scf_print_summary(output_unit, qs_env)
110 INTEGER, INTENT(IN) :: output_unit
111 TYPE(qs_environment_type), POINTER :: qs_env
112
113 INTEGER :: nelectron_total
114 LOGICAL :: gapw, gapw_xc, qmmm
115 TYPE(dft_control_type), POINTER :: dft_control
116 TYPE(qs_charges_type), POINTER :: qs_charges
117 TYPE(qs_energy_type), POINTER :: energy
118 TYPE(qs_rho_type), POINTER :: rho
119 TYPE(qs_scf_env_type), POINTER :: scf_env
120
121 NULLIFY (rho, energy, dft_control, scf_env, qs_charges)
122 CALL get_qs_env(qs_env=qs_env, rho=rho, energy=energy, dft_control=dft_control, &
123 scf_env=scf_env, qs_charges=qs_charges)
124
125 gapw = dft_control%qs_control%gapw
126 gapw_xc = dft_control%qs_control%gapw_xc
127 qmmm = qs_env%qmmm
128 nelectron_total = scf_env%nelectron
129
130 CALL qs_scf_print_scf_summary(output_unit, rho, qs_charges, energy, nelectron_total, &
131 dft_control, qmmm, qs_env, gapw, gapw_xc)
132
133 END SUBROUTINE qs_scf_print_summary
134
135! **************************************************************************************************
136!> \brief writes basic information at the beginning of an scf run
137!> \param output_unit ...
138!> \param mos ...
139!> \param dft_control ...
140!> \param ndep ...
141! **************************************************************************************************
142 SUBROUTINE qs_scf_initial_info(output_unit, mos, dft_control, ndep)
143 INTEGER :: output_unit
144 TYPE(mo_set_type), DIMENSION(:), INTENT(IN) :: mos
145 TYPE(dft_control_type), POINTER :: dft_control
146 INTEGER, INTENT(IN) :: ndep
147
148 CHARACTER(LEN=*), PARAMETER :: routinen = 'qs_scf_initial_info'
149
150 INTEGER :: handle, homo, ispin, nao, &
151 nelectron_spin, nmo
152
153 CALL timeset(routinen, handle)
154
155 IF (output_unit > 0) THEN
156 DO ispin = 1, dft_control%nspins
157 CALL get_mo_set(mo_set=mos(ispin), &
158 homo=homo, &
159 nelectron=nelectron_spin, &
160 nao=nao, &
161 nmo=nmo)
162 IF (dft_control%nspins > 1) THEN
163 WRITE (unit=output_unit, fmt="(/,T2,A,I2)") "Spin", ispin
164 END IF
165 WRITE (unit=output_unit, fmt="(/,(T2,A,T71,I10))") &
166 "Number of electrons:", nelectron_spin, &
167 "Number of occupied orbitals:", homo, &
168 "Number of molecular orbitals:", nmo
169 END DO
170 WRITE (unit=output_unit, fmt="(/,(T2,A,T71,I10))") &
171 "Number of orbital functions:", nao, &
172 "Number of independent orbital functions:", nao - ndep
173 END IF
174
175 CALL timestop(handle)
176
177 END SUBROUTINE qs_scf_initial_info
178
179! **************************************************************************************************
180!> \brief Write the MO eigenvector, eigenvalues, and occupation numbers to the output unit
181!> \param qs_env ...
182!> \param scf_env ...
183!> \param final_mos ...
184!> \par History
185!> - Revise MO printout to enable eigenvalues with OT (05.05.2021, MK)
186! **************************************************************************************************
187 SUBROUTINE qs_scf_write_mos(qs_env, scf_env, final_mos)
188 TYPE(qs_environment_type), POINTER :: qs_env
189 TYPE(qs_scf_env_type), POINTER :: scf_env
190 LOGICAL, INTENT(IN) :: final_mos
191
192 CHARACTER(LEN=*), PARAMETER :: routinen = 'qs_scf_write_mos'
193
194 CHARACTER(LEN=2) :: solver_method
195 CHARACTER(LEN=3*default_string_length) :: message
196 CHARACTER(LEN=5) :: spin
197 CHARACTER(LEN=default_string_length), &
198 DIMENSION(:), POINTER :: tmpstringlist
199 INTEGER :: handle, homo, ikp, ispin, iw, kpoint, &
200 nao, nelectron, nkp, nmo, nspin, numo
201 INTEGER, DIMENSION(2) :: nmos_occ
202 INTEGER, DIMENSION(:), POINTER :: mo_index_range
203 LOGICAL :: do_kpoints, do_printout, print_eigvals, &
204 print_eigvecs, print_mo_info, &
205 print_occup, print_occup_stats
206 REAL(kind=dp) :: flexible_electron_count, maxocc, n_el_f, &
207 occup_stats_occ_threshold
208 REAL(kind=dp), DIMENSION(:), POINTER :: mo_eigenvalues, umo_eigenvalues
209 TYPE(admm_type), POINTER :: admm_env
210 TYPE(cp_blacs_env_type), POINTER :: blacs_env
211 TYPE(cp_fm_struct_type), POINTER :: fm_struct_tmp
212 TYPE(cp_fm_type), POINTER :: mo_coeff, umo_coeff
213 TYPE(cp_logger_type), POINTER :: logger
214 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: ks, s
215 TYPE(dbcsr_type), POINTER :: matrix_ks, matrix_s, mo_coeff_deriv
216 TYPE(dft_control_type), POINTER :: dft_control
217 TYPE(kpoint_type), POINTER :: kpoints
218 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
219 TYPE(mo_set_type), POINTER :: mo_set, umo_set
220 TYPE(mp_para_env_type), POINTER :: para_env
221 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
222 TYPE(preconditioner_type), POINTER :: local_preconditioner
223 TYPE(qs_environment_type), POINTER :: cart_overlap_qs_env
224 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
225 TYPE(scf_control_type), POINTER :: scf_control
226 TYPE(section_vals_type), POINTER :: dft_section, input
227
228 CALL timeset(routinen, handle)
229
230 cpassert(ASSOCIATED(qs_env))
231
232 ! Retrieve the required information for the requested print output
233 CALL get_qs_env(qs_env, &
234 blacs_env=blacs_env, &
235 dft_control=dft_control, &
236 do_kpoints=do_kpoints, &
237 input=input, &
238 qs_kind_set=qs_kind_set, &
239 para_env=para_env, &
240 particle_set=particle_set, &
241 scf_control=scf_control)
242
243 ! Quick return, if no printout of MO information is requested
244 dft_section => section_vals_get_subs_vals(input, "DFT")
245 CALL section_vals_val_get(dft_section, "PRINT%MO%EIGENVALUES", l_val=print_eigvals)
246 CALL section_vals_val_get(dft_section, "PRINT%MO%EIGENVECTORS", l_val=print_eigvecs)
247 CALL section_vals_val_get(dft_section, "PRINT%MO%OCCUPATION_NUMBERS", l_val=print_occup)
248 CALL section_vals_val_get(dft_section, "PRINT%MO%OCCUPATION_NUMBERS_STATS", c_vals=tmpstringlist)
249
250 print_occup_stats = .false.
251 occup_stats_occ_threshold = 1e-6_dp
252 IF (SIZE(tmpstringlist) > 0) THEN ! the lone_keyword_c_vals doesn't work as advertised, handle it manually
253 print_occup_stats = .true.
254 IF (len_trim(tmpstringlist(1)) > 0) &
255 READ (tmpstringlist(1), *) print_occup_stats
256 END IF
257 IF (SIZE(tmpstringlist) > 1) &
258 READ (tmpstringlist(2), *) occup_stats_occ_threshold
259
260 logger => cp_get_default_logger()
261 print_mo_info = (cp_print_key_should_output(logger%iter_info, dft_section, "PRINT%MO") /= 0)
262
263 IF ((.NOT. print_mo_info) .OR. (.NOT. (print_eigvals .OR. print_eigvecs .OR. print_occup .OR. print_occup_stats))) THEN
264 CALL timestop(handle)
265 RETURN
266 END IF
267
268 NULLIFY (fm_struct_tmp)
269 NULLIFY (mo_coeff)
270 NULLIFY (mo_coeff_deriv)
271 NULLIFY (mo_eigenvalues)
272 NULLIFY (mo_set)
273 NULLIFY (umo_coeff)
274 NULLIFY (umo_eigenvalues)
275 NULLIFY (umo_set)
276
277 do_printout = .true.
278 nspin = dft_control%nspins
279 nmos_occ = 0
280
281 ! Check, if we have k points
282 IF (do_kpoints) THEN
283 CALL get_qs_env(qs_env, kpoints=kpoints)
284 nkp = SIZE(kpoints%kp_env)
285 ELSE
286 CALL get_qs_env(qs_env, matrix_ks=ks, matrix_s=s)
287 cpassert(ASSOCIATED(ks))
288 cpassert(ASSOCIATED(s))
289 nkp = 1
290 END IF
291
292 kp_loop: DO ikp = 1, nkp
293
294 IF (do_kpoints) THEN
295 mos => kpoints%kp_env(ikp)%kpoint_env%mos(1, :)
296 kpoint = ikp
297 ELSE
298 CALL get_qs_env(qs_env, matrix_ks=ks, mos=mos)
299 kpoint = 0 ! Gamma point only
300 END IF
301 cpassert(ASSOCIATED(mos))
302
303 ! Prepare MO information for printout
304 DO ispin = 1, nspin
305
306 ! Calculate MO eigenvalues and eigenvector when OT is used
307 IF (scf_env%method == ot_method_nr) THEN
308
309 solver_method = "OT"
310
311 IF (do_kpoints) THEN
312 cpabort("The OT method is not implemented for k points")
313 END IF
314
315 IF (final_mos) THEN
316
317 matrix_ks => ks(ispin)%matrix
318 matrix_s => s(1)%matrix
319
320 ! With ADMM, we have to modify the Kohn-Sham matrix
321 IF (dft_control%do_admm) THEN
322 CALL get_qs_env(qs_env, admm_env=admm_env)
323 CALL admm_correct_for_eigenvalues(ispin, admm_env, matrix_ks)
324 END IF
325
326 mo_set => mos(ispin)
327 CALL get_mo_set(mo_set=mo_set, &
328 mo_coeff=mo_coeff, &
329 eigenvalues=mo_eigenvalues, &
330 homo=homo, &
331 maxocc=maxocc, &
332 nelectron=nelectron, &
333 n_el_f=n_el_f, &
334 nao=nao, &
335 nmo=nmo, &
336 flexible_electron_count=flexible_electron_count)
337
338 IF (ASSOCIATED(qs_env%mo_derivs)) THEN
339 mo_coeff_deriv => qs_env%mo_derivs(ispin)%matrix
340 ELSE
341 mo_coeff_deriv => null()
342 END IF
343
344 ! Update the eigenvalues of the occupied orbitals
345 CALL calculate_subspace_eigenvalues(orbitals=mo_coeff, &
346 ks_matrix=matrix_ks, &
347 evals_arg=mo_eigenvalues, &
348 co_rotate_dbcsr=mo_coeff_deriv)
349 CALL set_mo_occupation(mo_set=mo_set)
350
351 ! Retrieve the index of the last MO for which a printout is requested
352 mo_index_range => section_get_ivals(dft_section, "PRINT%MO%MO_INDEX_RANGE")
353 cpassert(ASSOCIATED(mo_index_range))
354 IF (mo_index_range(2) < 0) THEN
355 numo = nao - homo
356 ELSE
357 numo = min(mo_index_range(2) - homo, nao - homo)
358 END IF
359
360 ! Calculate the unoccupied MO set (umo_set) with OT if needed
361 IF (numo > 0) THEN
362
363 ! Create temporary virtual MO set for printout
364 CALL cp_fm_struct_create(fm_struct_tmp, &
365 context=blacs_env, &
366 para_env=para_env, &
367 nrow_global=nao, &
368 ncol_global=numo)
369 ALLOCATE (umo_set)
370 CALL allocate_mo_set(mo_set=umo_set, &
371 nao=nao, &
372 nmo=numo, &
373 nelectron=0, &
374 n_el_f=n_el_f, &
375 maxocc=maxocc, &
376 flexible_electron_count=flexible_electron_count)
377 CALL init_mo_set(mo_set=umo_set, &
378 fm_struct=fm_struct_tmp, &
379 name="Temporary MO set (unoccupied MOs only) for printout")
380 CALL cp_fm_struct_release(fm_struct_tmp)
381 CALL get_mo_set(mo_set=umo_set, &
382 mo_coeff=umo_coeff, &
383 eigenvalues=umo_eigenvalues)
384
385 ! Prepare printout of the additional unoccupied MOs when OT is being employed
386 CALL cp_fm_init_random(umo_coeff)
387
388 ! The FULL_ALL preconditioner makes not much sense for the unoccupied orbitals
389 NULLIFY (local_preconditioner)
390 IF (ASSOCIATED(scf_env%ot_preconditioner)) THEN
391 local_preconditioner => scf_env%ot_preconditioner(1)%preconditioner
392 IF (local_preconditioner%in_use == ot_precond_full_all) THEN
393 NULLIFY (local_preconditioner)
394 END IF
395 END IF
396
397 ! Calculate the MO information for the request MO index range
398 CALL ot_eigensolver(matrix_h=matrix_ks, &
399 matrix_s=matrix_s, &
400 matrix_c_fm=umo_coeff, &
401 matrix_orthogonal_space_fm=mo_coeff, &
402 eps_gradient=scf_control%eps_lumos, &
403 preconditioner=local_preconditioner, &
404 iter_max=scf_control%max_iter_lumos, &
405 size_ortho_space=nmo)
406
407 CALL calculate_subspace_eigenvalues(orbitals=umo_coeff, &
408 ks_matrix=matrix_ks, &
409 evals_arg=umo_eigenvalues)
410 CALL set_mo_occupation(mo_set=umo_set)
411
412 END IF ! numo > 0
413
414 ! With ADMM, we have to undo the modification of the Kohn-Sham matrix
415 IF (dft_control%do_admm) THEN
416 CALL admm_uncorrect_for_eigenvalues(ispin, admm_env, matrix_ks)
417 END IF
418
419 ELSE
420
421 message = "The MO information is only calculated after SCF convergence "// &
422 "is achieved when the orbital transformation (OT) method is used"
423 cpwarn(trim(message))
424 do_printout = .false.
425 EXIT kp_loop
426
427 END IF ! final MOs
428
429 ELSE
430
431 solver_method = "TD"
432 mo_set => mos(ispin)
433 NULLIFY (umo_set)
434
435 END IF ! OT is used
436
437 ! Print MO information
438 NULLIFY (cart_overlap_qs_env)
439 IF ((ikp == 1) .AND. (ispin == 1)) cart_overlap_qs_env => qs_env
440 IF (nspin > 1) THEN
441 SELECT CASE (ispin)
442 CASE (1)
443 spin = "ALPHA"
444 CASE (2)
445 spin = "BETA"
446 CASE DEFAULT
447 cpabort("Invalid spin")
448 END SELECT
449 IF (ASSOCIATED(umo_set)) THEN
450 CALL write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, 4, kpoint, &
451 final_mos=final_mos, spin=trim(spin), solver_method=solver_method, &
452 umo_set=umo_set, qs_env=cart_overlap_qs_env)
453 ELSE
454 CALL write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, 4, kpoint, &
455 final_mos=final_mos, spin=trim(spin), solver_method=solver_method, &
456 qs_env=cart_overlap_qs_env)
457 END IF
458 ELSE
459 IF (ASSOCIATED(umo_set)) THEN
460 CALL write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, 4, kpoint, &
461 final_mos=final_mos, solver_method=solver_method, &
462 umo_set=umo_set, qs_env=cart_overlap_qs_env)
463 ELSE
464 CALL write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, 4, kpoint, &
465 final_mos=final_mos, solver_method=solver_method, &
466 qs_env=cart_overlap_qs_env)
467 END IF
468 END IF
469
470 nmos_occ(ispin) = max(nmos_occ(ispin), count(mo_set%occupation_numbers > occup_stats_occ_threshold))
471
472 ! Deallocate temporary objects needed for OT
473 IF (scf_env%method == ot_method_nr) THEN
474 IF (ASSOCIATED(umo_set)) THEN
475 CALL deallocate_mo_set(umo_set)
476 DEALLOCATE (umo_set)
477 END IF
478 NULLIFY (matrix_ks)
479 NULLIFY (matrix_s)
480 END IF
481 NULLIFY (mo_set)
482
483 END DO ! ispin
484
485 END DO kp_loop
486
487 IF (do_printout .AND. print_mo_info .AND. print_occup_stats) THEN
488 iw = cp_print_key_unit_nr(logger, dft_section, "PRINT%MO", &
489 ignore_should_output=print_mo_info, &
490 extension=".MOLog")
491 IF (iw > 0) THEN
492 IF (SIZE(mos) > 1) THEN
493 WRITE (unit=iw, fmt="(A,I4)") " MO| Total occupied (ALPHA):", nmos_occ(1)
494 WRITE (unit=iw, fmt="(A,I4)") " MO| Total occupied (BETA): ", nmos_occ(2)
495 ELSE
496 WRITE (unit=iw, fmt="(A,I4)") " MO| Total occupied: ", nmos_occ(1)
497 END IF
498 WRITE (unit=iw, fmt="(A)") ""
499 END IF
500 CALL cp_print_key_finished_output(iw, logger, dft_section, "PRINT%MO", &
501 ignore_should_output=print_mo_info)
502 END IF
503
504 CALL timestop(handle)
505
506 END SUBROUTINE qs_scf_write_mos
507
508! **************************************************************************************************
509!> \brief writes basic information obtained in a scf outer loop step
510!> \param output_unit ...
511!> \param scf_control ...
512!> \param scf_env ...
513!> \param energy ...
514!> \param total_steps ...
515!> \param should_stop ...
516!> \param outer_loop_converged ...
517! **************************************************************************************************
518 SUBROUTINE qs_scf_outer_loop_info(output_unit, scf_control, scf_env, &
519 energy, total_steps, should_stop, outer_loop_converged)
520 INTEGER :: output_unit
521 TYPE(scf_control_type), POINTER :: scf_control
522 TYPE(qs_scf_env_type), POINTER :: scf_env
523 TYPE(qs_energy_type), POINTER :: energy
524 INTEGER :: total_steps
525 LOGICAL, INTENT(IN) :: should_stop, outer_loop_converged
526
527 REAL(kind=dp) :: outer_loop_eps
528
529 outer_loop_eps = sqrt(maxval(scf_env%outer_scf%gradient(:, scf_env%outer_scf%iter_count)**2))
530 IF (output_unit > 0) WRITE (output_unit, '(/,T3,A,I4,A,E10.2,A,F22.10)') &
531 "outer SCF iter = ", scf_env%outer_scf%iter_count, &
532 " RMS gradient = ", outer_loop_eps, " energy =", energy%total
533
534 IF (outer_loop_converged) THEN
535 IF (output_unit > 0) WRITE (output_unit, '(T3,A,I4,A,I4,A,/)') &
536 "outer SCF loop converged in", scf_env%outer_scf%iter_count, &
537 " iterations or ", total_steps, " steps"
538 ELSE IF (scf_env%outer_scf%iter_count > scf_control%outer_scf%max_scf &
539 .OR. should_stop) THEN
540 IF (output_unit > 0) WRITE (output_unit, '(T3,A,I4,A,I4,A,/)') &
541 "outer SCF loop FAILED to converge after ", &
542 scf_env%outer_scf%iter_count, " iterations or ", total_steps, " steps"
543 END IF
544
545 END SUBROUTINE qs_scf_outer_loop_info
546
547! **************************************************************************************************
548!> \brief writes basic information obtained in a scf step
549!> \param scf_env ...
550!> \param output_unit ...
551!> \param just_energy ...
552!> \param t1 ...
553!> \param t2 ...
554!> \param energy ...
555! **************************************************************************************************
556 SUBROUTINE qs_scf_loop_info(scf_env, output_unit, just_energy, t1, t2, energy)
557
558 TYPE(qs_scf_env_type), POINTER :: scf_env
559 INTEGER :: output_unit
560 LOGICAL :: just_energy
561 REAL(kind=dp) :: t1, t2
562 TYPE(qs_energy_type), POINTER :: energy
563
564 IF ((output_unit > 0) .AND. scf_env%print_iter_line) THEN
565 IF (just_energy) THEN
566 WRITE (unit=output_unit, &
567 fmt="(T2,A,1X,A,T20,E8.2,1X,F6.1,16X,F20.10)") &
568 " -", trim(scf_env%iter_method), scf_env%iter_param, t2 - t1, energy%total
569 ELSE
570 IF ((abs(scf_env%iter_delta) < 1.0e-8_dp) .OR. &
571 (abs(scf_env%iter_delta) >= 1.0e5_dp)) THEN
572 WRITE (unit=output_unit, &
573 fmt="(T2,I5,1X,A,T20,E8.2,1X,F6.1,1X,ES14.4,1X,F20.10,1X,ES9.2)") &
574 scf_env%iter_count, trim(scf_env%iter_method), scf_env%iter_param, &
575 t2 - t1, scf_env%iter_delta, energy%total, energy%total - energy%tot_old
576 ELSE
577 WRITE (unit=output_unit, &
578 fmt="(T2,I5,1X,A,T20,E8.2,1X,F6.1,1X,F14.8,1X,F20.10,1X,ES9.2)") &
579 scf_env%iter_count, trim(scf_env%iter_method), scf_env%iter_param, &
580 t2 - t1, scf_env%iter_delta, energy%total, energy%total - energy%tot_old
581 END IF
582 END IF
583 END IF
584
585 END SUBROUTINE qs_scf_loop_info
586
587! **************************************************************************************************
588!> \brief writes rather detailed summary of densities and energies
589!> after the SCF
590!> \param output_unit ...
591!> \param rho ...
592!> \param qs_charges ...
593!> \param energy ...
594!> \param nelectron_total ...
595!> \param dft_control ...
596!> \param qmmm ...
597!> \param qs_env ...
598!> \param gapw ...
599!> \param gapw_xc ...
600!> \par History
601!> 03.2006 created [Joost VandeVondele]
602!> 10.2019 print dipole moment [SGh]
603!> 11.2022 print SCCS results [MK]
604! **************************************************************************************************
605 SUBROUTINE qs_scf_print_scf_summary(output_unit, rho, qs_charges, energy, nelectron_total, &
606 dft_control, qmmm, qs_env, gapw, gapw_xc)
607 INTEGER, INTENT(IN) :: output_unit
608 TYPE(qs_rho_type), POINTER :: rho
609 TYPE(qs_charges_type), POINTER :: qs_charges
610 TYPE(qs_energy_type), POINTER :: energy
611 INTEGER, INTENT(IN) :: nelectron_total
612 TYPE(dft_control_type), POINTER :: dft_control
613 LOGICAL, INTENT(IN) :: qmmm
614 TYPE(qs_environment_type), POINTER :: qs_env
615 LOGICAL, INTENT(IN) :: gapw, gapw_xc
616
617 CHARACTER(LEN=*), PARAMETER :: routinen = 'qs_scf_print_scf_summary'
618
619 INTEGER :: bc, handle, ispin, psolver
620 REAL(kind=dp) :: e_extrapolated, exc1_energy, exc_energy, &
621 implicit_ps_ehartree, tot1_h, tot1_s
622 REAL(kind=dp), DIMENSION(:), POINTER :: tot_rho_r
623 TYPE(pw_env_type), POINTER :: pw_env
624 TYPE(scf_control_type), POINTER :: scf_control
625
626 NULLIFY (tot_rho_r, pw_env)
627 CALL timeset(routinen, handle)
628
629 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, scf_control=scf_control)
630 psolver = pw_env%poisson_env%parameters%solver
631
632 IF (output_unit > 0) THEN
633 CALL qs_rho_get(rho, tot_rho_r=tot_rho_r)
634 IF (.NOT. (dft_control%qs_control%semi_empirical .OR. &
635 dft_control%qs_control%xtb .OR. &
636 dft_control%qs_control%dftb)) THEN
637 WRITE (unit=output_unit, fmt="(/,(T3,A,T41,2F20.10))") &
638 "Electronic density on regular grids: ", &
639 accurate_sum(tot_rho_r), &
640 accurate_sum(tot_rho_r) + nelectron_total, &
641 "Core density on regular grids:", &
642 qs_charges%total_rho_core_rspace, &
643 qs_charges%total_rho_core_rspace + &
644 qs_charges%total_rho1_hard_nuc - &
645 REAL(nelectron_total + dft_control%charge, dp)
646
647 IF (dft_control%correct_surf_dip) THEN
648 WRITE (unit=output_unit, fmt="((T3,A,/,T3,A,T41,F20.10))") &
649 "Total dipole moment perpendicular to ", &
650 "the slab [electrons-Angstroem]: ", &
651 qs_env%surface_dipole_moment
652 END IF
653
654 IF (gapw) THEN
655 tot1_h = qs_charges%total_rho1_hard(1)
656 tot1_s = qs_charges%total_rho1_soft(1)
657 DO ispin = 2, dft_control%nspins
658 tot1_h = tot1_h + qs_charges%total_rho1_hard(ispin)
659 tot1_s = tot1_s + qs_charges%total_rho1_soft(ispin)
660 END DO
661 WRITE (unit=output_unit, fmt="((T3,A,T41,2F20.10))") &
662 "Hard and soft densities (Lebedev):", &
663 tot1_h, tot1_s
664 WRITE (unit=output_unit, fmt="(T3,A,T41,F20.10)") &
665 "Total Rho_soft + Rho1_hard - Rho1_soft (r-space): ", &
666 accurate_sum(tot_rho_r) + tot1_h - tot1_s, &
667 "Total charge density (r-space): ", &
668 accurate_sum(tot_rho_r) + tot1_h - tot1_s &
669 + qs_charges%total_rho_core_rspace &
670 + qs_charges%total_rho1_hard_nuc
671 IF (qs_charges%total_rho1_hard_nuc /= 0.0_dp) THEN
672 WRITE (unit=output_unit, fmt="(T3,A,T41,F20.10)") &
673 "Total CNEO nuc. char. den. (Lebedev): ", &
674 qs_charges%total_rho1_hard_nuc, &
675 "Total CNEO soft char. den. (Lebedev): ", &
676 qs_charges%total_rho1_soft_nuc_lebedev, &
677 "Total CNEO soft char. den. (r-space): ", &
678 qs_charges%total_rho1_soft_nuc_rspace, &
679 "Total soft Rho_e+n+0 (g-space):", &
680 qs_charges%total_rho_gspace
681 ELSE
682 WRITE (unit=output_unit, fmt="(T3,A,T41,F20.10)") &
683 "Total Rho_soft + Rho0_soft (g-space):", &
684 qs_charges%total_rho_gspace
685 END IF
686 ! only add total_rho1_hard_nuc for gapw as cneo requires gapw
687 ELSE
688 WRITE (unit=output_unit, fmt="(T3,A,T41,F20.10)") &
689 "Total charge density on r-space grids: ", &
690 accurate_sum(tot_rho_r) + &
691 qs_charges%total_rho_core_rspace, &
692 "Total charge density g-space grids: ", &
693 qs_charges%total_rho_gspace
694 END IF
695 END IF
696 IF (dft_control%qs_control%semi_empirical) THEN
697 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
698 "Core-core repulsion energy [eV]: ", energy%core_overlap*evolt, &
699 "Core Hamiltonian energy [eV]: ", energy%core*evolt, &
700 "Two-electron integral energy [eV]: ", energy%hartree*evolt, &
701 "Electronic energy [eV]: ", &
702 (energy%core + 0.5_dp*energy%hartree)*evolt
703 IF (energy%dispersion /= 0.0_dp) &
704 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
705 "Dispersion energy [eV]: ", energy%dispersion*evolt
706 ELSEIF (dft_control%qs_control%dftb) THEN
707 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
708 "Core Hamiltonian energy: ", energy%core, &
709 "Repulsive potential energy: ", energy%repulsive, &
710 "Electronic energy: ", energy%hartree, &
711 "Dispersion energy: ", energy%dispersion
712 IF (energy%dftb3 /= 0.0_dp) &
713 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
714 "DFTB3 3rd order energy: ", energy%dftb3
715 IF (energy%efield /= 0.0_dp) &
716 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
717 "Electric field interaction energy: ", energy%efield
718 ELSEIF (dft_control%qs_control%xtb) THEN
719 IF (dft_control%qs_control%xtb_control%do_tblite) THEN
720 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
721 "Core Hamiltonian energy: ", energy%core, &
722 "Repulsive potential energy: ", energy%repulsive, &
723 "Electrostatic energy: ", energy%el_stat, &
724 "Self-consistent dispersion energy: ", energy%dispersion_sc, &
725 "Non-self consistent dispersion energy: ", energy%dispersion, &
726 "Correction for halogen bonding: ", energy%xtb_xb_inter
727 ELSE
728 IF (dft_control%qs_control%xtb_control%gfn_type == 0) THEN
729 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
730 "Core Hamiltonian energy: ", energy%core, &
731 "Repulsive potential energy: ", energy%repulsive, &
732 "SRB Correction energy: ", energy%srb, &
733 "Charge equilibration energy: ", energy%eeq, &
734 "Dispersion energy: ", energy%dispersion
735 ELSEIF (dft_control%qs_control%xtb_control%gfn_type == 1) THEN
736 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
737 "Core Hamiltonian energy: ", energy%core, &
738 "Repulsive potential energy: ", energy%repulsive, &
739 "Electronic energy: ", energy%hartree, &
740 "DFTB3 3rd order energy: ", energy%dftb3, &
741 "Dispersion energy: ", energy%dispersion
742 IF (dft_control%qs_control%xtb_control%xb_interaction) &
743 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
744 "Correction for halogen bonding: ", energy%xtb_xb_inter
745 ELSEIF (dft_control%qs_control%xtb_control%gfn_type == 2) THEN
746 cpabort("gfn_typ 2 NYA")
747 ELSE
748 cpabort("invalid gfn_typ")
749 END IF
750 END IF
751 IF (dft_control%qs_control%xtb_control%do_nonbonded) &
752 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
753 "Correction for nonbonded interactions: ", energy%xtb_nonbonded
754 IF (energy%efield /= 0.0_dp) &
755 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
756 "Electric field interaction energy: ", energy%efield
757 ELSE
758 IF (dft_control%do_admm) THEN
759 exc_energy = energy%exc + energy%exc_aux_fit
760 IF (gapw .OR. gapw_xc) exc1_energy = energy%exc1 + energy%exc1_aux_fit
761 ELSE
762 exc_energy = energy%exc
763 IF (gapw .OR. gapw_xc) exc1_energy = energy%exc1
764 END IF
765
766 IF (psolver == pw_poisson_implicit) THEN
767 implicit_ps_ehartree = pw_env%poisson_env%implicit_env%ehartree
768 bc = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition
769 SELECT CASE (bc)
771 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
772 "Overlap energy of the core charge distribution:", energy%core_overlap, &
773 "Self energy of the core charge distribution: ", energy%core_self, &
774 "Core Hamiltonian energy: ", energy%core, &
775 "Hartree energy: ", implicit_ps_ehartree, &
776 "Electric enthalpy: ", energy%hartree, &
777 "Exchange-correlation energy: ", exc_energy
778 CASE (periodic_bc, neumann_bc)
779 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
780 "Overlap energy of the core charge distribution:", energy%core_overlap, &
781 "Self energy of the core charge distribution: ", energy%core_self, &
782 "Core Hamiltonian energy: ", energy%core, &
783 "Hartree energy: ", energy%hartree, &
784 "Exchange-correlation energy: ", exc_energy
785 END SELECT
786 ELSE
787 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
788 "Overlap energy of the core charge distribution:", energy%core_overlap, &
789 "Self energy of the core charge distribution: ", energy%core_self, &
790 "Core Hamiltonian energy: ", energy%core, &
791 "Hartree energy: ", energy%hartree, &
792 "Exchange-correlation energy: ", exc_energy
793 END IF
794 IF (energy%e_hartree /= 0.0_dp) &
795 WRITE (unit=output_unit, fmt="(T3,A,/,T3,A,T56,F25.14)") &
796 "Coulomb Electron-Electron Interaction Energy ", &
797 "- Already included in the total Hartree term ", energy%e_hartree
798 IF (energy%ex /= 0.0_dp) &
799 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
800 "Hartree-Fock Exchange energy: ", energy%ex
801 IF (energy%dispersion /= 0.0_dp) &
802 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
803 "Dispersion energy: ", energy%dispersion
804 IF (energy%gcp /= 0.0_dp) &
805 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
806 "gCP energy: ", energy%gcp
807 IF (energy%efield /= 0.0_dp) &
808 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
809 "Electric field interaction energy: ", energy%efield
810 IF (gapw) THEN
811 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
812 "GAPW| Exc from hard and soft atomic rho1: ", exc1_energy, &
813 "GAPW| local Eh = 1 center integrals: ", energy%hartree_1c
814 END IF
815 IF (gapw_xc) THEN
816 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
817 "GAPW_XC| Exc from hard and soft atomic rho1: ", exc1_energy
818 END IF
819 IF (energy%core_cneo /= 0.0_dp) THEN
820 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
821 "CNEO| quantum nuclear core energy: ", energy%core_cneo
822 END IF
823 END IF
824 IF (dft_control%hairy_probes .EQV. .true.) THEN
825 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
826 "Electronic entropic energy:", energy%kTS
827 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
828 "Fermi energy:", energy%efermi
829 END IF
830 IF (dft_control%smear) THEN
831 SELECT CASE (scf_control%smear%method)
833 ! kTS does not have physical meaning in these smearing methods
834 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
835 "Smearing free energy correction:", energy%kTS
836 CASE DEFAULT
837 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
838 "Electronic entropic energy:", energy%kTS
839 END SELECT
840 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
841 "Fermi energy:", energy%efermi
842 END IF
843 IF (dft_control%dft_plus_u) THEN
844 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
845 "DFT+U energy:", energy%dft_plus_u
846 END IF
847 IF (dft_control%do_sccs) THEN
848 WRITE (unit=output_unit, fmt="(A)") ""
849 CALL print_sccs_results(energy, dft_control%sccs_control, output_unit)
850 END IF
851 IF (qmmm) THEN
852 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
853 "QM/MM Electrostatic energy: ", energy%qmmm_el
854 IF (qs_env%qmmm_env_qm%image_charge) THEN
855 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
856 "QM/MM image charge energy: ", energy%image_charge
857 END IF
858 END IF
859 IF (dft_control%qs_control%mulliken_restraint) THEN
860 WRITE (unit=output_unit, fmt="(T3,A,T56,F25.14)") &
861 "Mulliken restraint energy: ", energy%mulliken
862 END IF
863 IF (dft_control%qs_control%semi_empirical) THEN
864 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
865 "Total energy [eV]: ", energy%total*evolt
866 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
867 "Atomic reference energy [eV]: ", energy%core_self*evolt, &
868 "Heat of formation [kcal/mol]: ", &
869 (energy%total + energy%core_self)*kcalmol
870 ELSE
871 WRITE (unit=output_unit, fmt="(/,(T3,A,T56,F25.14))") &
872 "Total energy: ", energy%total
873 IF (dft_control%smear) THEN
874 SELECT CASE (scf_control%smear%method)
875 CASE (smear_fermi_dirac)
876 e_extrapolated = energy%total - 0.5_dp*energy%kTS
877 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
878 "Total energy (extrapolated to T->0): ", e_extrapolated
879 CASE (smear_gaussian)
880 e_extrapolated = energy%total - 0.5_dp*energy%kTS
881 WRITE (unit=output_unit, fmt="((T3,A,T56,F25.14))") &
882 "Total energy (extrapolated to sigma->0): ", e_extrapolated
883 CASE (smear_mp, smear_mv)
884 ! Sigma->0 extrapolation does not apply to MP or MV method.
885 END SELECT
886 END IF
887 END IF
888 IF (qmmm) THEN
889 IF (qs_env%qmmm_env_qm%image_charge) THEN
890 CALL print_image_coefficients(qs_env%image_coeff, qs_env)
891 END IF
892 END IF
893 CALL m_flush(output_unit)
894 END IF
895
896 CALL timestop(handle)
897
898 END SUBROUTINE qs_scf_print_scf_summary
899
900! **************************************************************************************************
901!> \brief collects the 'heavy duty' printing tasks out of the SCF loop
902!> \param qs_env ...
903!> \param scf_env ...
904!> \param para_env ...
905!> \par History
906!> 03.2006 created [Joost VandeVondele]
907! **************************************************************************************************
908 SUBROUTINE qs_scf_loop_print(qs_env, scf_env, para_env)
909 TYPE(qs_environment_type), POINTER :: qs_env
910 TYPE(qs_scf_env_type), POINTER :: scf_env
911 TYPE(mp_para_env_type), POINTER :: para_env
912
913 CHARACTER(LEN=*), PARAMETER :: routinen = 'qs_scf_loop_print'
914
915 INTEGER :: after, handle, ic, ispin, iw
916 LOGICAL :: do_kpoints, omit_headers
917 REAL(kind=dp) :: mo_mag_max, mo_mag_min, orthonormality
918 TYPE(cp_logger_type), POINTER :: logger
919 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_ks, matrix_p, matrix_s
920 TYPE(dft_control_type), POINTER :: dft_control
921 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
922 TYPE(qs_rho_type), POINTER :: rho
923 TYPE(section_vals_type), POINTER :: dft_section, input, scf_section
924
925 logger => cp_get_default_logger()
926 CALL timeset(routinen, handle)
927
928 CALL get_qs_env(qs_env=qs_env, input=input, dft_control=dft_control, &
929 do_kpoints=do_kpoints)
930
931 dft_section => section_vals_get_subs_vals(input, "DFT")
932 scf_section => section_vals_get_subs_vals(dft_section, "SCF")
933
934 CALL section_vals_val_get(input, "DFT%PRINT%AO_MATRICES%OMIT_HEADERS", l_val=omit_headers)
935 DO ispin = 1, dft_control%nspins
936
937 IF (btest(cp_print_key_should_output(logger%iter_info, &
938 dft_section, "PRINT%AO_MATRICES/DENSITY"), cp_p_file)) THEN
939 CALL get_qs_env(qs_env, rho=rho)
940 CALL qs_rho_get(rho, rho_ao_kp=matrix_p)
941 iw = cp_print_key_unit_nr(logger, dft_section, "PRINT%AO_MATRICES/DENSITY", &
942 extension=".Log")
943 CALL section_vals_val_get(dft_section, "PRINT%AO_MATRICES%NDIGITS", i_val=after)
944 after = min(max(after, 1), 16)
945 DO ic = 1, SIZE(matrix_p, 2)
946 CALL cp_dbcsr_write_sparse_matrix(matrix_p(ispin, ic)%matrix, 4, after, qs_env, para_env, &
947 output_unit=iw, omit_headers=omit_headers)
948 END DO
949 CALL cp_print_key_finished_output(iw, logger, dft_section, &
950 "PRINT%AO_MATRICES/DENSITY")
951 END IF
952
953 IF (btest(cp_print_key_should_output(logger%iter_info, &
954 dft_section, "PRINT%AO_MATRICES/KOHN_SHAM_MATRIX"), cp_p_file)) THEN
955 iw = cp_print_key_unit_nr(logger, dft_section, "PRINT%AO_MATRICES/KOHN_SHAM_MATRIX", &
956 extension=".Log")
957 CALL section_vals_val_get(dft_section, "PRINT%AO_MATRICES%NDIGITS", i_val=after)
958 after = min(max(after, 1), 16)
959 CALL get_qs_env(qs_env=qs_env, matrix_ks_kp=matrix_ks)
960 DO ic = 1, SIZE(matrix_ks, 2)
961 IF (dft_control%qs_control%semi_empirical) THEN
962 CALL cp_dbcsr_write_sparse_matrix(matrix_ks(ispin, ic)%matrix, 4, after, qs_env, para_env, &
963 scale=evolt, output_unit=iw, omit_headers=omit_headers)
964 ELSE
965 CALL cp_dbcsr_write_sparse_matrix(matrix_ks(ispin, ic)%matrix, 4, after, qs_env, para_env, &
966 output_unit=iw, omit_headers=omit_headers)
967 END IF
968 END DO
969 CALL cp_print_key_finished_output(iw, logger, dft_section, &
970 "PRINT%AO_MATRICES/KOHN_SHAM_MATRIX")
971 END IF
972
973 END DO
974
975 IF (btest(cp_print_key_should_output(logger%iter_info, &
976 scf_section, "PRINT%MO_ORTHONORMALITY"), cp_p_file)) THEN
977 IF (do_kpoints) THEN
978 iw = cp_print_key_unit_nr(logger, scf_section, "PRINT%MO_ORTHONORMALITY", &
979 extension=".scfLog")
980 IF (iw > 0) THEN
981 WRITE (iw, '(T8,A)') &
982 " K-points: Maximum deviation from MO S-orthonormality not determined"
983 END IF
984 CALL cp_print_key_finished_output(iw, logger, scf_section, &
985 "PRINT%MO_ORTHONORMALITY")
986 ELSE
987 CALL get_qs_env(qs_env, mos=mos)
988 IF (scf_env%method == special_diag_method_nr) THEN
989 CALL calculate_orthonormality(orthonormality, mos)
990 ELSE
991 CALL get_qs_env(qs_env=qs_env, matrix_s_kp=matrix_s)
992 CALL calculate_orthonormality(orthonormality, mos, matrix_s(1, 1)%matrix)
993 END IF
994 iw = cp_print_key_unit_nr(logger, scf_section, "PRINT%MO_ORTHONORMALITY", &
995 extension=".scfLog")
996 IF (iw > 0) THEN
997 WRITE (iw, '(T8,A,T61,E20.4)') &
998 " Maximum deviation from MO S-orthonormality", orthonormality
999 END IF
1000 CALL cp_print_key_finished_output(iw, logger, scf_section, &
1001 "PRINT%MO_ORTHONORMALITY")
1002 END IF
1003 END IF
1004 IF (btest(cp_print_key_should_output(logger%iter_info, &
1005 scf_section, "PRINT%MO_MAGNITUDE"), cp_p_file)) THEN
1006 IF (do_kpoints) THEN
1007 iw = cp_print_key_unit_nr(logger, scf_section, "PRINT%MO_MAGNITUDE", &
1008 extension=".scfLog")
1009 IF (iw > 0) THEN
1010 WRITE (iw, '(T8,A)') &
1011 " K-points: Minimum/Maximum MO magnitude not determined"
1012 END IF
1013 CALL cp_print_key_finished_output(iw, logger, scf_section, &
1014 "PRINT%MO_MAGNITUDE")
1015 ELSE
1016 CALL get_qs_env(qs_env, mos=mos)
1017 CALL calculate_magnitude(mos, mo_mag_min, mo_mag_max)
1018 iw = cp_print_key_unit_nr(logger, scf_section, "PRINT%MO_MAGNITUDE", &
1019 extension=".scfLog")
1020 IF (iw > 0) THEN
1021 WRITE (iw, '(T8,A,T41,2E20.4)') &
1022 " Minimum/Maximum MO magnitude ", mo_mag_min, mo_mag_max
1023 END IF
1024 CALL cp_print_key_finished_output(iw, logger, scf_section, &
1025 "PRINT%MO_MAGNITUDE")
1026 END IF
1027 END IF
1028
1029 CALL timestop(handle)
1030
1031 END SUBROUTINE qs_scf_loop_print
1032
1033! **************************************************************************************************
1034!> \brief writes CDFT constraint information and optionally CDFT scf loop info
1035!> \param output_unit where to write the information
1036!> \param scf_control settings of the SCF loop
1037!> \param scf_env the env which holds convergence data
1038!> \param cdft_control the env which holds information about the constraint
1039!> \param energy the total energy
1040!> \param total_steps the total number of performed SCF iterations
1041!> \param should_stop if the calculation should stop
1042!> \param outer_loop_converged logical which determines if the CDFT SCF loop converged
1043!> \param cdft_loop logical which determines a CDFT SCF loop is active
1044!> \par History
1045!> 12.2015 created [Nico Holmberg]
1046! **************************************************************************************************
1047 SUBROUTINE qs_scf_cdft_info(output_unit, scf_control, scf_env, cdft_control, &
1048 energy, total_steps, should_stop, outer_loop_converged, &
1049 cdft_loop)
1050 INTEGER :: output_unit
1051 TYPE(scf_control_type), POINTER :: scf_control
1052 TYPE(qs_scf_env_type), POINTER :: scf_env
1053 TYPE(cdft_control_type), POINTER :: cdft_control
1054 TYPE(qs_energy_type), POINTER :: energy
1055 INTEGER :: total_steps
1056 LOGICAL, INTENT(IN) :: should_stop, outer_loop_converged, &
1057 cdft_loop
1058
1059 REAL(kind=dp) :: outer_loop_eps
1060
1061 IF (cdft_loop) THEN
1062 outer_loop_eps = sqrt(maxval(scf_env%outer_scf%gradient(:, scf_env%outer_scf%iter_count)**2))
1063 IF (output_unit > 0) WRITE (output_unit, '(/,T3,A,I4,A,E10.2,A,F22.10)') &
1064 "CDFT SCF iter = ", scf_env%outer_scf%iter_count, &
1065 " RMS gradient = ", outer_loop_eps, " energy =", energy%total
1066 IF (outer_loop_converged) THEN
1067 IF (output_unit > 0) WRITE (output_unit, '(T3,A,I4,A,I4,A,/)') &
1068 "CDFT SCF loop converged in", scf_env%outer_scf%iter_count, &
1069 " iterations or ", total_steps, " steps"
1070 END IF
1071 IF ((scf_env%outer_scf%iter_count > scf_control%outer_scf%max_scf .OR. should_stop) &
1072 .AND. .NOT. outer_loop_converged) THEN
1073 IF (output_unit > 0) WRITE (output_unit, '(T3,A,I4,A,I4,A,/)') &
1074 "CDFT SCF loop FAILED to converge after ", &
1075 scf_env%outer_scf%iter_count, " iterations or ", total_steps, " steps"
1076 END IF
1077 END IF
1078 CALL qs_scf_cdft_constraint_info(output_unit, cdft_control)
1079
1080 END SUBROUTINE qs_scf_cdft_info
1081
1082! **************************************************************************************************
1083!> \brief writes information about the CDFT env
1084!> \param output_unit where to write the information
1085!> \param cdft_control the CDFT env that stores information about the constraint calculation
1086!> \par History
1087!> 12.2015 created [Nico Holmberg]
1088! **************************************************************************************************
1089 SUBROUTINE qs_scf_cdft_initial_info(output_unit, cdft_control)
1090 INTEGER :: output_unit
1091 TYPE(cdft_control_type), POINTER :: cdft_control
1092
1093 IF (output_unit > 0) THEN
1094 WRITE (output_unit, '(/,A)') &
1095 " ---------------------------------- CDFT --------------------------------------"
1096 WRITE (output_unit, '(A)') &
1097 " Optimizing a density constraint in an external SCF loop "
1098 WRITE (output_unit, '(A)') " "
1099 SELECT CASE (cdft_control%type)
1101 WRITE (output_unit, '(A)') " Type of constraint: Hirshfeld"
1103 WRITE (output_unit, '(A)') " Type of constraint: Becke"
1104 END SELECT
1105 WRITE (output_unit, '(A,I8)') " Number of constraints: ", SIZE(cdft_control%group)
1106 WRITE (output_unit, '(A,L8)') " Using fragment densities:", cdft_control%fragment_density
1107 WRITE (output_unit, '(A)') " "
1108 IF (cdft_control%atomic_charges) WRITE (output_unit, '(A,/)') " Calculating atomic CDFT charges"
1109 SELECT CASE (cdft_control%constraint_control%optimizer)
1111 WRITE (output_unit, '(A)') &
1112 " Minimizer : SD : steepest descent"
1114 WRITE (output_unit, '(A)') &
1115 " Minimizer : DIIS : direct inversion"
1116 WRITE (output_unit, '(A)') &
1117 " in the iterative subspace"
1118 WRITE (output_unit, '(A,I3,A)') &
1119 " using ", &
1120 cdft_control%constraint_control%diis_buffer_length, " DIIS vectors"
1122 WRITE (output_unit, '(A)') &
1123 " Minimizer : BISECT : gradient bisection"
1124 WRITE (output_unit, '(A,I3)') &
1125 " using a trust count of", &
1126 cdft_control%constraint_control%bisect_trust_count
1129 CALL cdft_opt_type_write(cdft_control%constraint_control%cdft_opt_control, &
1130 cdft_control%constraint_control%optimizer, output_unit)
1132 WRITE (output_unit, '(A)') " Minimizer : Secant"
1133 CASE DEFAULT
1134 cpabort("")
1135 END SELECT
1136 WRITE (output_unit, '(/,A,L7)') &
1137 " Reusing OT preconditioner: ", cdft_control%reuse_precond
1138 IF (cdft_control%reuse_precond) THEN
1139 WRITE (output_unit, '(A,I3,A,I3,A)') &
1140 " using old preconditioner for up to ", &
1141 cdft_control%max_reuse, " subsequent CDFT SCF"
1142 WRITE (output_unit, '(A,I3,A,I3,A)') &
1143 " iterations if the relevant loop converged in less than ", &
1144 cdft_control%precond_freq, " steps"
1145 END IF
1146 SELECT CASE (cdft_control%type)
1148 WRITE (output_unit, '(/,A)') " Hirshfeld constraint settings"
1149 WRITE (output_unit, '(A)') " "
1150 SELECT CASE (cdft_control%hirshfeld_control%shape_function)
1152 WRITE (output_unit, '(A, A8)') &
1153 " Shape function type: ", "Gaussian"
1154 WRITE (output_unit, '(A)', advance='NO') &
1155 " Type of Gaussian: "
1156 SELECT CASE (cdft_control%hirshfeld_control%gaussian_shape)
1157 CASE (radius_default)
1158 WRITE (output_unit, '(A13)') "Default"
1159 CASE (radius_covalent)
1160 WRITE (output_unit, '(A13)') "Covalent"
1161 CASE (radius_single)
1162 WRITE (output_unit, '(A13)') "Fixed radius"
1163 CASE (radius_vdw)
1164 WRITE (output_unit, '(A13)') "Van der Waals"
1165 CASE (radius_user)
1166 WRITE (output_unit, '(A13)') "User-defined"
1167
1168 END SELECT
1170 WRITE (output_unit, '(A, A8)') &
1171 " Shape function type: ", "Density"
1172 END SELECT
1174 WRITE (output_unit, '(/, A)') " Becke constraint settings"
1175 WRITE (output_unit, '(A)') " "
1176 SELECT CASE (cdft_control%becke_control%cutoff_type)
1177 CASE (becke_cutoff_global)
1178 WRITE (output_unit, '(A,F8.3,A)') &
1179 " Cutoff for partitioning :", cp_unit_from_cp2k(cdft_control%becke_control%rglobal, &
1180 "angstrom"), " angstrom"
1182 WRITE (output_unit, '(A)') &
1183 " Using element specific cutoffs for partitioning"
1184 END SELECT
1185 WRITE (output_unit, '(A,L7)') &
1186 " Skipping distant gpoints: ", cdft_control%becke_control%should_skip
1187 WRITE (output_unit, '(A,L7)') &
1188 " Precompute gradients : ", cdft_control%becke_control%in_memory
1189 WRITE (output_unit, '(A)') " "
1190 IF (cdft_control%becke_control%adjust) &
1191 WRITE (output_unit, '(A)') &
1192 " Using atomic radii to generate a heteronuclear charge partitioning"
1193 WRITE (output_unit, '(A)') " "
1194 IF (.NOT. cdft_control%becke_control%cavity_confine) THEN
1195 WRITE (output_unit, '(A)') &
1196 " No confinement is active"
1197 ELSE
1198 WRITE (output_unit, '(A)') " Confinement using a Gaussian shaped cavity is active"
1199 SELECT CASE (cdft_control%becke_control%cavity_shape)
1200 CASE (radius_single)
1201 WRITE (output_unit, '(A,F8.4, A)') &
1202 " Type of Gaussian : Fixed radius: ", &
1203 cp_unit_from_cp2k(cdft_control%becke_control%rcavity, "angstrom"), " angstrom"
1204 CASE (radius_covalent)
1205 WRITE (output_unit, '(A)') &
1206 " Type of Gaussian : Covalent radius "
1207 CASE (radius_vdw)
1208 WRITE (output_unit, '(A)') &
1209 " Type of Gaussian : vdW radius "
1210 CASE (radius_user)
1211 WRITE (output_unit, '(A)') &
1212 " Type of Gaussian : User radius "
1213 END SELECT
1214 WRITE (output_unit, '(A,ES12.4)') &
1215 " Cavity threshold : ", cdft_control%becke_control%eps_cavity
1216 END IF
1217 END SELECT
1218 WRITE (output_unit, '(/,A)') &
1219 " ---------------------------------- CDFT --------------------------------------"
1220 END IF
1221
1222 END SUBROUTINE qs_scf_cdft_initial_info
1223
1224! **************************************************************************************************
1225!> \brief writes CDFT constraint information
1226!> \param output_unit where to write the information
1227!> \param cdft_control the env which holds information about the constraint
1228!> \par History
1229!> 08.2018 separated from qs_scf_cdft_info to make code callable elsewhere [Nico Holmberg]
1230! **************************************************************************************************
1231 SUBROUTINE qs_scf_cdft_constraint_info(output_unit, cdft_control)
1232 INTEGER :: output_unit
1233 TYPE(cdft_control_type), POINTER :: cdft_control
1234
1235 INTEGER :: igroup
1236
1237 IF (output_unit > 0) THEN
1238 SELECT CASE (cdft_control%type)
1240 WRITE (output_unit, '(/,T3,A,T60)') &
1241 '------------------- Hirshfeld constraint information -------------------'
1243 WRITE (output_unit, '(/,T3,A,T60)') &
1244 '--------------------- Becke constraint information ---------------------'
1245 CASE DEFAULT
1246 cpabort("Unknown CDFT constraint.")
1247 END SELECT
1248 DO igroup = 1, SIZE(cdft_control%target)
1249 IF (igroup > 1) WRITE (output_unit, '(T3,A)') ' '
1250 WRITE (output_unit, '(T3,A,T54,(3X,I18))') &
1251 'Atomic group :', igroup
1252 SELECT CASE (cdft_control%group(igroup)%constraint_type)
1254 IF (cdft_control%group(igroup)%is_fragment_constraint) THEN
1255 WRITE (output_unit, '(T3,A,T42,A)') &
1256 'Type of constraint :', adjustr('Charge density constraint (frag.)')
1257 ELSE
1258 WRITE (output_unit, '(T3,A,T50,A)') &
1259 'Type of constraint :', adjustr('Charge density constraint')
1260 END IF
1262 IF (cdft_control%group(igroup)%is_fragment_constraint) THEN
1263 WRITE (output_unit, '(T3,A,T35,A)') &
1264 'Type of constraint :', adjustr('Magnetization density constraint (frag.)')
1265 ELSE
1266 WRITE (output_unit, '(T3,A,T43,A)') &
1267 'Type of constraint :', adjustr('Magnetization density constraint')
1268 END IF
1270 IF (cdft_control%group(igroup)%is_fragment_constraint) THEN
1271 WRITE (output_unit, '(T3,A,T38,A)') &
1272 'Type of constraint :', adjustr('Alpha spin density constraint (frag.)')
1273 ELSE
1274 WRITE (output_unit, '(T3,A,T46,A)') &
1275 'Type of constraint :', adjustr('Alpha spin density constraint')
1276 END IF
1278 IF (cdft_control%group(igroup)%is_fragment_constraint) THEN
1279 WRITE (output_unit, '(T3,A,T39,A)') &
1280 'Type of constraint :', adjustr('Beta spin density constraint (frag.)')
1281 ELSE
1282 WRITE (output_unit, '(T3,A,T47,A)') &
1283 'Type of constraint :', adjustr('Beta spin density constraint')
1284 END IF
1285 CASE DEFAULT
1286 cpabort("Unknown constraint type.")
1287 END SELECT
1288 WRITE (output_unit, '(T3,A,T54,(3X,F18.12))') &
1289 'Target value of constraint :', cdft_control%target(igroup)
1290 WRITE (output_unit, '(T3,A,T54,(3X,F18.12))') &
1291 'Current value of constraint :', cdft_control%value(igroup)
1292 WRITE (output_unit, '(T3,A,T59,(3X,ES13.3))') &
1293 'Deviation from target :', cdft_control%value(igroup) - cdft_control%target(igroup)
1294 WRITE (output_unit, '(T3,A,T54,(3X,F18.12))') &
1295 'Strength of constraint :', cdft_control%strength(igroup)
1296 END DO
1297 WRITE (output_unit, '(T3,A)') &
1298 '------------------------------------------------------------------------'
1299 END IF
1300
1301 END SUBROUTINE qs_scf_cdft_constraint_info
1302
1303END MODULE qs_scf_output
Types and set/get functions for auxiliary density matrix methods.
Definition admm_types.F:15
Contains methods used in the context of density fitting.
Definition admm_utils.F:15
subroutine, public admm_uncorrect_for_eigenvalues(ispin, admm_env, ks_matrix)
...
Definition admm_utils.F:127
subroutine, public admm_correct_for_eigenvalues(ispin, admm_env, ks_matrix)
...
Definition admm_utils.F:53
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR output in CP2K.
subroutine, public cp_dbcsr_write_sparse_matrix(sparse_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, scale, output_unit, omit_headers, cartesian_basis)
...
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
subroutine, public cp_fm_init_random(matrix, ncol, start_col)
fills a matrix with random numbers
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Definition cp_units.F:1239
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public smear_fermi_dirac
integer, parameter, public radius_vdw
integer, parameter, public outer_scf_optimizer_sd
integer, parameter, public cdft_beta_constraint
integer, parameter, public cdft_magnetization_constraint
integer, parameter, public outer_scf_optimizer_bisect
integer, parameter, public outer_scf_optimizer_secant
integer, parameter, public becke_cutoff_element
integer, parameter, public radius_default
integer, parameter, public outer_scf_optimizer_broyden
integer, parameter, public cdft_charge_constraint
integer, parameter, public outer_scf_becke_constraint
integer, parameter, public radius_user
integer, parameter, public smear_gaussian
integer, parameter, public shape_function_density
integer, parameter, public outer_scf_hirshfeld_constraint
integer, parameter, public radius_covalent
integer, parameter, public smear_mv
integer, parameter, public shape_function_gaussian
integer, parameter, public radius_single
integer, parameter, public outer_scf_optimizer_newton_ls
integer, parameter, public outer_scf_optimizer_newton
integer, parameter, public smear_mp
integer, parameter, public becke_cutoff_global
integer, parameter, public cdft_alpha_constraint
integer, parameter, public outer_scf_optimizer_diis
integer, parameter, public ot_precond_full_all
objects that represent the structure of input sections and the data contained in an input section
integer function, dimension(:), pointer, public section_get_ivals(section_vals, keyword_name)
...
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
sums arrays of real/complex numbers with much reduced round-off as compared to a naive implementation...
Definition kahan_sum.F:29
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Types and basic routines needed for a kpoint calculation.
Machine interface based on Fortran 2003 and POSIX.
Definition machine.F:17
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Definition machine.F:124
Interface to the message passing library MPI.
Define the data structure for the particle information.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public kcalmol
Definition physcon.F:171
real(kind=dp), parameter, public evolt
Definition physcon.F:183
types of preconditioners
computes preconditioners, and implements methods to apply them currently used in qs_ot
Types containing essential information for running implicit (iterative) Poisson solver.
integer, parameter, public neumann_bc
integer, parameter, public mixed_bc
integer, parameter, public mixed_periodic_bc
integer, parameter, public periodic_bc
container for various plainwaves related things
functions related to the poisson solver on regular grids
integer, parameter, public pw_poisson_implicit
Routines for image charge calculation within QM/MM.
subroutine, public print_image_coefficients(image_coeff, qs_env)
Print image coefficients.
Control parameters for optimizers that work with CDFT constraints.
subroutine, public cdft_opt_type_write(cdft_opt_control, optimizer, output_unit)
writes information about the CDFT optimizer object
Defines CDFT control structures.
container for information about total charges on the grids
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
Definition and initialisation of the mo data type.
Definition qs_mo_io.F:21
subroutine, public write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, before, kpoint, final_mos, spin, solver_method, rtp, cpart, sim_step, umo_set, qs_env)
Write MO information to output file (eigenvalues, occupation numbers, coefficients)
Definition qs_mo_io.F:1022
collects routines that perform operations directly related to MOs
subroutine, public calculate_magnitude(mo_array, mo_mag_min, mo_mag_max)
...
subroutine, public calculate_orthonormality(orthonormality, mo_array, matrix_s)
...
Set occupation of molecular orbitals.
Definition and initialisation of the mo data type.
Definition qs_mo_types.F:22
subroutine, public init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name, counter)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
subroutine, public allocate_mo_set(mo_set, nao, nmo, nelectron, n_el_f, maxocc, flexible_electron_count)
Allocates a mo set and partially initializes it (nao,nmo,nelectron, and flexible_electron_count are v...
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
an eigen-space solver for the generalised symmetric eigenvalue problem for sparse matrices,...
subroutine, public ot_eigensolver(matrix_h, matrix_s, matrix_orthogonal_space_fm, matrix_c_fm, preconditioner, eps_gradient, iter_max, size_ortho_space, silent, ot_settings)
...
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
Self-consistent continuum solvation (SCCS) model implementation.
Definition qs_sccs.F:29
subroutine, public print_sccs_results(energy, sccs_control, output_unit)
Print SCCS results.
Definition qs_sccs.F:1216
subroutine, public qs_scf_print_summary(output_unit, qs_env)
writes a summary of information after scf
subroutine, public qs_scf_cdft_constraint_info(output_unit, cdft_control)
writes CDFT constraint information
subroutine, public qs_scf_loop_print(qs_env, scf_env, para_env)
collects the 'heavy duty' printing tasks out of the SCF loop
subroutine, public qs_scf_outer_loop_info(output_unit, scf_control, scf_env, energy, total_steps, should_stop, outer_loop_converged)
writes basic information obtained in a scf outer loop step
subroutine, public qs_scf_initial_info(output_unit, mos, dft_control, ndep)
writes basic information at the beginning of an scf run
subroutine, public qs_scf_write_mos(qs_env, scf_env, final_mos)
Write the MO eigenvector, eigenvalues, and occupation numbers to the output unit.
subroutine, public qs_scf_loop_info(scf_env, output_unit, just_energy, t1, t2, energy)
writes basic information obtained in a scf step
subroutine, public qs_scf_cdft_info(output_unit, scf_control, scf_env, cdft_control, energy, total_steps, should_stop, outer_loop_converged, cdft_loop)
writes CDFT constraint information and optionally CDFT scf loop info
subroutine, public qs_scf_cdft_initial_info(output_unit, cdft_control)
writes information about the CDFT env
module that contains the definitions of the scf types
integer, parameter, public ot_method_nr
integer, parameter, public special_diag_method_nr
parameters that control an scf iteration
stores some data used in wavefunction fitting
Definition admm_types.F:120
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
represent a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Contains information about kpoints.
stores all the informations relevant to an mpi environment
contained for different pw related things
Container for information about total charges on the grids.
Provides all information about a quickstep kind.
keeps the density in various representations, keeping track of which ones are valid.