80#include "../base/base_uses.f90"
85 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
86 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'gopt_f_methods'
107 REAL(kind=
dp),
DIMENSION(:),
POINTER :: x0
109 INTEGER :: i, idg, j, nparticle
116 SELECT CASE (gopt_env%type_id)
120 IF (gopt_env%force_env%in_use ==
use_qmmm)
THEN
123 IF (gopt_env%force_env%in_use ==
use_qmmmx)
THEN
127 ALLOCATE (x0(3*nparticle))
130 CALL force_env_get(gopt_env%force_env, subsys=subsys, cell=cell)
132 gopt_env%h_ref = cell%hmat
134 IF (gopt_env%force_env%in_use ==
use_qmmm)
THEN
137 IF (gopt_env%force_env%in_use ==
use_qmmmx)
THEN
141 ALLOCATE (x0(3*nparticle + 6))
147 x0(idg) = gopt_env%cell_env%opt_cell%hmat(j, i)
151 cpabort(
"Invalid or not yet implemented type of optimization")
172 final_evaluation, para_env)
175 REAL(kind=
dp),
DIMENSION(:),
POINTER :: x
176 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: f
177 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: gradient
178 INTEGER,
INTENT(IN) :: master
179 LOGICAL,
INTENT(IN),
OPTIONAL :: final_evaluation
182 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_eval_at'
184 INTEGER :: handle, idg, idir, ip, nparticle, nsize, &
186 REAL(kind=
dp) :: f_ts
187 REAL(kind=
dp),
DIMENSION(3, 3) :: av_ptens, av_ptens_opt
188 REAL(kind=
dp),
DIMENSION(:),
POINTER :: cell_gradient, gradient_ts
196 mark_used(final_evaluation)
199 NULLIFY (core_particles)
200 NULLIFY (gradient_ts)
202 NULLIFY (shell_particles)
207 CALL timeset(routinen, handle)
209 CALL force_env_get(gopt_env%force_env, subsys=subsys, cell=cell)
211 core_particles=core_particles, &
212 particles=particles, &
213 shell_particles=shell_particles, &
216 spgr => gopt_env%spgr
218 SELECT CASE (gopt_env%type_id)
222 SELECT CASE (gopt_env%type_id)
226 calc_force=
PRESENT(gradient), &
227 require_consistent_energy_force=gopt_env%require_consistent_energy_force)
233 IF (
PRESENT(gradient))
THEN
234 IF (master == para_env%mepos)
THEN
236 IF (spgr%keep_space_group)
THEN
244 ALLOCATE (gradient_ts(particles%n_els*3))
248 CALL cp_eval_at_ts(gopt_env, x, f_ts, gradient_ts, calc_force=.true.)
251 IF (
PRESENT(f)) f = f_ts
253 IF (
PRESENT(gradient))
THEN
254 IF (master == para_env%mepos)
THEN
255 cpassert(
ASSOCIATED(gradient))
256 gradient = gradient_ts
259 DEALLOCATE (gradient_ts)
266 IF (.NOT. virial%pv_availability)
THEN
267 CALL cp_abort(__location__, &
268 "For the CELL_OPT task, the FORCE_EVAL/STRESS_TENSOR "// &
269 "keyword MUST be defined in the input file for the "// &
270 "evaluation of the stress tensor, but none is found!")
272 IF (gopt_env%cell_env%keep_volume)
THEN
285 calc_force=
PRESENT(gradient), &
286 require_consistent_energy_force=gopt_env%require_consistent_energy_force)
294 IF (
PRESENT(gradient))
THEN
295 cpassert(any(virial_avg%pv_total /= 0))
297 av_ptens(:, :) = virial_avg%pv_total(:, :)/cell%deth
298 IF (master == para_env%mepos)
THEN
299 cpassert(
ASSOCIATED(gradient))
302 cpassert((
SIZE(gradient) == nsize + 6))
305 IF (spgr%keep_space_group)
THEN
310 cell_gradient => gradient(nsize + 1:nsize + 6)
311 cell_gradient = 0.0_dp
312 av_ptens_opt = matmul(gopt_env%cell_env%input_to_opt, &
313 matmul(av_ptens, gopt_env%cell_env%opt_to_input))
314 CALL get_dg_dh(cell_gradient, av_ptens_opt, gopt_env%cell_env%pres_ext, &
315 gopt_env%cell_env%opt_cell, gopt_env%cell_env%mtrx, &
316 keep_angles=gopt_env%cell_env%keep_angles, &
317 keep_symmetry=gopt_env%cell_env%keep_symmetry, &
318 pres_int=gopt_env%cell_env%pres_int, &
319 pres_constr=gopt_env%cell_env%pres_constr, &
320 constraint_id=gopt_env%cell_env%constraint_id)
324 CALL para_env%bcast(gopt_env%cell_env%pres_int, 0)
325 IF (gopt_env%cell_env%constraint_id /=
fix_none)
THEN
326 CALL para_env%bcast(gopt_env%cell_env%pres_constr, 0)
332 DO ip = 1, particles%n_els
333 shell_index = particles%els(ip)%shell_index
334 IF (shell_index /= 0)
THEN
336 idg = 3*(shell_index - 1) + idir
337 shell_particles%els(shell_index)%r(idir) = core_particles%els(ip)%r(idir) - x(idg)
345 calc_force=
PRESENT(gradient), &
346 require_consistent_energy_force=gopt_env%require_consistent_energy_force)
354 IF (
PRESENT(gradient))
THEN
355 IF (master == para_env%mepos)
THEN
356 cpassert(
ASSOCIATED(gradient))
358 DO ip = 1, shell_particles%n_els
361 gradient(idg) = -(core_particles%els(ip)%f(idir) - shell_particles%els(ip)%f(idir))
367 cpabort(
"Invalid or not yet implemented type of optimization")
370 CALL timestop(handle)
382 INTEGER,
INTENT(IN) :: its, output_unit
384 IF (output_unit > 0)
THEN
385 WRITE (unit=output_unit, fmt=
"(/,T2,26('-'))")
386 WRITE (unit=output_unit, fmt=
"(T2,A,I6)")
"OPTIMIZATION STEP: ", its
387 WRITE (unit=output_unit, fmt=
"(T2,26('-'))")
388 CALL m_flush(output_unit)
403 SUBROUTINE gopt_f_io_init(gopt_env, output_unit, opt_energy, wildcard, its, used_time)
405 TYPE(gopt_f_type),
POINTER :: gopt_env
406 INTEGER,
INTENT(IN) :: output_unit
407 REAL(kind=dp) :: opt_energy
408 CHARACTER(LEN=5) :: wildcard
409 INTEGER,
INTENT(IN) :: its
410 REAL(kind=dp) :: used_time
412 CHARACTER(LEN=default_string_length) :: energy_unit, stress_unit
413 INTEGER(KIND=int_8) :: max_memory
414 LOGICAL :: print_memory
415 REAL(kind=dp) :: pres_int
416 TYPE(mp_para_env_type),
POINTER :: para_env
419 CALL section_vals_val_get(gopt_env%motion_section,
"PRINT%MEMORY_INFO", l_val=print_memory)
421 IF (print_memory)
THEN
422 CALL force_env_get(gopt_env%force_env, para_env=para_env)
423 max_memory = sample_memory(para_env)
426 CALL section_vals_val_get(gopt_env%force_env%force_env_section, &
427 "PRINT%PROGRAM_RUN_INFO%ENERGY_UNIT", &
429 CALL section_vals_val_get(gopt_env%force_env%force_env_section, &
430 "PRINT%STRESS_TENSOR%STRESS_UNIT", &
433 SELECT CASE (gopt_env%type_id)
434 CASE (default_ts_method_id, default_minimization_method_id)
436 IF (.NOT. gopt_env%dimer_rotation)
THEN
437 CALL write_cycle_infos(output_unit, &
441 used_time=used_time, &
442 max_memory=max_memory, &
443 energy_unit=energy_unit, &
444 stress_unit=stress_unit)
446 CALL write_rot_cycle_infos(output_unit, &
449 dimer_env=gopt_env%dimer_env, &
451 used_time=used_time, &
452 max_memory=max_memory)
454 CASE (default_cell_method_id)
456 pres_int = gopt_env%cell_env%pres_int
457 CALL write_cycle_infos(output_unit, &
462 used_time=used_time, &
463 max_memory=max_memory, &
464 energy_unit=energy_unit, &
465 stress_unit=stress_unit)
466 CASE (default_shellcore_method_id)
467 CALL write_cycle_infos(output_unit, &
471 used_time=used_time, &
472 max_memory=max_memory, &
473 energy_unit=energy_unit, &
474 stress_unit=stress_unit)
502 SUBROUTINE gopt_f_io(gopt_env, force_env, root_section, its, opt_energy, &
503 output_unit, eold, emin, wildcard, gopt_param, ndf, dx, xi, conv, pred, rat, &
504 step, rad, used_time)
506 TYPE(gopt_f_type),
POINTER :: gopt_env
507 TYPE(force_env_type),
POINTER :: force_env
508 TYPE(section_vals_type),
POINTER :: root_section
509 INTEGER,
INTENT(IN) :: its
510 REAL(kind=dp),
INTENT(IN) :: opt_energy
511 INTEGER,
INTENT(IN) :: output_unit
512 REAL(kind=dp) :: eold, emin
513 CHARACTER(LEN=5) :: wildcard
514 TYPE(gopt_param_type),
POINTER :: gopt_param
515 INTEGER,
INTENT(IN),
OPTIONAL :: ndf
516 REAL(kind=dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: dx
517 REAL(kind=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: xi
518 LOGICAL,
OPTIONAL :: conv
519 REAL(kind=dp),
INTENT(IN),
OPTIONAL :: pred, rat, step, rad
520 REAL(kind=dp) :: used_time
522 CHARACTER(LEN=default_string_length) :: energy_unit, stress_unit
523 INTEGER(KIND=int_8) :: max_memory
524 LOGICAL :: print_memory
525 REAL(kind=dp) :: pres_diff, pres_diff_constr, pres_int, &
527 TYPE(mp_para_env_type),
POINTER :: para_env
530 CALL section_vals_val_get(gopt_env%motion_section,
"PRINT%MEMORY_INFO", l_val=print_memory)
532 IF (print_memory)
THEN
533 CALL force_env_get(force_env, para_env=para_env)
534 max_memory = sample_memory(para_env)
537 CALL section_vals_val_get(gopt_env%force_env%force_env_section, &
538 "PRINT%PROGRAM_RUN_INFO%ENERGY_UNIT", &
540 CALL section_vals_val_get(gopt_env%force_env%force_env_section, &
541 "PRINT%STRESS_TENSOR%STRESS_UNIT", &
544 SELECT CASE (gopt_env%type_id)
545 CASE (default_ts_method_id, default_minimization_method_id)
547 IF (.NOT. gopt_env%dimer_rotation)
THEN
548 CALL geo_opt_io(force_env=force_env, root_section=root_section, &
549 motion_section=gopt_env%motion_section, its=its, opt_energy=opt_energy)
550 CALL write_cycle_infos(output_unit, &
553 ediff=(opt_energy - eold), &
560 used_time=used_time, &
561 max_memory=max_memory, &
562 energy_unit=energy_unit, &
563 stress_unit=stress_unit)
565 IF (
PRESENT(conv))
THEN
566 cpassert(
PRESENT(ndf))
567 cpassert(
PRESENT(dx))
568 cpassert(
PRESENT(xi))
569 CALL check_converg(ndf, dx, xi, output_unit, conv, gopt_param, max_memory, stress_unit)
572 CALL update_dimer_vec(gopt_env%dimer_env, gopt_env%motion_section)
573 CALL write_restart(force_env=force_env, root_section=root_section)
574 CALL write_rot_cycle_infos(output_unit, its, opt_energy, opt_energy - eold, emin, gopt_env%dimer_env, &
575 wildcard=wildcard, used_time=used_time, max_memory=max_memory)
577 IF (
PRESENT(conv))
THEN
578 cpassert(
ASSOCIATED(gopt_env%dimer_env))
579 CALL check_rot_conv(gopt_env%dimer_env, output_unit, conv)
582 CASE (default_cell_method_id)
584 pres_diff = gopt_env%cell_env%pres_int - gopt_env%cell_env%pres_ext
585 pres_int = gopt_env%cell_env%pres_int
586 pres_tol = gopt_env%cell_env%pres_tol
587 CALL geo_opt_io(force_env=force_env, root_section=root_section, &
588 motion_section=gopt_env%motion_section, its=its, opt_energy=opt_energy)
589 CALL write_cycle_infos(output_unit, &
592 ediff=(opt_energy - eold), &
600 used_time=used_time, &
601 max_memory=max_memory, &
602 energy_unit=energy_unit, &
603 stress_unit=stress_unit)
605 IF (
PRESENT(conv))
THEN
606 cpassert(
PRESENT(ndf))
607 cpassert(
PRESENT(dx))
608 cpassert(
PRESENT(xi))
609 IF (gopt_env%cell_env%constraint_id == fix_none)
THEN
610 CALL check_converg(ndf, dx, xi, output_unit, conv, gopt_param, max_memory, stress_unit, &
613 pres_diff_constr = gopt_env%cell_env%pres_constr - gopt_env%cell_env%pres_ext
614 CALL check_converg(ndf, dx, xi, output_unit, conv, gopt_param, max_memory, stress_unit, &
615 pres_diff, pres_tol, pres_diff_constr)
618 CASE (default_shellcore_method_id)
619 CALL write_cycle_infos(output_unit, &
622 ediff=(opt_energy - eold), &
629 used_time=used_time, &
630 max_memory=max_memory, &
631 energy_unit=energy_unit, &
632 stress_unit=stress_unit)
634 IF (
PRESENT(conv))
THEN
635 cpassert(
PRESENT(ndf))
636 cpassert(
PRESENT(dx))
637 cpassert(
PRESENT(xi))
638 CALL check_converg(ndf, dx, xi, output_unit, conv, gopt_param, max_memory, stress_unit)
658 para_env, master, output_unit)
659 TYPE(gopt_f_type),
POINTER :: gopt_env
660 TYPE(force_env_type),
POINTER :: force_env
661 REAL(kind=dp),
DIMENSION(:),
POINTER :: x0
664 TYPE(section_vals_type),
POINTER :: root_section
665 TYPE(mp_para_env_type),
POINTER :: para_env
666 INTEGER,
INTENT(IN) :: master, output_unit
668 IF (gopt_env%eval_opt_geo)
THEN
669 IF (.NOT. gopt_env%dimer_rotation)
THEN
670 CALL write_final_info(output_unit, conv, its, gopt_env, x0, master, &
671 para_env, force_env, gopt_env%motion_section, root_section)
673 CALL update_dimer_vec(gopt_env%dimer_env, gopt_env%motion_section)
674 CALL write_restart(force_env=force_env, root_section=root_section)
698 SUBROUTINE write_cycle_infos(output_unit, it, etot, ediff, pred, rat, step, rad, emin, &
699 pres_int, wildcard, used_time, max_memory, energy_unit, stress_unit)
701 INTEGER,
INTENT(IN) :: output_unit, it
702 REAL(kind=dp),
INTENT(IN) :: etot
703 REAL(kind=dp),
INTENT(IN),
OPTIONAL :: ediff, pred, rat, step, rad, emin, &
705 CHARACTER(LEN=5),
INTENT(IN) :: wildcard
706 REAL(kind=dp),
INTENT(IN) :: used_time
707 INTEGER(KIND=int_8),
INTENT(IN) :: max_memory
708 CHARACTER(LEN=default_string_length),
INTENT(IN) :: energy_unit, stress_unit
710 CHARACTER(LEN=5) :: tag
712 IF (output_unit > 0)
THEN
714 WRITE (unit=output_unit, fmt=
"(/,T2,A)") tag//repeat(
"*", 74)
715 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,I25)") &
716 tag//
"Step number", it
717 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,A25)") &
718 tag//
"Optimization method", wildcard
719 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
720 tag//
"Total energy ["//trim(adjustl(energy_unit))//
"]", &
721 cp_unit_from_cp2k(etot, trim(energy_unit))
722 IF (
PRESENT(pres_int))
THEN
723 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
724 tag//
"Internal pressure ["//trim(adjustl(stress_unit))//
"]", &
725 cp_unit_from_cp2k(pres_int, trim(stress_unit))
727 IF (
PRESENT(ediff))
THEN
728 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
729 tag//
"Effective energy change ["//trim(adjustl(energy_unit))//
"]", &
730 cp_unit_from_cp2k(ediff, trim(energy_unit))
732 IF (
PRESENT(pred))
THEN
733 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
734 tag//
"Predicted energy change ["//trim(adjustl(energy_unit))//
"]", &
735 cp_unit_from_cp2k(pred, trim(energy_unit))
737 IF (
PRESENT(rat))
THEN
738 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
739 tag//
"Scaling factor", rat
741 IF (
PRESENT(step))
THEN
742 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
743 tag//
"Step size", step
745 IF (
PRESENT(rad))
THEN
746 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
747 tag//
"Trust radius", rad
749 IF (
PRESENT(emin))
THEN
750 IF (etot < emin)
THEN
751 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
752 tag//
"Decrease in energy",
" YES"
754 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
755 tag//
"Decrease in energy",
" NO"
758 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.3)") &
759 tag//
"Used time [s]", used_time
761 WRITE (unit=output_unit, fmt=
"(T2,A)") tag//repeat(
"*", 74)
762 IF (max_memory /= 0)
THEN
763 WRITE (unit=output_unit, fmt=
"(T2,A,T60,1X,I20)") &
764 tag//
"Estimated peak process memory [MiB]", &
765 (max_memory + (1024*1024) - 1)/(1024*1024)
770 END SUBROUTINE write_cycle_infos
786 SUBROUTINE write_rot_cycle_infos(output_unit, it, etot, ediff, emin, dimer_env, used_time, &
787 wildcard, max_memory)
789 INTEGER,
INTENT(IN) :: output_unit, it
790 REAL(kind=dp),
INTENT(IN) :: etot
791 REAL(kind=dp),
INTENT(IN),
OPTIONAL :: ediff, emin
792 TYPE(dimer_env_type),
POINTER :: dimer_env
793 REAL(kind=dp),
INTENT(IN) :: used_time
794 CHARACTER(LEN=5),
INTENT(IN) :: wildcard
795 INTEGER(KIND=int_8),
INTENT(IN) :: max_memory
797 CHARACTER(LEN=5) :: tag
799 IF (output_unit > 0)
THEN
801 WRITE (unit=output_unit, fmt=
"(/,T2,A)") tag//repeat(
"*", 74)
802 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,I25)") &
803 tag//
"Rotational step number", it
804 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,A25)") &
805 tag//
"Optimization method", wildcard
806 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
807 tag//
"Local curvature", dimer_env%rot%curvature, &
808 tag//
"Total rotational force", etot
809 IF (
PRESENT(ediff))
THEN
810 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
811 tag//
"Rotational force change", ediff
813 IF (
PRESENT(emin))
THEN
814 IF (etot < emin)
THEN
815 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
816 tag//
"Decrease in rotational force",
" YES"
818 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
819 tag//
"Decrease in rotational force",
" NO"
822 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.3)") &
823 tag//
"Used time [s]", used_time
825 WRITE (unit=output_unit, fmt=
"(T2,A)") tag//repeat(
"*", 74)
826 IF (max_memory /= 0)
THEN
827 WRITE (unit=output_unit, fmt=
"(T2,A,T60,1X,I20)") &
828 tag//
"Estimated peak process memory [MiB]", &
829 (max_memory + (1024*1024) - 1)/(1024*1024)
834 END SUBROUTINE write_rot_cycle_infos
850 SUBROUTINE check_converg(ndf, dr, g, output_unit, conv, gopt_param, max_memory, stress_unit, &
851 pres_diff, pres_tol, pres_diff_constr)
853 INTEGER,
INTENT(IN) :: ndf
854 REAL(kind=dp),
INTENT(IN) :: dr(ndf), g(ndf)
855 INTEGER,
INTENT(IN) :: output_unit
856 LOGICAL,
INTENT(OUT) :: conv
857 TYPE(gopt_param_type),
POINTER :: gopt_param
858 INTEGER(KIND=int_8),
INTENT(IN) :: max_memory
859 CHARACTER(LEN=default_string_length),
INTENT(IN) :: stress_unit
860 REAL(kind=dp),
INTENT(IN),
OPTIONAL :: pres_diff, pres_tol, pres_diff_constr
862 CHARACTER(LEN=5) :: tag
864 LOGICAL :: conv_dx, conv_g, conv_p, conv_rdx, &
866 REAL(kind=dp) :: dumm, dxcon, gcon, maxdum(4), rmsgcon, &
869 dxcon = gopt_param%max_dr
870 gcon = gopt_param%max_force
871 rmsgcon = gopt_param%rms_force
872 rmsxcon = gopt_param%rms_dr
883 IF (indf == 1) maxdum(1) = abs(dr(indf))
884 dumm = dumm + dr(indf)**2
885 IF (abs(dr(indf)) > dxcon) conv_dx = .false.
886 IF (abs(dr(indf)) > maxdum(1)) maxdum(1) = abs(dr(indf))
889 IF (dumm > (rmsxcon*rmsxcon*ndf)) conv_rdx = .false.
890 maxdum(2) = sqrt(dumm/ndf)
894 IF (indf == 1) maxdum(3) = abs(g(indf))
895 dumm = dumm + g(indf)**2
896 IF (abs(g(indf)) > gcon) conv_g = .false.
897 IF (abs(g(indf)) > maxdum(3)) maxdum(3) = abs(g(indf))
900 IF (dumm > (rmsgcon*rmsgcon*ndf)) conv_rg = .false.
901 maxdum(4) = sqrt(dumm/ndf)
903 IF (
PRESENT(pres_diff_constr) .AND.
PRESENT(pres_tol))
THEN
904 conv_p = abs(pres_diff_constr) < abs(pres_tol)
905 ELSE IF (
PRESENT(pres_diff) .AND.
PRESENT(pres_tol))
THEN
906 conv_p = abs(pres_diff) < abs(pres_tol)
909 IF (output_unit > 0)
THEN
913 WRITE (unit=output_unit, fmt=
"(T2,A)") trim(tag)
914 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
915 tag//
"Maximum step size", maxdum(1), &
916 tag//
"Convergence limit for maximum step size", dxcon
918 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
919 tag//
"Maximum step size is converged",
" YES"
921 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
922 tag//
"Maximum step size is converged",
" NO"
925 WRITE (unit=output_unit, fmt=
"(T2,A)") trim(tag)
926 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
927 tag//
"RMS step size", maxdum(2), &
928 tag//
"Convergence limit for RMS step size", rmsxcon
930 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
931 tag//
"RMS step size is converged",
" YES"
933 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
934 tag//
"RMS step size is converged",
" NO"
937 WRITE (unit=output_unit, fmt=
"(T2,A)") trim(tag)
938 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
939 tag//
"Maximum gradient", maxdum(3), &
940 tag//
"Convergence limit for maximum gradient", gcon
942 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
943 tag//
"Maximum gradient is converged",
" YES"
945 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
946 tag//
"Maximum gradient is converged",
" NO"
949 WRITE (unit=output_unit, fmt=
"(T2,A)") trim(tag)
950 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
951 tag//
"RMS gradient", maxdum(4), &
952 tag//
"Convergence limit for RMS gradient", rmsgcon
954 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
955 tag//
"RMS gradient is converged",
" YES"
957 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
958 tag//
"RMS gradient is converged",
" NO"
961 IF (
PRESENT(pres_diff) .AND.
PRESENT(pres_tol))
THEN
962 WRITE (unit=output_unit, fmt=
"(T2,A)") trim(tag)
963 IF (
PRESENT(pres_diff_constr))
THEN
964 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
965 tag//
"Pressure deviation without constraint ["// &
966 trim(adjustl(stress_unit))//
"]", &
967 cp_unit_from_cp2k(pres_diff, trim(stress_unit))
968 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
969 tag//
"Pressure deviation with constraint ["// &
970 trim(adjustl(stress_unit))//
"]", &
971 cp_unit_from_cp2k(pres_diff_constr, trim(stress_unit))
973 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
974 tag//
"Pressure deviation ["//trim(adjustl(stress_unit))//
"]", &
975 cp_unit_from_cp2k(pres_diff, trim(stress_unit))
977 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
978 tag//
"Pressure tolerance ["//trim(adjustl(stress_unit))//
"]", &
979 cp_unit_from_cp2k(pres_tol, trim(stress_unit))
981 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
982 tag//
"Pressure is converged",
" YES"
984 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
985 tag//
"Pressure is converged",
" NO"
989 WRITE (unit=output_unit, fmt=
"(T2,A)") tag//repeat(
"*", 74)
991 IF (max_memory /= 0)
THEN
992 WRITE (unit=output_unit, fmt=
"(T2,A,T60,1X,I20)") &
993 tag//
"Estimated peak process memory after this step [MiB]", &
994 (max_memory + (1024*1024) - 1)/(1024*1024)
999 IF (conv_dx .AND. conv_rdx .AND. conv_g .AND. conv_rg .AND. conv_p) conv = .true.
1001 IF ((conv) .AND. (output_unit > 0))
THEN
1002 WRITE (unit=output_unit, fmt=
"(/,T2,A)") repeat(
"*", 79)
1003 WRITE (unit=output_unit, fmt=
"(T2,A,T25,A,T78,A)") &
1004 "***",
"GEOMETRY OPTIMIZATION COMPLETED",
"***"
1005 WRITE (unit=output_unit, fmt=
"(T2,A)") repeat(
"*", 79)
1008 END SUBROUTINE check_converg
1018 SUBROUTINE check_rot_conv(dimer_env, output_unit, conv)
1020 TYPE(dimer_env_type),
POINTER :: dimer_env
1021 INTEGER,
INTENT(IN) :: output_unit
1022 LOGICAL,
INTENT(OUT) :: conv
1024 CHARACTER(LEN=5) :: tag
1026 conv = (abs(dimer_env%rot%angle2) < dimer_env%rot%angle_tol)
1028 IF (output_unit > 0)
THEN
1030 WRITE (unit=output_unit, fmt=
"(T2,A)") trim(tag)
1031 WRITE (unit=output_unit, fmt=
"(T2,A,T55,1X,F25.10)") &
1032 tag//
"Predicted angle step size", dimer_env%rot%angle1, &
1033 tag//
"Effective angle step size", dimer_env%rot%angle2, &
1034 tag//
"Convergence limit for angle step size", dimer_env%rot%angle_tol
1036 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
1037 tag//
"Angle step size is converged",
" YES"
1039 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
1040 tag//
"Angle step size is converged",
" NO"
1042 WRITE (unit=output_unit, fmt=
"(T2,A)") tag//repeat(
"*", 74)
1045 IF ((conv) .AND. (output_unit > 0))
THEN
1046 WRITE (unit=output_unit, fmt=
"(/,T2,A)") repeat(
"*", 79)
1047 WRITE (unit=output_unit, fmt=
"(T2,A,T25,A,T78,A)") &
1048 "***",
"ROTATION OPTIMIZATION COMPLETED",
"***"
1049 WRITE (unit=output_unit, fmt=
"(T2,A)") repeat(
"*", 79)
1052 END SUBROUTINE check_rot_conv
1069 RECURSIVE SUBROUTINE write_final_info(output_unit, conv, it, gopt_env, x0, master, para_env, force_env, &
1070 motion_section, root_section)
1071 INTEGER,
INTENT(IN) :: output_unit
1072 LOGICAL,
INTENT(IN) :: conv
1073 INTEGER,
INTENT(INOUT) :: it
1074 TYPE(gopt_f_type),
POINTER :: gopt_env
1075 REAL(kind=dp),
DIMENSION(:),
POINTER :: x0
1076 INTEGER,
INTENT(IN) :: master
1077 TYPE(mp_para_env_type),
POINTER :: para_env
1078 TYPE(force_env_type),
POINTER :: force_env
1079 TYPE(section_vals_type),
POINTER :: motion_section, root_section
1081 CHARACTER(LEN=4) :: constraint_label
1082 LOGICAL :: keep_angles, keep_symmetry, keep_volume
1083 REAL(kind=dp) :: etot
1084 TYPE(cell_type),
POINTER :: cell
1085 TYPE(cp_subsys_type),
POINTER :: subsys
1086 TYPE(particle_list_type),
POINTER :: particles
1087 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
1089 CALL force_env_get(force_env, cell=cell, subsys=subsys)
1090 CALL cp_subsys_get(subsys=subsys, particles=particles)
1091 particle_set => particles%els
1096 keep_angles = .true.
1097 keep_symmetry = .true.
1098 keep_volume = .true.
1099 constraint_label =
"NONE"
1100 IF (gopt_env%type_id == default_cell_method_id)
THEN
1101 keep_angles = gopt_env%cell_env%keep_angles
1102 keep_symmetry = gopt_env%cell_env%keep_symmetry
1103 keep_volume = gopt_env%cell_env%keep_volume
1104 SELECT CASE (gopt_env%cell_env%constraint_id)
1106 constraint_label =
" X"
1108 constraint_label =
" Y"
1110 constraint_label =
" Z"
1112 constraint_label =
" XY"
1114 constraint_label =
" XZ"
1116 constraint_label =
" YZ"
1118 constraint_label =
"NONE"
1121 CALL write_final_structure(particle_set, cell, motion_section, conv, &
1122 keep_angles, keep_symmetry, keep_volume, &
1123 gopt_env%label, constraint_label)
1127 CALL write_structure_data(particle_set, cell, motion_section)
1128 CALL write_restart(force_env=force_env, root_section=root_section)
1130 IF (output_unit > 0)
THEN
1131 WRITE (unit=output_unit, fmt=
"(/,T20,' Reevaluating energy at the minimum')")
1134 CALL cp_eval_at(gopt_env, x0, f=etot, master=master, final_evaluation=.true., &
1136 CALL write_geo_traj(force_env, root_section, it, etot)
1139 END SUBROUTINE write_final_info
1152 SUBROUTINE write_geo_traj(force_env, root_section, it, etot)
1154 TYPE(force_env_type),
POINTER :: force_env
1155 TYPE(section_vals_type),
POINTER :: root_section
1156 INTEGER,
INTENT(IN) :: it
1157 REAL(kind=dp),
INTENT(IN) :: etot
1159 LOGICAL :: shell_adiabatic, shell_present
1160 TYPE(atomic_kind_list_type),
POINTER :: atomic_kinds
1161 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
1162 TYPE(cp_subsys_type),
POINTER :: subsys
1163 TYPE(particle_list_type),
POINTER :: core_particles, shell_particles
1165 NULLIFY (atomic_kinds)
1166 NULLIFY (atomic_kind_set)
1167 NULLIFY (core_particles)
1168 NULLIFY (shell_particles)
1171 CALL write_trajectory(force_env, root_section, it, 0.0_dp, 0.0_dp, etot)
1173 CALL write_trajectory(force_env, root_section, it, 0.0_dp, 0.0_dp, etot,
"FORCES", middle_name=
"frc")
1174 CALL force_env_get(force_env, subsys=subsys)
1175 CALL cp_subsys_get(subsys, atomic_kinds=atomic_kinds)
1176 atomic_kind_set => atomic_kinds%els
1177 CALL get_atomic_kind_set(atomic_kind_set, &
1178 shell_present=shell_present, &
1179 shell_adiabatic=shell_adiabatic)
1180 IF (shell_present)
THEN
1181 CALL cp_subsys_get(subsys, &
1182 core_particles=core_particles, &
1183 shell_particles=shell_particles)
1184 CALL write_trajectory(force_env, root_section, it=it, time=0.0_dp, dtime=0.0_dp, &
1185 etot=etot, pk_name=
"SHELL_TRAJECTORY", middle_name=
"shpos", &
1186 particles=shell_particles)
1187 IF (shell_adiabatic)
THEN
1188 CALL write_trajectory(force_env, root_section, it=it, time=0.0_dp, dtime=0.0_dp, &
1189 etot=etot, pk_name=
"SHELL_FORCES", middle_name=
"shfrc", &
1190 particles=shell_particles)
1191 CALL write_trajectory(force_env, root_section, it=it, time=0.0_dp, dtime=0.0_dp, &
1192 etot=etot, pk_name=
"CORE_TRAJECTORY", middle_name=
"copos", &
1193 particles=core_particles)
1194 CALL write_trajectory(force_env, root_section, it=it, time=0.0_dp, dtime=0.0_dp, &
1195 etot=etot, pk_name=
"CORE_FORCES", middle_name=
"cofrc", &
1196 particles=core_particles)
1200 END SUBROUTINE write_geo_traj
1212 TYPE(gopt_f_type),
POINTER :: gopt_env
1213 INTEGER,
INTENT(IN) :: output_unit
1214 CHARACTER(LEN=*),
INTENT(IN) :: label
1216 CHARACTER(LEN=default_string_length) :: my_format, my_label
1219 IF (output_unit > 0)
THEN
1220 WRITE (unit=output_unit, fmt=
"(/,T2,A)") repeat(
"*", 79)
1221 IF (gopt_env%dimer_rotation)
THEN
1222 my_label =
"OPTIMIZING DIMER ROTATION"
1224 my_label =
"STARTING "//gopt_env%tag(1:8)//
" OPTIMIZATION"
1227 ix = (80 - 7 - len_trim(my_label))/2
1229 my_format =
"(T2,A,T"//cp_to_string(ix)//
",A,T78,A)"
1230 WRITE (unit=output_unit, fmt=trim(my_format))
"***", trim(my_label),
"***"
1232 ix = (80 - 7 - len_trim(label))/2
1234 my_format =
"(T2,A,T"//cp_to_string(ix)//
",A,T78,A)"
1235 WRITE (unit=output_unit, fmt=trim(my_format))
"***", trim(label),
"***"
1237 WRITE (unit=output_unit, fmt=
"(T2,A)") repeat(
"*", 79)
1238 CALL m_flush(output_unit)
1251 TYPE(gopt_f_type),
POINTER :: gopt_env
1252 INTEGER,
INTENT(IN) :: output_unit
1254 IF (output_unit > 0)
THEN
1255 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
1256 "*** MAXIMUM NUMBER OF OPTIMIZATION STEPS REACHED ***"
1257 IF (.NOT. gopt_env%dimer_rotation)
THEN
1258 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1259 "*** EXITING GEOMETRY OPTIMIZATION ***"
1261 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1262 "*** EXITING ROTATION OPTIMIZATION ***"
1264 CALL m_flush(output_unit)
1280 SUBROUTINE geo_opt_io(force_env, root_section, motion_section, its, opt_energy)
1282 TYPE(force_env_type),
POINTER :: force_env
1283 TYPE(section_vals_type),
POINTER :: root_section, motion_section
1284 INTEGER,
INTENT(IN) :: its
1285 REAL(kind=dp),
INTENT(IN) :: opt_energy
1287 TYPE(atomic_kind_list_type),
POINTER :: atomic_kinds
1288 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
1289 TYPE(cell_type),
POINTER :: cell
1290 TYPE(cp_subsys_type),
POINTER :: subsys
1291 TYPE(distribution_1d_type),
POINTER :: local_particles
1292 TYPE(mp_para_env_type),
POINTER :: para_env
1293 TYPE(particle_list_type),
POINTER :: particles
1294 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
1295 TYPE(virial_type),
POINTER :: virial
1297 NULLIFY (para_env, atomic_kind_set, subsys, particle_set, &
1298 local_particles, atomic_kinds, particles)
1301 CALL write_restart(force_env=force_env, root_section=root_section)
1304 CALL write_geo_traj(force_env, root_section, its, opt_energy)
1307 CALL force_env_get(force_env, cell=cell, para_env=para_env, &
1309 CALL cp_subsys_get(subsys=subsys, atomic_kinds=atomic_kinds, local_particles=local_particles, &
1310 particles=particles, virial=virial)
1311 atomic_kind_set => atomic_kinds%els
1312 particle_set => particles%els
1313 CALL virial_evaluate(atomic_kind_set, particle_set, local_particles, &
1315 CALL write_stress_tensor_to_file(virial, cell, motion_section, its, 0.0_dp)
1318 CALL write_simulation_cell(cell, motion_section, its, 0.0_dp)
1320 END SUBROUTINE geo_opt_io
1334 TYPE(gopt_f_type),
POINTER :: gopt_env
1335 TYPE(cell_type),
POINTER :: cell
1336 REAL(kind=dp),
DIMENSION(:),
POINTER :: x
1337 LOGICAL,
INTENT(IN) :: update_forces
1339 INTEGER :: i, iatom, idg, j, natom, nparticle, &
1341 REAL(kind=dp) :: fc, fs, mass
1342 REAL(kind=dp),
DIMENSION(3) :: s
1343 TYPE(cell_type),
POINTER :: cell_ref
1344 TYPE(cp_subsys_type),
POINTER :: subsys
1345 TYPE(particle_list_type),
POINTER :: core_particles, particles, &
1349 NULLIFY (core_particles)
1351 NULLIFY (shell_particles)
1354 natom = force_env_get_natom(gopt_env%force_env)
1355 nparticle = force_env_get_nparticle(gopt_env%force_env)
1356 CALL force_env_get(gopt_env%force_env, &
1358 CALL cp_subsys_get(subsys=subsys, &
1359 core_particles=core_particles, &
1360 particles=particles, &
1361 shell_particles=shell_particles)
1364 CALL cell_create(cell_ref)
1365 CALL cell_copy(cell, cell_ref, tag=
"CELL_OPT_REF")
1369 CALL init_cell(cell_ref, hmat=gopt_env%h_ref)
1370 cpassert((
SIZE(x) == idg + 6))
1372 IF (update_forces)
THEN
1377 CALL real_to_scaled(s, x(idg:idg + 2), cell)
1378 CALL scaled_to_real(x(idg:idg + 2), s, cell_ref)
1385 gopt_env%cell_env%opt_cell%hmat = 0.0_dp
1389 gopt_env%cell_env%opt_cell%hmat(j, i) = x(idg)
1392 CALL init_cell(gopt_env%cell_env%opt_cell)
1393 IF (gopt_env%spgr%keep_space_group)
THEN
1394 CALL spgr_project_cell_metric(gopt_env%spgr, gopt_env%cell_env%opt_cell)
1400 x(idg) = gopt_env%cell_env%opt_cell%hmat(j, i)
1406 cell%hmat = matmul(gopt_env%cell_env%opt_to_input, &
1407 gopt_env%cell_env%opt_cell%hmat)
1408 CALL init_cell(cell)
1409 CALL cp_subsys_set(subsys, cell=cell)
1414 CALL real_to_scaled(s, x(idg:idg + 2), cell_ref)
1415 shell_index = particles%els(iatom)%shell_index
1416 IF (shell_index == 0)
THEN
1417 CALL scaled_to_real(particles%els(iatom)%r, s, cell)
1419 CALL scaled_to_real(core_particles%els(shell_index)%r, s, cell)
1420 i = 3*(natom + shell_index - 1) + 1
1421 CALL real_to_scaled(s, x(i:i + 2), cell_ref)
1422 CALL scaled_to_real(shell_particles%els(shell_index)%r, s, cell)
1424 mass = particles%els(iatom)%atomic_kind%mass
1425 fc = core_particles%els(shell_index)%atomic_kind%shell%mass_core/mass
1426 fs = shell_particles%els(shell_index)%atomic_kind%shell%mass_shell/mass
1427 particles%els(iatom)%r(1:3) = fc*core_particles%els(shell_index)%r(1:3) + &
1428 fs*shell_particles%els(shell_index)%r(1:3)
1434 CALL cell_release(cell_ref)
represent a simple array based list of the given type
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public henkelman1999
Handles all functions related to the CELL.
subroutine, public write_cell(cell, subsys_section, tag)
Write the cell parameters to the output unit.
subroutine, public init_cell(cell, hmat, periodic)
Initialise/readjust a simulation cell after hmat has been changed.
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
contains a functional that calculates the energy and its derivatives for the geometry optimizer
subroutine, public rescale_new_cell_volume(vol, x, idg)
Rescale x(idg+1:idg+6) according to vol.
subroutine, public get_dg_dh(gradient, av_ptens, pres_ext, cell, mtrx, keep_angles, keep_symmetry, pres_int, pres_constr, constraint_id)
Computes the derivatives for the cell.
Handles all functions related to the CELL.
subroutine, public scaled_to_real(r, s, cell)
Transform scaled cell coordinates real coordinates. r=h*s.
subroutine, public real_to_scaled(s, r, cell)
Transform real to scaled cell coordinates. s=h_inv*r.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public cell_copy(cell_in, cell_out, tag)
Copy cell variable.
various routines to log and control the output. The idea is that decisions about where to log should ...
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_set(subsys, atomic_kinds, particles, local_particles, molecules, molecule_kinds, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, results, cell, cell_ref, use_ref_cell)
sets various propreties of the subsys
subroutine, public unpack_subsys_particles(subsys, f, r, s, v, fscale, cell)
Unpack components of a subsystem particle sets into a single vector.
subroutine, public cp_subsys_get(subsys, ref_count, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell)
returns information about various attributes of the given subsys
subroutine, public pack_subsys_particles(subsys, f, r, s, v, fscale, cell)
Pack components of a subsystem particle sets into a single vector.
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Contains types used for a Dimer Method calculations.
recursive subroutine, public cp_eval_at_ts(gopt_env, x, f, gradient, calc_force)
Computes the dimer energy/gradients (including the rotation of the dimer)
Contains types used for a Dimer Method calculations.
Contains utilities for a Dimer Method calculations.
subroutine, public update_dimer_vec(dimer_env, motion_section)
Updates the orientation of the dimer vector in the input file.
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Interface for the force calculations.
recursive subroutine, public force_env_calc_energy_force(force_env, calc_force, consistent_energies, skip_external_control, eval_energy_forces, require_consistent_energy_force, linres, calc_stress_tensor)
Interface routine for force and energy calculations.
Interface for the force calculations.
integer function, public force_env_get_natom(force_env)
returns the number of atoms
integer, parameter, public use_qmmm
recursive subroutine, public force_env_get(force_env, in_use, fist_env, qs_env, meta_env, fp_env, subsys, para_env, potential_energy, additional_potential, kinetic_energy, harmonic_shell, kinetic_shell, cell, sub_force_env, qmmm_env, qmmmx_env, eip_env, pwdft_env, globenv, input, force_env_section, method_name_id, root_section, mixed_env, nnp_env, embed_env, ipi_env)
returns various attributes about the force environment
integer, parameter, public use_qmmmx
integer function, public force_env_get_nparticle(force_env)
returns the number of particles in a force environment
contains a functional that calculates the energy and its derivatives for the geometry optimizer
subroutine, public print_geo_opt_header(gopt_env, output_unit, label)
...
subroutine, public gopt_f_io_init(gopt_env, output_unit, opt_energy, wildcard, its, used_time)
Handles the Output during an optimization run.
subroutine, public gopt_f_create_x0(gopt_env, x0)
returns the value of the parameters for the actual configuration
recursive subroutine, public gopt_f_io_finalize(gopt_env, force_env, x0, conv, its, root_section, para_env, master, output_unit)
Handles the Output at the end of an optimization run.
subroutine, public apply_cell_change(gopt_env, cell, x, update_forces)
Apply coordinate transformations after cell (shape) change.
subroutine, public gopt_f_io(gopt_env, force_env, root_section, its, opt_energy, output_unit, eold, emin, wildcard, gopt_param, ndf, dx, xi, conv, pred, rat, step, rad, used_time)
Handles the Output during an optimization run.
subroutine, public print_geo_opt_nc(gopt_env, output_unit)
...
subroutine, public cp_eval_at(gopt_env, x, f, gradient, master, final_evaluation, para_env)
evaluete the potential energy and its gradients using an array with same dimension as the particle_se...
subroutine, public gopt_f_ii(its, output_unit)
Prints iteration step of the optimization procedure on screen.
contains a functional that calculates the energy and its derivatives for the geometry optimizer
contains typo and related routines to handle parameters controlling the GEO_OPT module
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
integer, parameter, public default_string_length
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
prints all energy info per timestep to the screen or to user defined output files
integer(kind=int_8) function, public sample_memory(para_env)
Samples memory usage.
Interface to the message passing library MPI.
Output Utilities for MOTION_SECTION.
subroutine, public write_simulation_cell(cell, motion_section, itimes, time, pos, act)
Prints the Simulation Cell.
subroutine, public write_trajectory(force_env, root_section, it, time, dtime, etot, pk_name, pos, act, middle_name, particles, extended_xmol_title)
Prints the information controlled by the TRAJECTORY section.
subroutine, public write_stress_tensor_to_file(virial, cell, motion_section, itimes, time, pos, act)
Prints the Stress Tensor.
represent a simple array based list of the given type
Define methods related to particle_type.
subroutine, public write_final_structure(particle_set, cell, input_section, conv, keep_angles, keep_symmetry, keep_volume, gopt_env_label, constraint_label)
Write the final geometry and cell information to files.
subroutine, public write_structure_data(particle_set, cell, input_section)
Write structure data requested by a separate structure data input section to the output unit....
Define the data structure for the particle information.
subroutine, public apply_qmmm_translate(qmmm_env)
Apply translation to the full system in order to center the QM system into the QM box.
Routines used for force-mixing QM/MM calculations.
subroutine, public apply_qmmmx_translate(qmmmx_env)
Apply translation to the full system in order to center the QM system into the QM box.
Space Group Symmetry Type Module (version 1.0, Ferbruary 12, 2021)
Space Group Symmetry Module (version 1.0, January 16, 2020)
subroutine, public spgr_apply_rotations_stress(spgr, cell, stress)
routine applies the rotation matrices to the stress tensor.
subroutine, public spgr_project_cell_metric(spgr, cell)
Project a cell onto the metric preserved by the selected space-group rotations.
subroutine, public spgr_apply_rotations_force(spgr, force)
routine applies the rotation matrices to the forces.
subroutine, public spgr_write_stress_tensor(stress, spgr)
Variable precision output of the symmetrized stress tensor.
subroutine, public virial_evaluate(atomic_kind_set, particle_set, local_particles, virial, igroup)
Computes the kinetic part of the pressure tensor and updates the full VIRIAL (PV)
subroutine, public virial_update(virial, subsys, para_env)
Updates the virial given the virial and subsys.
represent a list of objects
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represents a system: atoms, molecules, their pos,vel,...
Defines the environment for a Dimer Method calculation.
structure to store local (to a processor) ordered lists of integers.
wrapper to abstract the force evaluation of the various methods
calculates the potential energy of a system, and its derivatives
stores all the informations relevant to an mpi environment
represent a list of objects