145#include "../base/base_uses.f90"
150 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .true.
151 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'pint_methods'
173 SUBROUTINE pint_create(pint_env, input, input_declaration, para_env)
175 TYPE(pint_env_type),
INTENT(OUT) :: pint_env
176 TYPE(section_vals_type),
POINTER :: input
177 TYPE(section_type),
POINTER :: input_declaration
178 TYPE(mp_para_env_type),
POINTER :: para_env
180 CHARACTER(len=*),
PARAMETER :: routineN =
'pint_create'
182 CHARACTER(len=2*default_string_length) :: msg
183 CHARACTER(len=default_path_length) :: output_file_name, project_name
184 INTEGER :: handle, iat, ibead, icont, idim, idir, &
185 ierr, ig, itmp, nrep, prep, stat
186 LOGICAL :: explicit, ltmp
187 REAL(kind=
dp) :: dt, mass, omega
188 TYPE(cp_subsys_type),
POINTER :: subsys
189 TYPE(f_env_type),
POINTER :: f_env
190 TYPE(global_constraint_type),
POINTER :: gci
191 TYPE(particle_list_type),
POINTER :: particles
192 TYPE(replica_env_type),
POINTER :: rep_env
193 TYPE(section_vals_type),
POINTER :: constraint_section, gle_section, nose_section, &
194 piglet_section, pile_section, pint_section, qtb_section, transform_section
196 CALL timeset(routinen, handle)
198 NULLIFY (f_env, subsys, particles, nose_section, gle_section, gci)
200 cpassert(
ASSOCIATED(input))
201 cpassert(input%ref_count > 0)
209 IF ((prep < 1) .OR. (prep > para_env%num_pe) .OR. &
210 (mod(prep*nrep, para_env%num_pe) /= 0))
THEN
211 prep = para_env%num_pe/
gcd(para_env%num_pe, nrep)
212 IF (para_env%is_source())
THEN
213 WRITE (unit=msg, fmt=*)
"PINT WARNING: Adjusting number of processors per replica to ", prep
228 input_declaration=input_declaration, nrep=nrep, prep=prep, row_force=.true.)
230 IF (len_trim(output_file_name) > 0)
THEN
235 IF (.NOT.
ASSOCIATED(rep_env))
RETURN
237 NULLIFY (pint_env%logger)
241 NULLIFY (pint_env%replicas, pint_env%input, pint_env%staging_env, &
242 pint_env%normalmode_env, pint_env%propagator)
244 pint_env%replicas => rep_env
245 pint_env%ndim = rep_env%ndim
246 pint_env%input => input
253 pint_env%first_step = itmp
259 pint_env%last_step = itmp
260 pint_env%num_steps = pint_env%last_step - pint_env%first_step
264 pint_env%num_steps = itmp
265 pint_env%last_step = pint_env%first_step + pint_env%num_steps
270 pint_env%t = pint_env%first_step*pint_env%dt
275 r_val=pint_env%t_tol)
279 ALLOCATE (pint_env%propagator)
281 i_val=pint_env%propagator%prop_kind)
285 pint_env%propagator%temp_phys2sim = real(pint_env%p,
dp)
286 pint_env%propagator%physpotscale = 1.0_dp
288 pint_env%propagator%temp_phys2sim = 1.0_dp
289 pint_env%propagator%physpotscale = 1.0_dp/real(pint_env%p,
dp)
291 pint_env%propagator%temp_sim2phys = 1.0_dp/pint_env%propagator%temp_phys2sim
292 pint_env%kT = pint_env%kT*pint_env%propagator%temp_phys2sim
295 i_val=pint_env%transform)
299 cpabort(
"CMD propagator without normal modes not implemented!")
304 cpabort(
"BCMD propagator without normal modes not implemented!")
307 NULLIFY (pint_env%tx, pint_env%tv, pint_env%tv_t, pint_env%tv_old, pint_env%tv_new, pint_env%tf)
315 cpabort(
"RPMD propagator with Nose-thermostat not implemented!")
318 cpabort(
"BCMD propagator with Nose-thermostat not implemented!")
321 IF (pint_env%nnos > 0)
THEN
324 pint_env%tx(pint_env%nnos, pint_env%p, pint_env%ndim), &
325 pint_env%tv(pint_env%nnos, pint_env%p, pint_env%ndim), &
326 pint_env%tv_t(pint_env%nnos, pint_env%p, pint_env%ndim), &
327 pint_env%tv_old(pint_env%nnos, pint_env%p, pint_env%ndim), &
328 pint_env%tv_new(pint_env%nnos, pint_env%p, pint_env%ndim), &
329 pint_env%tf(pint_env%nnos, pint_env%p, pint_env%ndim))
332 pint_env%tv_t = 0._dp
333 pint_env%tv_old = 0._dp
334 pint_env%tv_new = 0._dp
339 pint_env%beta = 1._dp/(pint_env%kT*pint_env%propagator%temp_sim2phys)
345 pint_env%v_tol = 0.0_dp
348 name=
"pint_randomG", &
350 extended_precision=.true.)
352 ALLOCATE (pint_env%e_pot_bead(pint_env%p))
353 pint_env%e_pot_bead = 0._dp
354 pint_env%e_pot_h = 0._dp
355 pint_env%e_kin_beads = 0._dp
356 pint_env%e_pot_t = 0._dp
357 pint_env%e_gle = 0._dp
358 pint_env%e_pile = 0._dp
359 pint_env%e_piglet = 0._dp
360 pint_env%e_qtb = 0._dp
361 pint_env%e_kin_t = 0._dp
362 pint_env%energy(:) = 0.0_dp
367 pint_env%x(pint_env%p, pint_env%ndim), &
368 pint_env%v(pint_env%p, pint_env%ndim), &
369 pint_env%f(pint_env%p, pint_env%ndim), &
370 pint_env%external_f(pint_env%p, pint_env%ndim), &
371 pint_env%ux(pint_env%p, pint_env%ndim), &
372 pint_env%ux_t(pint_env%p, pint_env%ndim), &
373 pint_env%uv(pint_env%p, pint_env%ndim), &
374 pint_env%uv_t(pint_env%p, pint_env%ndim), &
375 pint_env%uv_new(pint_env%p, pint_env%ndim), &
376 pint_env%uf(pint_env%p, pint_env%ndim), &
377 pint_env%uf_h(pint_env%p, pint_env%ndim), &
378 pint_env%centroid(pint_env%ndim), &
379 pint_env%rtmp_ndim(pint_env%ndim), &
380 pint_env%rtmp_natom(pint_env%ndim/3), &
386 pint_env%external_f = 0._dp
388 pint_env%ux_t = 0._dp
390 pint_env%uv_t = 0._dp
391 pint_env%uv_new = 0._dp
393 pint_env%uf_h = 0._dp
394 pint_env%centroid(:) = 0.0_dp
395 pint_env%rtmp_ndim = 0._dp
396 pint_env%rtmp_natom = 0._dp
397 pint_env%time_per_step = 0.0_dp
401 "MOTION%PINT%STAGING")
402 ALLOCATE (pint_env%staging_env)
404 p=pint_env%p, kt=pint_env%kT)
407 "MOTION%PINT%NORMALMODE")
412 r_val=sqrt(2.0_dp/(pint_env%p*pint_env%dt*pint_env%kT)))
415 r_val=0.5_dp*pint_env%p*pint_env%dt*pint_env%kT)
418 ALLOCATE (pint_env%normalmode_env)
420 transform_section, p=pint_env%p, kt=pint_env%kT, propagator=pint_env%propagator%prop_kind)
421 IF (para_env%is_source())
THEN
423 IF (10.0_dp*pint_env%dt/real(pint_env%nrespa,
dp) > &
424 twopi/(pint_env%p*sqrt(maxval(pint_env%normalmode_env%lambda))* &
425 pint_env%normalmode_env%modefactor))
THEN
426 msg =
"PINT WARNING| Number of RESPA steps to small "// &
427 "to integrate the harmonic springs."
433 ALLOCATE (pint_env%mass(pint_env%ndim))
441 DO iat = 1, pint_env%ndim/3
445 pint_env%mass(idim) = mass
451 ALLOCATE (pint_env%Q(pint_env%p), &
452 pint_env%mass_beads(pint_env%p, pint_env%ndim), &
453 pint_env%mass_fict(pint_env%p, pint_env%ndim))
456 mass_beads=pint_env%mass_beads, mass_fict=pint_env%mass_fict, &
460 mass=pint_env%mass, mass_beads=pint_env%mass_beads, &
461 mass_fict=pint_env%mass_fict, q=pint_env%Q)
464 NULLIFY (pint_env%gle)
468 ALLOCATE (pint_env%gle)
469 CALL gle_init(pint_env%gle, dt=pint_env%dt/pint_env%nrespa, temp=pint_env%kT, &
471 IF (pint_env%pimd_thermostat ==
thermostat_none .AND. pint_env%gle%ndim > 0)
THEN
476 pint_env%gle%loc_num_gle = pint_env%p*pint_env%ndim
477 pint_env%gle%glob_num_gle = pint_env%gle%loc_num_gle
478 ALLOCATE (pint_env%gle%map_info%index(pint_env%gle%loc_num_gle))
480 DO itmp = 1, pint_env%gle%loc_num_gle
481 pint_env%gle%map_info%index(itmp) = itmp
488 CALL gle_matrix_exp((-pint_env%dt/pint_env%nrespa*0.5_dp)*pint_env%gle%a_mat, &
489 pint_env%gle%ndim, 15, 15, pint_env%gle%gle_t)
492 matmul(pint_env%gle%c_mat, transpose(pint_env%gle%gle_t))), &
493 pint_env%gle%gle_s, pint_env%gle%ndim)
500 NULLIFY (pint_env%pile_therm)
506 "MOTION%PINT%INIT%THERMOSTAT_SEED", &
507 i_val=pint_env%thermostat_rng_seed)
510 ALLOCATE (pint_env%pile_therm)
513 normalmode_env=pint_env%normalmode_env, &
514 section=pile_section)
516 cpabort(
"PILE thermostat can't be used with another thermostat.")
521 NULLIFY (pint_env%piglet_therm)
527 "MOTION%PINT%INIT%THERMOSTAT_SEED", &
528 i_val=pint_env%thermostat_rng_seed)
531 ALLOCATE (pint_env%piglet_therm)
538 dt=pint_env%dt, para_env=para_env)
540 cpabort(
"PIGLET thermostat can't be used with another thermostat.")
545 NULLIFY (pint_env%qtb_therm)
551 "MOTION%PINT%INIT%THERMOSTAT_SEED", &
552 i_val=pint_env%thermostat_rng_seed)
557 normalmode_env=pint_env%normalmode_env, &
560 cpabort(
"QTB thermostat can't be used with another thermostat.")
570 IF (.NOT. explicit)
THEN
574 "MOTION%PINT%INIT%THERMOSTAT_SEED", &
575 i_val=pint_env%thermostat_rng_seed)
577 ALLOCATE (pint_env%pile_therm)
580 normalmode_env=pint_env%normalmode_env, &
581 section=pile_section)
584 cpabort(
"PILE/no thermostat currently needed for BCMD")
593 WRITE (unit=msg, fmt=*)
"PINT WARNING| Nose Thermostat only available in "// &
594 "the numeric harmonic integrator. Switching to numeric harmonic integrator."
599 WRITE (unit=msg, fmt=*)
"PINT WARNING| GLE Thermostat only available in "// &
600 "the numeric harmonic integrator. Switching to numeric harmonic integrator."
606 WRITE (unit=msg, fmt=*)
"PINT WARNING| PILE Thermostat only available in "// &
607 "the exact harmonic integrator. Switching to exact harmonic integrator."
612 WRITE (unit=msg, fmt=*)
"PINT WARNING| PIGLET Thermostat only available in "// &
613 "the exact harmonic integrator. Switching to exact harmonic integrator."
618 WRITE (unit=msg, fmt=*)
"PINT WARNING| QTB Thermostat only available in "// &
619 "the exact harmonic integrator. Switching to exact harmonic integrator."
624 WRITE (unit=msg, fmt=*)
"PINT WARNING| BCMD needs the exact harmonic "// &
625 "integrator. Switching to exact harmonic integrator."
632 IF (pint_env%nrespa /= 1)
THEN
634 WRITE (unit=msg, fmt=*)
"PINT WARNING| Adjusting NRESPA to 1 for exact harmonic integration."
637 NULLIFY (pint_env%wsinex)
638 ALLOCATE (pint_env%wsinex(pint_env%p))
639 NULLIFY (pint_env%iwsinex)
640 ALLOCATE (pint_env%iwsinex(pint_env%p))
641 NULLIFY (pint_env%cosex)
642 ALLOCATE (pint_env%cosex(pint_env%p))
643 dt = pint_env%dt/real(pint_env%nrespa, kind=
dp)
645 pint_env%wsinex(1) = 0.0_dp
646 pint_env%iwsinex(1) = dt
647 pint_env%cosex(1) = 1.0_dp
648 DO ibead = 2, pint_env%p
649 omega = sqrt(pint_env%normalmode_env%lambda(ibead))
650 pint_env%wsinex(ibead) = sin(omega*dt)*omega
651 pint_env%iwsinex(ibead) = sin(omega*dt)/omega
652 pint_env%cosex(ibead) = cos(omega*dt)
659 pint_env%first_propagated_mode = 2
661 pint_env%first_propagated_mode = 1
665 NULLIFY (pint_env%simpar)
670 pint_env%simpar%constraint = explicit
671 pint_env%kTcorr = 1.0_dp
674 pint_env%beadwise_constraints = .false.
676 l_val=pint_env%beadwise_constraints)
677 IF (pint_env%simpar%constraint)
THEN
678 IF (pint_env%beadwise_constraints)
THEN
689 cpabort(
"Constraints are not supported for staging transformation")
694 WRITE (unit=msg, fmt=*)
"GLE Thermostat not supported for "// &
695 "constraints. Switch to NOSE for numeric integration."
701 IF (pint_env%beadwise_constraints)
THEN
702 cpabort(
"Beadwise constraints are not supported for NOSE Thermostat.")
705 WRITE (unit=msg, fmt=*)
"PINT WARNING| Nose Thermostat set to "// &
706 "zero for constrained atoms. Careful interpretation of temperature."
708 WRITE (unit=msg, fmt=*)
"PINT WARNING| Lagrange multipliers are "// &
709 "are printed every RESPA step and need to be treated carefully."
715 r_val=pint_env%simpar%shake_tol)
717 constraint_section, &
719 extension=
".shakeLog", &
720 log_filename=.false.)
722 constraint_section, &
723 "LAGRANGE_MULTIPLIERS", &
724 extension=
".LagrangeMultLog", &
725 log_filename=.false.)
726 pint_env%simpar%dump_lm = &
728 constraint_section, &
732 pint_env%n_atoms_constraints = 0
733 DO ig = 1, gci%ncolv%ntot
735 pint_env%n_atoms_constraints = pint_env%n_atoms_constraints +
SIZE(gci%colv_list(ig)%i_atoms)
738 ALLOCATE (pint_env%atoms_constraints(pint_env%n_atoms_constraints))
740 DO ig = 1, gci%ncolv%ntot
741 DO iat = 1,
SIZE(gci%colv_list(ig)%i_atoms)
743 pint_env%atoms_constraints(icont) = gci%colv_list(ig)%i_atoms(iat)
751 pint_env%kTcorr = 1.0_dp + real(3*pint_env%n_atoms_constraints,
dp)/(real(pint_env%ndim,
dp)*real(pint_env%p,
dp))
755 CALL timestop(handle)
757 END SUBROUTINE pint_create
766 SUBROUTINE pint_release(pint_env)
767 TYPE(pint_env_type),
INTENT(INOUT) :: pint_env
771 IF (
ASSOCIATED(pint_env%staging_env))
THEN
773 DEALLOCATE (pint_env%staging_env)
775 IF (
ASSOCIATED(pint_env%normalmode_env))
THEN
777 DEALLOCATE (pint_env%normalmode_env)
780 DEALLOCATE (pint_env%mass)
781 DEALLOCATE (pint_env%e_pot_bead)
783 DEALLOCATE (pint_env%x)
784 DEALLOCATE (pint_env%v)
785 DEALLOCATE (pint_env%f)
786 DEALLOCATE (pint_env%external_f)
787 DEALLOCATE (pint_env%mass_beads)
788 DEALLOCATE (pint_env%mass_fict)
789 DEALLOCATE (pint_env%ux)
790 DEALLOCATE (pint_env%ux_t)
791 DEALLOCATE (pint_env%uv)
792 DEALLOCATE (pint_env%uv_t)
793 DEALLOCATE (pint_env%uv_new)
794 DEALLOCATE (pint_env%uf)
795 DEALLOCATE (pint_env%uf_h)
796 DEALLOCATE (pint_env%centroid)
797 DEALLOCATE (pint_env%rtmp_ndim)
798 DEALLOCATE (pint_env%rtmp_natom)
799 DEALLOCATE (pint_env%propagator)
801 IF (pint_env%simpar%constraint)
THEN
802 DEALLOCATE (pint_env%atoms_constraints)
807 DEALLOCATE (pint_env%wsinex)
808 DEALLOCATE (pint_env%iwsinex)
809 DEALLOCATE (pint_env%cosex)
812 SELECT CASE (pint_env%pimd_thermostat)
814 DEALLOCATE (pint_env%tx)
815 DEALLOCATE (pint_env%tv)
816 DEALLOCATE (pint_env%tv_t)
817 DEALLOCATE (pint_env%tv_old)
818 DEALLOCATE (pint_env%tv_new)
819 DEALLOCATE (pint_env%tf)
824 DEALLOCATE (pint_env%pile_therm)
827 DEALLOCATE (pint_env%piglet_therm)
830 DEALLOCATE (pint_env%qtb_therm)
833 DEALLOCATE (pint_env%Q)
835 END SUBROUTINE pint_release
844 SUBROUTINE pint_test(para_env, input, input_declaration)
845 TYPE(mp_para_env_type),
POINTER :: para_env
846 TYPE(section_vals_type),
POINTER :: input
847 TYPE(section_type),
POINTER :: input_declaration
849 INTEGER :: i, ib, idim, unit_nr
850 REAL(kind=
dp) :: c, e_h, err
851 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: x1
852 TYPE(pint_env_type) :: pint_env
854 cpassert(
ASSOCIATED(para_env))
855 cpassert(
ASSOCIATED(input))
856 cpassert(para_env%is_valid())
857 cpassert(input%ref_count > 0)
859 CALL pint_create(pint_env, input, input_declaration, para_env)
860 ALLOCATE (x1(pint_env%ndim, pint_env%p))
861 x1(:, :) = pint_env%x
866 DO i = 1, pint_env%ndim
867 err = max(err, abs(x1(1, i) - pint_env%x(1, i)))
869 IF (unit_nr > 0)
WRITE (unit_nr, *)
"diff_r1="//
cp_to_string(err)
871 CALL pint_calc_uf_h(pint_env, e_h=e_h)
872 c = -pint_env%staging_env%w_p**2
874 DO idim = 1, pint_env%ndim
875 DO ib = 1, pint_env%p
876 pint_env%f(ib, idim) = pint_env%f(ib, idim) + &
877 c*(2._dp*pint_env%x(ib, idim) &
878 - pint_env%x(
modulo(ib - 2, pint_env%p) + 1, idim) &
879 - pint_env%x(
modulo(ib, pint_env%p) + 1, idim))
884 DO idim = 1, pint_env%ndim
885 DO ib = 1, pint_env%p
886 err = max(err, abs(pint_env%uf(ib, idim) - pint_env%uf_h(ib, idim)))
889 IF (unit_nr > 0)
WRITE (unit_nr, *)
"diff_f_h="//
cp_to_string(err)
891 END SUBROUTINE pint_test
906 SUBROUTINE do_pint_run(para_env, input, input_declaration, globenv)
912 CHARACTER(len=*),
PARAMETER :: routinen =
'do_pint_run'
913 INTEGER,
PARAMETER :: helium_only_mid = 1, &
914 int_pot_scan_mid = 4, &
915 solute_only_mid = 2, &
916 solute_with_helium_mid = 3
918 CHARACTER(len=default_string_length) :: stmp
919 INTEGER :: handle, mode
920 LOGICAL :: explicit, helium_only, int_pot_scan, &
926 CALL timeset(routinen, handle)
928 cpassert(
ASSOCIATED(para_env))
929 cpassert(
ASSOCIATED(input))
930 cpassert(para_env%is_valid())
931 cpassert(input%ref_count > 0)
934 NULLIFY (helium_section)
936 "MOTION%PINT%HELIUM")
940 l_val=solvent_present)
942 solvent_present = .false.
946 IF (solvent_present)
THEN
950 helium_only = .false.
954 IF (solvent_present)
THEN
958 int_pot_scan = .false.
962 IF (helium_only .AND. int_pot_scan)
THEN
963 stmp =
"Options HELIUM_ONLY and INTERACTION_POT_SCAN are exclusive"
969 IF (solvent_present)
THEN
970 IF (helium_only)
THEN
971 mode = helium_only_mid
973 IF (int_pot_scan)
THEN
974 mode = int_pot_scan_mid
976 mode = solute_with_helium_mid
980 mode = solute_only_mid
986 CASE (helium_only_mid)
992 CASE (solute_only_mid)
993 CALL pint_create(pint_env, input, input_declaration, para_env)
994 CALL pint_init(pint_env)
995 CALL pint_do_run(pint_env, globenv)
996 CALL pint_release(pint_env)
998 CASE (int_pot_scan_mid)
999 CALL pint_create(pint_env, input, input_declaration, para_env)
1003 CALL pint_init(pint_env)
1005 CALL pint_run_scan(pint_env, helium_env)
1007 CALL pint_release(pint_env)
1009 CASE (solute_with_helium_mid)
1010 CALL pint_create(pint_env, input, input_declaration, para_env)
1012 CALL pint_init(pint_env)
1017 CALL pint_init_f(pint_env, helium_env=helium_env)
1019 CALL pint_do_run(pint_env, globenv, helium_env=helium_env)
1021 CALL pint_release(pint_env)
1024 cpabort(
"Unknown mode ("//trim(adjustl(
cp_to_string(mode)))//
")")
1027 CALL timestop(handle)
1040 SUBROUTINE pint_init(pint_env)
1044 CALL pint_init_x(pint_env)
1045 CALL pint_init_v(pint_env)
1046 CALL pint_init_t(pint_env)
1047 CALL pint_init_f(pint_env)
1049 END SUBROUTINE pint_init
1066 SUBROUTINE pint_init_x(pint_env)
1070 CHARACTER(len=5*default_string_length) :: msg, tmp
1071 INTEGER :: ia, ib, ic, idim, input_seed, n_rep_val
1072 LOGICAL :: done_init, done_levy, done_rand, &
1073 explicit, levycorr, ltmp
1074 REAL(kind=
dp) :: tcorr, var
1075 REAL(kind=
dp),
DIMENSION(3) :: x0
1076 REAL(kind=
dp),
DIMENSION(3, 2) :: seed
1077 REAL(kind=
dp),
DIMENSION(:),
POINTER :: bx, r_vals
1081 DO idim = 1, pint_env%ndim
1082 DO ib = 1, pint_env%p
1083 pint_env%x(ib, idim) = pint_env%replicas%r(idim, ib)
1089 "MOTION%PINT%INIT%LEVY_POS_SAMPLE", &
1092 "MOTION%PINT%INIT%LEVY_TEMP_FACTOR", &
1096 IF (pint_env%beadwise_constraints)
THEN
1097 WRITE (unit=msg, fmt=*)
"Beadwise constraints are not supported for "// &
1098 "the initialization of the beads as free particles. "// &
1099 "Please use hot start (default)."
1104 ALLOCATE (bx(3*pint_env%p))
1106 "MOTION%PINT%INIT%LEVY_SEED", i_val=input_seed)
1107 seed(:, :) = real(input_seed, kind=
dp)
1110 name=
"tmp_rng_gaussian", &
1112 extended_precision=.true., &
1116 "MOTION%PINT%INIT%LEVY_CORRELATED", &
1122 x0 = [0.0_dp, 0.0_dp, 0.0_dp]
1125 DO ia = 1, pint_env%ndim/3
1126 var = sqrt(1.0_dp/(pint_env%kT*tcorr*pint_env%mass(3*ia)))
1129 DO ib = 1, pint_env%p
1130 pint_env%x(ib, idim) = pint_env%x(ib, idim) + bx(3*(ib - 1) + ic)*var
1139 DO ia = 1, pint_env%ndim/3
1140 x0(1) = pint_env%x(1, 3*(ia - 1) + 1)
1141 x0(2) = pint_env%x(1, 3*(ia - 1) + 2)
1142 x0(3) = pint_env%x(1, 3*(ia - 1) + 3)
1143 var = sqrt(1.0_dp/(pint_env%kT*tcorr*pint_env%mass(3*ia)))
1147 DO ib = 1, pint_env%p
1148 pint_env%x(ib, idim) = pint_env%x(ib, idim) + bx(3*(ib - 1) + ic)
1160 NULLIFY (input_section)
1162 "MOTION%PINT%BEADS%COORD")
1166 n_rep_val=n_rep_val)
1167 IF (n_rep_val > 0)
THEN
1168 cpassert(n_rep_val == 1)
1171 IF (
SIZE(r_vals) /= pint_env%p*pint_env%ndim) &
1172 cpabort(
"Invalid size of MOTION%PINT%BEADS%COORD")
1174 DO idim = 1, pint_env%ndim
1175 DO ib = 1, pint_env%p
1177 pint_env%x(ib, idim) = r_vals(ic)
1186 "MOTION%PINT%INIT%RANDOMIZE_POS", &
1190 IF (pint_env%beadwise_constraints)
THEN
1191 WRITE (unit=msg, fmt=*)
"Beadwise constraints are not supported if "// &
1192 "a random noise is applied to the initialization of the bead positions. "// &
1193 "Please use hot start (default)."
1197 DO idim = 1, pint_env%ndim
1198 DO ib = 1, pint_env%p
1199 pint_env%x(ib, idim) = pint_env%x(ib, idim) + &
1200 pint_env%randomG%next(variance=pint_env%beta/ &
1201 sqrt(12.0_dp*pint_env%mass(idim)))
1207 WRITE (tmp,
'(A)')
"Bead positions initialization:"
1209 WRITE (msg,
'(A,A)') trim(tmp),
" input structure"
1210 ELSE IF (done_levy)
THEN
1211 WRITE (msg,
'(A,A)') trim(tmp),
" Levy random walk"
1213 WRITE (msg,
'(A,A)') trim(tmp),
" hot start"
1218 WRITE (msg,
'(A,F6.3)')
"Levy walk at effective temperature: ", tcorr
1222 WRITE (msg,
'(A)')
"Added gaussian noise to the positions of the beads."
1226 END SUBROUTINE pint_init_x
1249 SUBROUTINE pint_init_v(pint_env)
1252 CHARACTER(len=default_string_length) :: msg, stmp, stmp1, stmp2, unit_str
1253 INTEGER :: first_mode, i, ia, ib, ic, idim, ierr, &
1254 itmp, j, n_rep_val, nparticle, &
1256 LOGICAL :: done_init, done_quench, done_scale, &
1257 done_sped, explicit, ltmp, vels_present
1258 REAL(kind=
dp) :: actual_t, ek, factor, rtmp, target_t, &
1260 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: vel
1261 REAL(kind=
dp),
DIMENSION(:),
POINTER :: r_vals
1284 IF (pint_env%simpar%constraint)
THEN
1285 NULLIFY (subsys, cell)
1286 NULLIFY (atomic_kinds, local_particles, particles)
1287 NULLIFY (local_molecules, molecules, molecule_kinds, gci)
1288 NULLIFY (atomic_kind_set, molecule_kind_set, particle_set, molecule_set)
1291 CALL force_env_get(force_env=f_env%force_env, subsys=subsys)
1298 atomic_kinds=atomic_kinds, &
1299 local_particles=local_particles, &
1300 particles=particles, &
1301 local_molecules=local_molecules, &
1302 molecules=molecules, &
1303 molecule_kinds=molecule_kinds, &
1306 nparticle_kind = atomic_kinds%n_els
1307 atomic_kind_set => atomic_kinds%els
1308 molecule_kind_set => molecule_kinds%els
1309 nparticle = particles%n_els
1310 particle_set => particles%els
1311 molecule_set => molecules%els
1314 ALLOCATE (vel(3, nparticle))
1316 CALL getold(gci, local_molecules, molecule_set, &
1317 molecule_kind_set, particle_set, cell)
1321 vels_present = .false.
1322 NULLIFY (input_section)
1324 "FORCE_EVAL%SUBSYS%VELOCITY")
1335 n_rep_val=n_rep_val)
1337 WRITE (stmp, *) n_rep_val
1338 msg =
"Invalid number of atoms in FORCE_EVAL%SUBSYS%VELOCITY ("// &
1339 trim(adjustl(stmp))//
")."
1340 IF (3*n_rep_val /= pint_env%ndim) &
1342 DO ia = 1, pint_env%ndim/3
1344 i_rep_val=ia, r_vals=r_vals)
1347 WRITE (stmp, *) itmp
1348 msg =
"Number of coordinates != 3 in FORCE_EVAL%SUBSYS%VELOCITY ("// &
1349 trim(adjustl(stmp))//
")."
1352 DO ib = 1, pint_env%p
1354 idim = 3*(ia - 1) + ic
1355 pint_env%v(ib, idim) = r_vals(ic)*unit_conv
1360 vels_present = .true.
1364 IF (vels_present)
THEN
1367 DO ia = 1, pint_env%ndim/3
1370 idim = 3*(ia - 1) + ic
1371 rtmp = rtmp + pint_env%v(1, idim)*pint_env%v(1, idim)
1373 ek = ek + 0.5_dp*pint_env%mass(idim)*rtmp
1375 actual_t = 2.0_dp*ek/pint_env%ndim
1378 actual_t = pint_env%kT
1382 target_t = pint_env%kT
1384 "MOTION%PINT%INIT%VELOCITY_SCALE", &
1386 IF (vels_present)
THEN
1387 IF (done_scale)
THEN
1389 rtmp = sqrt(target_t/actual_t)
1390 DO ia = 1, pint_env%ndim/3
1391 DO ib = 1, pint_env%p
1393 idim = 3*(ia - 1) + ic
1394 pint_env%v(ib, idim) = rtmp*pint_env%v(ib, idim)
1404 IF (vels_present)
THEN
1406 CALL pint_x2u(pint_env, ux=pint_env%uv, x=pint_env%v)
1412 DO idim = 1,
SIZE(pint_env%uv, 2)
1413 DO ib = first_mode,
SIZE(pint_env%uv, 1)
1414 pint_env%uv(ib, idim) = &
1415 pint_env%randomG%next(variance=target_t/pint_env%mass_fict(ib, idim))
1422 "MOTION%PINT%INIT%CENTROID_SPEED", &
1425 CALL pint_u2x(pint_env, ux=pint_env%uv, x=pint_env%v)
1426 DO idim = 1, pint_env%ndim
1427 rtmp = pint_env%randomG%next(variance=pint_env%mass(idim)*pint_env%kT) &
1428 /pint_env%mass(idim)
1429 DO ib = 1, pint_env%p
1430 pint_env%v(ib, idim) = pint_env%v(ib, idim) + rtmp
1433 CALL pint_x2u(pint_env, ux=pint_env%uv, x=pint_env%v)
1439 done_quench = .false.
1441 "MOTION%PINT%INIT%VELOCITY_QUENCH", &
1444 DO idim = 1, pint_env%ndim
1445 DO ib = 1, pint_env%p
1446 pint_env%v(ib, idim) = 0.0_dp
1449 CALL pint_x2u(pint_env, ux=pint_env%uv, x=pint_env%v)
1450 done_quench = .true.
1456 NULLIFY (input_section)
1458 "MOTION%PINT%BEADS%VELOCITY")
1462 n_rep_val=n_rep_val)
1463 IF (n_rep_val > 0)
THEN
1464 cpassert(n_rep_val == 1)
1467 IF (
SIZE(r_vals) /= pint_env%p*pint_env%ndim) &
1468 cpabort(
"Invalid size of MOTION%PINT%BEAD%VELOCITY")
1470 DO idim = 1, pint_env%ndim
1471 DO ib = 1, pint_env%p
1473 pint_env%v(ib, idim) = r_vals(itmp)
1476 CALL pint_x2u(pint_env, ux=pint_env%uv, x=pint_env%v)
1482 WRITE (stmp1,
'(F10.2)') target_t*pint_env%propagator%temp_sim2phys*unit_conv
1483 msg =
"Bead velocities initialization:"
1485 msg = trim(msg)//
" input structure"
1486 ELSE IF (done_quench)
THEN
1487 msg = trim(msg)//
" quenching (set to 0.0)"
1489 IF (vels_present)
THEN
1490 msg = trim(adjustl(msg))//
" centroid +"
1492 msg = trim(adjustl(msg))//
" Maxwell-Boltzmann at "//trim(adjustl(stmp1))//
" K."
1496 IF (done_init .AND. done_quench)
THEN
1497 msg =
"WARNING: exclusive options requested (velocity restart and quenching)"
1499 msg =
"WARNING: velocity restart took precedence"
1503 IF ((.NOT. done_init) .AND. (.NOT. done_quench))
THEN
1504 IF (vels_present .AND. done_scale)
THEN
1505 WRITE (stmp1,
'(F10.2)') actual_t*unit_conv
1506 WRITE (stmp2,
'(F10.2)') target_t*unit_conv
1507 msg =
"Scaled initial velocities from "//trim(adjustl(stmp1))// &
1508 " to "//trim(adjustl(stmp2))//
" K as requested."
1512 msg =
"Added random component to the initial centroid velocities."
1518 IF (pint_env%simpar%constraint)
THEN
1521 factor = sqrt(real(pint_env%p,
dp))
1527 IF (pint_env%beadwise_constraints)
THEN
1528 IF (pint_env%logger%para_env%is_source())
THEN
1529 CALL pint_u2x(pint_env, ux=pint_env%uv, x=pint_env%v)
1530 DO ib = 1, pint_env%p
1536 particle_set(i)%r(j) = pint_env%x(1, j + (i - 1)*3)/factor
1537 vel(j, i) = pint_env%v(ib, j + (i - 1)*3)
1542 molecule_kind_set, pint_env%dt, &
1543 f_env%force_env%root_section)
1545 molecule_kind_set, particle_set, &
1546 vel, pint_env%dt, pint_env%simpar%shake_tol, &
1547 pint_env%simpar%info_constraint, &
1548 pint_env%simpar%lagrange_multipliers, &
1554 pint_env%v(ib, j + (i - 1)*3) = vel(j, i)
1559 CALL pint_x2u(pint_env, ux=pint_env%uv, x=pint_env%v)
1562 CALL pint_env%logger%para_env%bcast(pint_env%uv)
1566 IF (pint_env%logger%para_env%is_source())
THEN
1569 particle_set(i)%r(j) = pint_env%x(1, j + (i - 1)*3)/factor
1570 vel(j, i) = pint_env%uv(1, j + (i - 1)*3)/factor
1575 molecule_kind_set, pint_env%dt, &
1576 f_env%force_env%root_section)
1578 molecule_kind_set, particle_set, &
1579 vel, pint_env%dt, pint_env%simpar%shake_tol, &
1580 pint_env%simpar%info_constraint, &
1581 pint_env%simpar%lagrange_multipliers, &
1587 CALL pint_env%logger%para_env%bcast(vel)
1591 pint_env%uv(1, j + (i - 1)*3) = vel(j, i)*factor
1597 END SUBROUTINE pint_init_v
1607 SUBROUTINE pint_init_t(pint_env, kT)
1610 REAL(kind=
dp),
INTENT(in),
OPTIONAL :: kt
1612 INTEGER :: ib, idim, ii, inos, n_rep_val
1613 LOGICAL :: explicit, gle_restart
1614 REAL(kind=
dp) :: mykt
1615 REAL(kind=
dp),
DIMENSION(:),
POINTER :: r_vals
1621 IF (
PRESENT(kt)) mykt = kt
1622 DO idim = 1,
SIZE(pint_env%tv, 3)
1623 DO ib = 1,
SIZE(pint_env%tv, 2)
1624 DO inos = 1,
SIZE(pint_env%tv, 1)
1625 pint_env%tv(inos, ib, idim) = &
1626 pint_env%randomG%next(variance=mykt/pint_env%Q(ib))
1631 pint_env%tv(:, 1, :) = 0.0_dp
1634 NULLIFY (input_section)
1636 "MOTION%PINT%NOSE%COORD")
1640 n_rep_val=n_rep_val)
1641 IF (n_rep_val > 0)
THEN
1642 cpassert(n_rep_val == 1)
1645 IF (
SIZE(r_vals) /= pint_env%p*pint_env%ndim*pint_env%nnos) &
1646 cpabort(
"Invalid size of MOTION%PINT%NOSE%COORD")
1648 DO idim = 1, pint_env%ndim
1649 DO ib = 1, pint_env%p
1650 DO inos = 1, pint_env%nnos
1652 pint_env%tx(inos, ib, idim) = r_vals(ii)
1659 pint_env%tx(:, 1, :) = 0.0_dp
1662 NULLIFY (input_section)
1664 "MOTION%PINT%NOSE%VELOCITY")
1668 n_rep_val=n_rep_val)
1669 IF (n_rep_val > 0)
THEN
1670 cpassert(n_rep_val == 1)
1673 IF (
SIZE(r_vals) /= pint_env%p*pint_env%ndim*pint_env%nnos) &
1674 cpabort(
"Invalid size of MOTION%PINT%NOSE%VELOCITY")
1676 DO idim = 1, pint_env%ndim
1677 DO ib = 1, pint_env%p
1678 DO inos = 1, pint_env%nnos
1680 pint_env%tv(inos, ib, idim) = r_vals(ii)
1686 pint_env%tv(:, 1, :) = 0.0_dp
1691 NULLIFY (input_section)
1696 CALL restart_gle(pint_env%gle, input_section, save_mem=.false., &
1697 restart=gle_restart)
1701 END SUBROUTINE pint_init_t
1713 SUBROUTINE pint_init_f(pint_env, helium_env)
1716 OPTIONAL,
POINTER :: helium_env
1718 INTEGER :: ib, idim, inos
1719 REAL(kind=
dp) :: e_h
1726 CALL cp_iterate(logger%iter_info, iter_nr=pint_env%first_step)
1727 CALL cp_iterate(pint_env%logger%iter_info, iter_nr=pint_env%first_step)
1730 CALL pint_calc_uf_h(pint_env=pint_env, e_h=e_h)
1731 CALL pint_calc_f(pint_env)
1736 IF (
PRESENT(helium_env))
THEN
1737 IF (logger%para_env%is_source())
THEN
1738 pint_env%f(:, :) = pint_env%f(:, :) + helium_env(1)%helium%force_avrg(:, :)
1740 CALL logger%para_env%bcast(pint_env%f)
1745 IF (pint_env%first_propagated_mode == 2)
THEN
1746 pint_env%uf(1, :) = 0.0_dp
1749 CALL pint_calc_e_kin_beads_u(pint_env)
1750 CALL pint_calc_e_vir(pint_env)
1751 DO idim = 1,
SIZE(pint_env%uf_h, 2)
1752 DO ib = pint_env%first_propagated_mode,
SIZE(pint_env%uf_h, 1)
1753 pint_env%uf(ib, idim) = real(pint_env%nrespa,
dp)*pint_env%uf(ib, idim)
1757 IF (pint_env%nnos > 0)
THEN
1758 DO idim = 1,
SIZE(pint_env%uf_h, 2)
1759 DO ib = 1,
SIZE(pint_env%uf_h, 1)
1760 pint_env%tf(1, ib, idim) = (pint_env%mass_fict(ib, idim)* &
1761 pint_env%uv(ib, idim)**2 - pint_env%kT)/pint_env%Q(ib)
1765 DO idim = 1, pint_env%ndim
1766 DO ib = 1, pint_env%p
1767 DO inos = 1, pint_env%nnos - 1
1768 pint_env%tf(inos + 1, ib, idim) = pint_env%tv(inos, ib, idim)**2 - &
1769 pint_env%kT/pint_env%Q(ib)
1771 DO inos = 1, pint_env%nnos - 1
1772 pint_env%tf(inos, ib, idim) = pint_env%tf(inos, ib, idim) &
1773 - pint_env%tv(inos, ib, idim)*pint_env%tv(inos + 1, ib, idim)
1777 CALL pint_calc_nh_energy(pint_env)
1780 END SUBROUTINE pint_init_f
1797 SUBROUTINE pint_do_run(pint_env, globenv, helium_env)
1801 OPTIONAL,
POINTER :: helium_env
1804 LOGICAL :: should_stop
1805 REAL(kind=
dp) :: scal
1810 CALL cp_iterate(pint_env%logger%iter_info, iter_nr=pint_env%first_step)
1820 iter_nr=pint_env%first_step)
1823 pint_env%iter = pint_env%first_step
1825 IF (
PRESENT(helium_env))
THEN
1826 IF (
ASSOCIATED(helium_env))
THEN
1828 DO k = 1,
SIZE(helium_env)
1829 helium_env(k)%helium%proarea%accu(:) = 0.0_dp
1830 helium_env(k)%helium%prarea2%accu(:) = 0.0_dp
1831 helium_env(k)%helium%wnmber2%accu(:) = 0.0_dp
1832 helium_env(k)%helium%mominer%accu(:) = 0.0_dp
1833 IF (helium_env(k)%helium%rho_present)
THEN
1834 helium_env(k)%helium%rho_accu(:, :, :, :) = 0.0_dp
1836 IF (helium_env(k)%helium%rdf_present)
THEN
1837 helium_env(k)%helium%rdf_accu(:, :) = 0.0_dp
1844 CALL pint_calc_energy(pint_env)
1845 CALL pint_calc_total_action(pint_env)
1854 DO step = 1, pint_env%num_steps
1856 pint_env%iter = pint_env%iter + 1
1858 last=(step == pint_env%num_steps), &
1859 iter_nr=pint_env%iter)
1861 last=(step == pint_env%num_steps), &
1862 iter_nr=pint_env%iter)
1863 pint_env%t = pint_env%t + pint_env%dt
1865 IF (pint_env%t_tol > 0.0_dp)
THEN
1866 IF (abs(2._dp*pint_env%e_kin_beads/(pint_env%p*pint_env%ndim) &
1867 - pint_env%kT) > pint_env%t_tol)
THEN
1868 scal = sqrt(pint_env%kT*(pint_env%p*pint_env%ndim)/(2.0_dp*pint_env%e_kin_beads))
1869 pint_env%uv = scal*pint_env%uv
1870 CALL pint_init_f(pint_env, helium_env=helium_env)
1873 CALL pint_step(pint_env, helium_env=helium_env)
1883 pint_env=pint_env, helium_env=helium_env)
1887 IF (should_stop)
EXIT
1894 END SUBROUTINE pint_do_run
1905 SUBROUTINE pint_run_scan(pint_env, helium_env)
1909 CHARACTER(len=default_string_length) :: comment
1911 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER ::
DATA
1914 NULLIFY (pint_env%logger, print_key)
1918 IF (pint_env%logger%para_env%is_source())
THEN
1920 "MOTION%PINT%HELIUM%PRINT%RHO")
1928 IF (pint_env%logger%para_env%is_source())
THEN
1933 middle_name=
"helium-pot", &
1934 extension=
".cube", &
1935 file_position=
"REWIND", &
1938 comment =
"Solute - helium interaction potential"
1940 DATA => helium_env(1)%helium%rho_inst(1, :, :, :)
1944 helium_env(1)%helium%center - 0.5_dp* &
1945 (helium_env(1)%helium%rho_maxr - helium_env(1)%helium%rho_delr), &
1946 helium_env(1)%helium%rho_delr, &
1947 helium_env(1)%helium%rho_nbin, &
1959 END SUBROUTINE pint_run_scan
1973 SUBROUTINE pint_step(pint_env, helium_env)
1976 OPTIONAL,
POINTER :: helium_env
1978 CHARACTER(len=*),
PARAMETER :: routinen =
'pint_step'
1980 INTEGER :: handle, i, ia, ib, idim, ierr, inos, &
1981 iresp, j, k, nbeads, nparticle, &
1983 REAL(kind=
dp) :: dt_temp, dti, dti2, dti22, e_h, factor, &
1984 rn, tdti, time_start, time_stop, tol
1985 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pos, vel
1986 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: tmp
2001 CALL timeset(routinen, handle)
2004 rn = real(pint_env%nrespa,
dp)
2005 dti = pint_env%dt/rn
2008 dti22 = dti**2/2._dp
2013 IF (pint_env%simpar%constraint)
THEN
2014 NULLIFY (subsys, cell)
2015 NULLIFY (atomic_kinds, local_particles, particles)
2016 NULLIFY (local_molecules, molecules, molecule_kinds, gci)
2017 NULLIFY (atomic_kind_set, molecule_kind_set, particle_set, molecule_set)
2020 CALL force_env_get(force_env=f_env%force_env, subsys=subsys)
2027 atomic_kinds=atomic_kinds, &
2028 local_particles=local_particles, &
2029 particles=particles, &
2030 local_molecules=local_molecules, &
2031 molecules=molecules, &
2032 molecule_kinds=molecule_kinds, &
2035 nparticle_kind = atomic_kinds%n_els
2036 atomic_kind_set => atomic_kinds%els
2037 molecule_kind_set => molecule_kinds%els
2038 nparticle = particles%n_els
2040 particle_set => particles%els
2041 molecule_set => molecules%els
2044 ALLOCATE (pos(3, nparticle))
2045 ALLOCATE (vel(3, nparticle))
2051 factor = sqrt(real(pint_env%p,
dp))
2056 CALL getold(gci, local_molecules, molecule_set, &
2057 molecule_kind_set, particle_set, cell)
2060 SELECT CASE (pint_env%harm_integrator)
2063 DO iresp = 1, pint_env%nrespa
2070 IF (pint_env%simpar%constraint)
THEN
2071 DO k = 1, pint_env%n_atoms_constraints
2072 ia = pint_env%atoms_constraints(k)
2073 DO j = 3*(ia - 1) + 1, 3*ia
2074 pint_env%tv(:, 1, j) = 0.0_dp
2081 pint_env%tx(:, 1, :) = 0.0_dp
2082 pint_env%tv(:, 1, :) = 0.0_dp
2083 pint_env%tf(:, 1, :) = 0.0_dp
2086 DO i = pint_env%first_propagated_mode, pint_env%p
2087 pint_env%ux(i, :) = pint_env%ux(i, :) - &
2088 dti22*pint_env%uv(i, :)*pint_env%tv(1, i, :)
2090 pint_env%tx = pint_env%tx + dti*pint_env%tv + dti22*pint_env%tf
2093 pint_env%tx(:, 1, :) = 0.0_dp
2094 pint_env%tv(:, 1, :) = 0.0_dp
2095 pint_env%tf(:, 1, :) = 0.0_dp
2101 DO i = pint_env%first_propagated_mode, pint_env%p
2102 pint_env%ux_t(i, :) = pint_env%ux(i, :) + &
2103 dti*pint_env%uv(i, :) + &
2104 dti22*(pint_env%uf_h(i, :) + &
2109 SELECT CASE (pint_env%pimd_thermostat)
2113 pint_env%tx(:, 1, :) = 0.0_dp
2114 pint_env%tv(:, 1, :) = 0.0_dp
2115 pint_env%tf(:, 1, :) = 0.0_dp
2118 pint_env%uv_t = pint_env%uv - dti2* &
2119 pint_env%uv*pint_env%tv(1, :, :)
2120 tmp => pint_env%tv_t
2121 pint_env%tv_t => pint_env%tv
2123 pint_env%tv = pint_env%tv_old + tdti*pint_env%tf
2124 pint_env%tv_old = pint_env%tv_t
2125 pint_env%tv_t = pint_env%tv_t + dti2*pint_env%tf
2127 pint_env%uv_t = pint_env%uv
2131 IF (pint_env%simpar%constraint)
THEN
2132 DO k = 1, pint_env%n_atoms_constraints
2133 ia = pint_env%atoms_constraints(k)
2134 DO j = 3*(ia - 1) + 1, 3*ia
2135 pint_env%tv(:, 1, j) = 0.0_dp
2136 pint_env%tv_t(:, 1, j) = 0.0_dp
2143 pint_env%tx(:, 1, :) = 0.0_dp
2144 pint_env%tv(:, 1, :) = 0.0_dp
2145 pint_env%tf(:, 1, :) = 0.0_dp
2149 pint_env%uv_t = pint_env%uv_t + dti2*(pint_env%uf_h + pint_env%uf)
2152 pint_env%uf = 0.0_dp
2154 pint_env%ux = pint_env%ux_t
2157 IF (pint_env%simpar%constraint)
THEN
2158 IF (pint_env%logger%para_env%is_source())
THEN
2161 pos(j, i) = pint_env%ux(1, j + (i - 1)*3)
2162 vel(j, i) = pint_env%uv_t(1, j + (i - 1)*3)
2168 molecule_kind_set, dti, &
2169 f_env%force_env%root_section)
2171 molecule_kind_set, particle_set, &
2172 pos, vel, dti, pint_env%simpar%shake_tol, &
2173 pint_env%simpar%info_constraint, &
2174 pint_env%simpar%lagrange_multipliers, &
2175 pint_env%simpar%dump_lm, cell, &
2179 CALL pint_env%logger%para_env%bcast(pos)
2180 CALL pint_env%logger%para_env%bcast(vel)
2184 pint_env%ux(1, j + (i - 1)*3) = pos(j, i)
2185 pint_env%uv_t(1, j + (i - 1)*3) = vel(j, i)
2192 pint_env%tx(:, 1, :) = 0.0_dp
2193 pint_env%tv(:, 1, :) = 0.0_dp
2194 pint_env%tf(:, 1, :) = 0.0_dp
2197 CALL pint_calc_uf_h(pint_env=pint_env, e_h=e_h)
2198 pint_env%uv_t = pint_env%uv_t + dti2*(pint_env%uf_h + pint_env%uf)
2202 IF (iresp == pint_env%nrespa)
THEN
2204 CALL pint_calc_f(pint_env)
2206 IF (
PRESENT(helium_env))
THEN
2209 IF (pint_env%logger%para_env%is_source())
THEN
2210 pint_env%f(:, :) = pint_env%f(:, :) + helium_env(1)%helium%force_avrg(:, :)
2212 CALL pint_env%logger%para_env%bcast(pint_env%f)
2217 IF (pint_env%first_propagated_mode == 2)
THEN
2218 pint_env%uf(1, :) = 0.0_dp
2222 pint_env%uf = pint_env%uf*rn
2223 pint_env%uv_t = pint_env%uv_t + dti2*pint_env%uf
2228 SELECT CASE (pint_env%pimd_thermostat)
2232 pint_env%tx(:, 1, :) = 0.0_dp
2233 pint_env%tv(:, 1, :) = 0.0_dp
2234 pint_env%tf(:, 1, :) = 0.0_dp
2238 pint_env%uv_new = pint_env%uv_t/(1.+dti2*pint_env%tv(1, :, :))
2239 DO idim = 1, pint_env%ndim
2240 DO ib = 1, pint_env%p
2241 pint_env%tf(1, ib, idim) = (pint_env%mass_fict(ib, idim)* &
2242 pint_env%uv_new(ib, idim)**2 - pint_env%kT*pint_env%kTcorr)/ &
2248 IF (pint_env%simpar%constraint)
THEN
2249 DO k = 1, pint_env%n_atoms_constraints
2250 ia = pint_env%atoms_constraints(k)
2251 DO j = 3*(ia - 1) + 1, 3*ia
2252 pint_env%tf(:, 1, j) = 0.0_dp
2259 pint_env%tx(:, 1, :) = 0.0_dp
2260 pint_env%tv(:, 1, :) = 0.0_dp
2261 pint_env%tf(:, 1, :) = 0.0_dp
2264 DO idim = 1, pint_env%ndim
2265 DO ib = 1, pint_env%p
2266 DO inos = 1, pint_env%nnos - 1
2267 pint_env%tv_new(inos, ib, idim) = &
2268 (pint_env%tv_t(inos, ib, idim) + dti2*pint_env%tf(inos, ib, idim))/ &
2269 (1._dp + dti2*pint_env%tv(inos + 1, ib, idim))
2270 pint_env%tf(inos + 1, ib, idim) = &
2271 (pint_env%tv_new(inos, ib, idim)**2 - &
2272 pint_env%kT*pint_env%kTcorr/pint_env%Q(ib))
2273 tol = max(tol, abs(pint_env%tv(inos, ib, idim) &
2274 - pint_env%tv_new(inos, ib, idim)))
2277 IF (pint_env%simpar%constraint)
THEN
2278 DO k = 1, pint_env%n_atoms_constraints
2279 ia = pint_env%atoms_constraints(k)
2280 DO j = 3*(ia - 1) + 1, 3*ia
2281 pint_env%tv_new(:, 1, j) = 0.0_dp
2282 pint_env%tf(:, 1, j) = 0.0_dp
2289 pint_env%tx(:, 1, :) = 0.0_dp
2290 pint_env%tv(:, 1, :) = 0.0_dp
2291 pint_env%tf(:, 1, :) = 0.0_dp
2294 pint_env%tv_new(pint_env%nnos, ib, idim) = &
2295 pint_env%tv_t(pint_env%nnos, ib, idim) + &
2296 dti2*pint_env%tf(pint_env%nnos, ib, idim)
2297 tol = max(tol, abs(pint_env%tv(pint_env%nnos, ib, idim) &
2298 - pint_env%tv_new(pint_env%nnos, ib, idim)))
2299 tol = max(tol, abs(pint_env%uv(ib, idim) &
2300 - pint_env%uv_new(ib, idim)))
2302 IF (pint_env%simpar%constraint)
THEN
2303 DO k = 1, pint_env%n_atoms_constraints
2304 ia = pint_env%atoms_constraints(k)
2305 DO j = 3*(ia - 1) + 1, 3*ia
2306 pint_env%tv_new(:, 1, j) = 0.0_dp
2312 pint_env%tx(:, 1, :) = 0.0_dp
2313 pint_env%tv(:, 1, :) = 0.0_dp
2314 pint_env%tf(:, 1, :) = 0.0_dp
2320 pint_env%uv = pint_env%uv_new
2321 pint_env%tv = pint_env%tv_new
2322 IF (tol <= pint_env%v_tol)
EXIT
2325 pint_env%tx(:, 1, :) = 0.0_dp
2326 pint_env%tv(:, 1, :) = 0.0_dp
2327 pint_env%tf(:, 1, :) = 0.0_dp
2332 IF (pint_env%simpar%constraint)
THEN
2333 IF (pint_env%logger%para_env%is_source())
THEN
2337 vel(j, i) = pint_env%uv(1, j + (i - 1)*3)
2338 particle_set(i)%r(j) = pint_env%ux(1, j + (i - 1)*3)
2344 IF (iresp == pint_env%nrespa)
THEN
2350 molecule_kind_set, particle_set, &
2351 vel, dt_temp, pint_env%simpar%shake_tol, &
2352 pint_env%simpar%info_constraint, &
2353 pint_env%simpar%lagrange_multipliers, &
2354 pint_env%simpar%dump_lm, cell, &
2359 CALL pint_env%logger%para_env%bcast(vel)
2363 pint_env%uv(1, j + (i - 1)*3) = vel(j, i)
2368 DO inos = 1, pint_env%nnos - 1
2369 pint_env%tf(inos, :, :) = pint_env%tf(inos, :, :) &
2370 - pint_env%tv(inos, :, :)*pint_env%tv(inos + 1, :, :)
2375 pint_env%tx(:, 1, :) = 0.0_dp
2376 pint_env%tv(:, 1, :) = 0.0_dp
2377 pint_env%tf(:, 1, :) = 0.0_dp
2382 pint_env%uv = pint_env%uv_t
2384 pint_env%uv = pint_env%uv_t
2397 SELECT CASE (pint_env%pimd_thermostat)
2400 vnew=pint_env%uv_t, &
2402 ndim=pint_env%ndim, &
2403 first_mode=pint_env%first_propagated_mode, &
2404 masses=pint_env%mass_fict, &
2405 pile_therm=pint_env%pile_therm)
2408 vnew=pint_env%uv_t, &
2409 first_mode=pint_env%first_propagated_mode, &
2410 masses=pint_env%mass_fict, &
2411 piglet_therm=pint_env%piglet_therm)
2414 vnew=pint_env%uv_t, &
2416 ndim=pint_env%ndim, &
2417 masses=pint_env%mass_fict, &
2418 qtb_therm=pint_env%qtb_therm)
2420 pint_env%uv_t = pint_env%uv
2424 pint_env%uv_t = pint_env%uv_t + dti2*pint_env%uf
2427 IF (pint_env%first_propagated_mode == 1)
THEN
2431 pint_env%ux_t(1, :) = pint_env%ux(1, :) + &
2432 dti*pint_env%uv_t(1, :)
2438 pint_env%ux_t(1, :) = pint_env%ux(1, :)
2439 pint_env%uv_t(1, :) = 0.0_dp
2442 DO i = 2, pint_env%p
2443 pint_env%ux_t(i, :) = pint_env%cosex(i)*pint_env%ux(i, :) &
2444 + pint_env%iwsinex(i)*pint_env%uv_t(i, :)
2445 pint_env%uv_t(i, :) = pint_env%cosex(i)*pint_env%uv_t(i, :) &
2446 - pint_env%wsinex(i)*pint_env%ux(i, :)
2450 IF (pint_env%simpar%constraint)
THEN
2452 IF (pint_env%beadwise_constraints)
THEN
2453 IF (pint_env%logger%para_env%is_source())
THEN
2455 CALL pint_u2x(pint_env, ux=pint_env%ux_t, x=pint_env%x)
2456 CALL pint_u2x(pint_env, ux=pint_env%uv_t, x=pint_env%v)
2460 pos(j, i) = pint_env%x(ib, j + (i - 1)*3)
2461 vel(j, i) = pint_env%v(ib, j + (i - 1)*3)
2466 molecule_kind_set, dti, &
2467 f_env%force_env%root_section)
2469 molecule_kind_set, particle_set, &
2470 pos, vel, dti, pint_env%simpar%shake_tol, &
2471 pint_env%simpar%info_constraint, &
2472 pint_env%simpar%lagrange_multipliers, &
2473 pint_env%simpar%dump_lm, cell, &
2477 pint_env%x(ib, j + (i - 1)*3) = pos(j, i)
2478 pint_env%v(ib, j + (i - 1)*3) = vel(j, i)
2483 CALL pint_x2u(pint_env, ux=pint_env%ux_t, x=pint_env%x)
2484 CALL pint_x2u(pint_env, ux=pint_env%uv_t, x=pint_env%v)
2487 CALL pint_env%logger%para_env%bcast(pint_env%ux_t)
2488 CALL pint_env%logger%para_env%bcast(pint_env%uv_t)
2491 IF (pint_env%logger%para_env%is_source())
THEN
2495 pos(j, i) = pint_env%ux_t(1, j + (i - 1)*3)/factor
2496 vel(j, i) = pint_env%uv_t(1, j + (i - 1)*3)/factor
2501 molecule_kind_set, dti, &
2502 f_env%force_env%root_section)
2504 molecule_kind_set, particle_set, &
2505 pos, vel, dti, pint_env%simpar%shake_tol, &
2506 pint_env%simpar%info_constraint, &
2507 pint_env%simpar%lagrange_multipliers, &
2508 pint_env%simpar%dump_lm, cell, &
2512 CALL pint_env%logger%para_env%bcast(pos)
2513 CALL pint_env%logger%para_env%bcast(vel)
2517 pint_env%ux_t(1, j + (i - 1)*3) = pos(j, i)*factor
2518 pint_env%uv_t(1, j + (i - 1)*3) = vel(j, i)*factor
2525 pint_env%ux = pint_env%ux_t
2528 pint_env%uf = 0.0_dp
2530 CALL pint_calc_f(pint_env)
2532 IF (
PRESENT(helium_env))
THEN
2535 IF (pint_env%logger%para_env%is_source())
THEN
2536 pint_env%f(:, :) = pint_env%f(:, :) + helium_env(1)%helium%force_avrg(:, :)
2538 CALL pint_env%logger%para_env%bcast(pint_env%f)
2542 IF (pint_env%first_propagated_mode == 2)
THEN
2543 pint_env%uf(1, :) = 0.0_dp
2545 pint_env%uv_t = pint_env%uv_t + dti2*pint_env%uf
2548 SELECT CASE (pint_env%pimd_thermostat)
2553 ndim=pint_env%ndim, &
2554 first_mode=pint_env%first_propagated_mode, &
2555 masses=pint_env%mass_fict, &
2556 pile_therm=pint_env%pile_therm)
2560 first_mode=pint_env%first_propagated_mode, &
2561 masses=pint_env%mass_fict, &
2562 piglet_therm=pint_env%piglet_therm)
2567 ndim=pint_env%ndim, &
2568 masses=pint_env%mass_fict, &
2569 qtb_therm=pint_env%qtb_therm)
2571 pint_env%uv = pint_env%uv_t
2575 IF (pint_env%simpar%constraint)
THEN
2577 IF (pint_env%beadwise_constraints)
THEN
2578 IF (pint_env%logger%para_env%is_source())
THEN
2581 CALL pint_u2x(pint_env, ux=pint_env%ux, x=pint_env%x)
2582 CALL pint_u2x(pint_env, ux=pint_env%uv, x=pint_env%v)
2586 particle_set(i)%r(j) = pint_env%x(ib, j + (i - 1)*3)
2587 vel(j, i) = pint_env%v(ib, j + (i - 1)*3)
2591 molecule_set, molecule_kind_set, &
2592 particle_set, vel, dti, &
2593 pint_env%simpar%shake_tol, &
2594 pint_env%simpar%info_constraint, &
2595 pint_env%simpar%lagrange_multipliers, &
2596 pint_env%simpar%dump_lm, cell, &
2600 pint_env%v(ib, j + (i - 1)*3) = vel(j, i)
2605 CALL pint_x2u(pint_env, ux=pint_env%uv, x=pint_env%v)
2607 CALL pint_env%logger%para_env%bcast(pint_env%uv)
2610 IF (pint_env%logger%para_env%is_source())
THEN
2615 vel(j, i) = pint_env%uv(1, j + (i - 1)*3)/factor
2616 particle_set(i)%r(j) = pint_env%ux(1, j + (i - 1)*3)/factor
2620 molecule_set, molecule_kind_set, &
2621 particle_set, vel, dti, &
2622 pint_env%simpar%shake_tol, &
2623 pint_env%simpar%info_constraint, &
2624 pint_env%simpar%lagrange_multipliers, &
2625 pint_env%simpar%dump_lm, cell, &
2630 CALL pint_env%logger%para_env%bcast(vel)
2636 pint_env%uv(1, j + (i - 1)*3) = vel(j, i)*factor
2644 IF (pint_env%simpar%constraint)
THEN
2645 DEALLOCATE (pos, vel)
2649 CALL pint_calc_energy(pint_env)
2650 CALL pint_calc_total_action(pint_env)
2664 pint_env%time_per_step = time_stop - time_start
2666 CALL timestop(handle)
2668 END SUBROUTINE pint_step
2676 SUBROUTINE pint_calc_energy(pint_env)
2680 REAL(kind=
dp) :: e_h
2682 CALL pint_calc_e_kin_beads_u(pint_env)
2683 CALL pint_calc_e_vir(pint_env)
2685 CALL pint_calc_uf_h(pint_env, e_h=e_h)
2686 pint_env%e_pot_h = e_h
2688 SELECT CASE (pint_env%pimd_thermostat)
2690 CALL pint_calc_nh_energy(pint_env)
2702 (0.5_dp*real(pint_env%p,
dp)*real(pint_env%ndim,
dp)*pint_env%kT - &
2703 pint_env%e_pot_h)*pint_env%propagator%temp_sim2phys
2708 pint_env%energy(
e_potential_id)*pint_env%propagator%physpotscale + &
2709 pint_env%e_pot_h + &
2710 pint_env%e_kin_beads + &
2711 pint_env%e_pot_t + &
2712 pint_env%e_kin_t + &
2713 pint_env%e_gle + pint_env%e_pile + pint_env%e_piglet + pint_env%e_qtb
2718 END SUBROUTINE pint_calc_energy
2729 SUBROUTINE pint_calc_uf_h(pint_env, e_h)
2731 REAL(kind=
dp),
INTENT(OUT) :: e_h
2735 pint_env%mass_beads, &
2741 pint_env%mass_beads, &
2746 e_h = pint_env%e_pot_h
2747 pint_env%uf_h = pint_env%uf_h/pint_env%mass_fict
2748 END SUBROUTINE pint_calc_uf_h
2762 SUBROUTINE pint_calc_f(pint_env, x, f, e)
2764 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(in), &
2765 OPTIONAL,
TARGET :: x
2766 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(out), &
2767 OPTIONAL,
TARGET :: f
2768 REAL(kind=
dp),
DIMENSION(:),
INTENT(out), &
2769 OPTIONAL,
TARGET :: e
2772 REAL(kind=
dp),
DIMENSION(:),
POINTER :: my_e
2773 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: my_f, my_x
2776 IF (
PRESENT(x)) my_x => x
2778 IF (
PRESENT(f)) my_f => f
2779 my_e => pint_env%e_pot_bead
2780 IF (
PRESENT(e)) my_e => e
2781 DO idim = 1, pint_env%ndim
2782 DO ib = 1, pint_env%p
2783 pint_env%replicas%r(idim, ib) = my_x(ib, idim)
2787 DO idim = 1, pint_env%ndim
2788 DO ib = 1, pint_env%p
2790 my_f(ib, idim) = pint_env%replicas%f(idim, ib)
2793 my_e = pint_env%replicas%f(
SIZE(pint_env%replicas%f, 1), :)
2795 END SUBROUTINE pint_calc_f
2806 SUBROUTINE pint_calc_e_kin_beads_u(pint_env, uv, e_k)
2808 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(in), &
2809 OPTIONAL,
TARGET :: uv
2810 REAL(kind=
dp),
INTENT(out),
OPTIONAL :: e_k
2813 REAL(kind=
dp) :: res
2814 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: my_uv
2817 my_uv => pint_env%uv
2818 IF (
PRESENT(uv)) my_uv => uv
2820 DO idim = 1, pint_env%ndim
2821 DO ib = 1, pint_env%p
2822 res = res + pint_env%mass_fict(ib, idim)*my_uv(ib, idim)**2
2826 IF (.NOT.
PRESENT(uv)) pint_env%e_kin_beads = res
2827 IF (
PRESENT(e_k)) e_k = res
2828 END SUBROUTINE pint_calc_e_kin_beads_u
2838 ELEMENTAL SUBROUTINE pint_calc_e_vir(pint_env, e_vir)
2840 REAL(kind=
dp),
INTENT(out),
OPTIONAL :: e_vir
2843 REAL(kind=
dp) :: res, xcentroid
2847 DO idim = 1, pint_env%ndim
2850 DO ib = 1, pint_env%p
2851 xcentroid = xcentroid + pint_env%x(ib, idim)
2853 xcentroid = xcentroid/real(pint_env%p,
dp)
2854 DO ib = 1, pint_env%p
2855 res = res + (pint_env%x(ib, idim) - xcentroid)*pint_env%f(ib, idim)
2858 res = 0.5_dp*(real(pint_env%ndim,
dp)* &
2859 (pint_env%kT*pint_env%propagator%temp_sim2phys) - res/real(pint_env%p,
dp))
2861 IF (
PRESENT(e_vir)) e_vir = res
2862 END SUBROUTINE pint_calc_e_vir
2870 ELEMENTAL SUBROUTINE pint_calc_nh_energy(pint_env)
2873 INTEGER :: ib, idim, inos
2874 REAL(kind=
dp) :: ekin, epot
2877 DO idim = 1, pint_env%ndim
2878 DO ib = 1, pint_env%p
2879 DO inos = 1, pint_env%nnos
2880 ekin = ekin + pint_env%Q(ib)*pint_env%tv(inos, ib, idim)**2
2884 pint_env%e_kin_t = 0.5_dp*ekin
2886 DO idim = 1, pint_env%ndim
2887 DO ib = 1, pint_env%p
2888 DO inos = 1, pint_env%nnos
2889 epot = epot + pint_env%tx(inos, ib, idim)
2893 pint_env%e_pot_t = pint_env%kT*epot
2894 END SUBROUTINE pint_calc_nh_energy
2902 ELEMENTAL FUNCTION pint_calc_total_link_action(pint_env)
RESULT(link_action)
2904 REAL(kind=
dp) :: link_action
2906 INTEGER :: iatom, ibead, idim, indx
2907 REAL(kind=
dp) :: hb2m, tau, tmp_link_action
2908 REAL(kind=
dp),
DIMENSION(3) :: r
2911 tau = pint_env%beta/real(pint_env%p,
dp)
2913 link_action = 0.0_dp
2914 DO iatom = 1, pint_env%ndim/3
2916 hb2m = 1.0_dp/pint_env%mass((iatom - 1)*3 + 1)
2917 tmp_link_action = 0.0_dp
2918 DO ibead = 1, pint_env%p - 1
2920 indx = (iatom - 1)*3 + idim
2921 r(idim) = pint_env%x(ibead, indx) - pint_env%x(ibead + 1, indx)
2923 tmp_link_action = tmp_link_action + (r(1)*r(1) + r(2)*r(2) + r(3)*r(3))
2926 indx = (iatom - 1)*3 + idim
2927 r(idim) = pint_env%x(pint_env%p, indx) - pint_env%x(1, indx)
2929 tmp_link_action = tmp_link_action + (r(1)*r(1) + r(2)*r(2) + r(3)*r(3))
2930 link_action = link_action + tmp_link_action/hb2m
2933 link_action = link_action/(2.0_dp*tau)
2935 END FUNCTION pint_calc_total_link_action
2943 ELEMENTAL FUNCTION pint_calc_total_pot_action(pint_env)
RESULT(pot_action)
2945 REAL(kind=
dp) :: pot_action
2947 REAL(kind=
dp) :: tau
2949 tau = pint_env%beta/real(pint_env%p,
dp)
2950 pot_action = tau*sum(pint_env%e_pot_bead)
2952 END FUNCTION pint_calc_total_pot_action
2959 ELEMENTAL SUBROUTINE pint_calc_total_action(pint_env)
2962 pint_env%pot_action = pint_calc_total_pot_action(pint_env)
2963 pint_env%link_action = pint_calc_total_link_action(pint_env)
2965 END SUBROUTINE pint_calc_total_action
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
represent a simple array based list of the given type
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public shiga2022
integer, save, public ceriotti2012
integer, save, public ceriotti2010
integer, save, public brieuc2016
Handles all functions related to the CELL.
Contains routines useful for the application of constraints during MD.
subroutine, public getold(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, cell)
saves all of the old variables
subroutine, public rattle_control(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, vel, dt, rattle_tol, log_unit, lagrange_mult, dump_lm, cell, group, local_particles)
...
subroutine, public shake_control(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, pos, vel, dt, shake_tol, log_unit, lagrange_mult, dump_lm, cell, group, local_particles)
...
subroutine, public shake_update_targets(gci, local_molecules, molecule_set, molecule_kind_set, dt, root_section)
Updates the TARGET of the COLLECTIVE constraints if the growth speed is different from zero.
Routines to handle the external control of CP2K.
subroutine, public external_control(should_stop, flag, globenv, target_time, start_time, force_check)
External manipulations during a run : when the <PROJECT_NAME>.EXIT_$runtype command is sent the progr...
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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
subroutine, public cp_iterate(iteration_info, last, iter_nr, increment, iter_nr_out)
adds one to the actual iteration
subroutine, public cp_rm_iter_level(iteration_info, level_name, n_rlevel_att)
Removes an iteration level.
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...
subroutine, public cp_add_iter_level(iteration_info, level_name, n_rlevel_new)
Adds an iteration level.
types that represent a subsys, i.e. a part of the system
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
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
interface to use cp2k as library
subroutine, public f_env_add_defaults(f_env_id, f_env, handle)
adds the default environments of the f_env to the stack of the defaults, and returns a new error and ...
subroutine, public f_env_rm_defaults(f_env, ierr, handle)
removes the default environments of the f_env to the stack of the defaults, and sets ierr accordingly...
Interface for the force calculations.
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
subroutine, public restart_gle(gle, gle_section, save_mem, restart)
...
subroutine, public gle_matrix_exp(m, n, j, k, em)
...
subroutine, public gle_cholesky_stab(sst, s, n)
...
subroutine, public gle_dealloc(gle)
Deallocate type for GLE thermostat.
subroutine, public gle_thermo_create(gle, mal_size)
...
subroutine, public gle_init(gle, dt, temp, section)
...
Define type storing the global information of a run. Keep the amount of stored data small....
Methods that handle helium-solvent and helium-helium interactions.
subroutine, public helium_intpot_scan(pint_env, helium_env)
Scan the helium-solute interaction energy within the periodic cell.
I/O subroutines for helium.
subroutine, public helium_write_cubefile(unit, comment, origin, deltar, ndim, data)
Write volumetric data to an orthorhombic cubefile.
Methods dealing with helium_solvent_type.
subroutine, public helium_release(helium_env)
Releases helium_solvent_type.
subroutine, public helium_create(helium_env, input, solute)
Data-structure that holds all needed information about (superfluid) helium solvent.
subroutine, public helium_init(helium_env, pint_env)
Initialize helium data structures.
Methods for sampling helium variables.
subroutine, public helium_step(helium_env, pint_env)
Perform MC step for helium.
subroutine, public helium_do_run(helium_env, globenv)
Performs MC simulation for helium (only)
Data types representing superfluid helium.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
real(kind=dp) function, public m_walltime()
returns time from a real-time clock, protected against rolling early/easily
Definition of mathematical constants and functions.
real(kind=dp), parameter, public twopi
Collection of simple mathematical functions and subroutines.
elemental integer function, public gcd(a, b)
computes the greatest common divisor of two number
Interface to the message passing library MPI.
type(mp_comm_type), parameter, public mp_comm_self
represent a simple array based list of the given type
Define the molecule kind structure types and the corresponding functionality.
represent a simple array based list of the given type
Define the data structure for the molecule information.
Parallel (pseudo)random number generator (RNG) for multiple streams and substreams of random numbers.
integer, parameter, public gaussian
represent a simple array based list of the given type
Define the data structure for the particle information.
Methods to apply GLE to PI runs.
subroutine, public pint_gle_init(pint_env)
...
subroutine, public pint_gle_step(pint_env)
...
elemental subroutine, public pint_calc_gle_energy(pint_env)
...
I/O subroutines for pint_env.
subroutine, public pint_write_action(pint_env)
Writes out the actions according to PINTPRINTACTION.
subroutine, public pint_write_centroids(pint_env)
Write out the trajectory of the centroid (positions and velocities)
subroutine, public pint_write_rgyr(pint_env)
Write radii of gyration according to PINTPRINTCENTROID_GYR.
subroutine, public pint_write_step_info(pint_env)
Write step info to the output file.
subroutine, public pint_write_ener(pint_env)
Writes out the energies according to PINTPRINTENERGY.
subroutine, public pint_write_line(line)
Writes out a line of text to the default output unit.
subroutine, public pint_write_trajectory(pint_env)
Write out the trajectory of the beads (positions and velocities)
subroutine, public pint_write_com(pint_env)
Write center of mass (COM) position according to PINTPRINTCOM.
Methods to performs a path integral run.
subroutine, public do_pint_run(para_env, input, input_declaration, globenv)
Perform a path integral simulation.
Data type and methods dealing with PI calcs in normal mode coords.
pure subroutine, public normalmode_calc_uf_h(normalmode_env, mass_beads, ux, uf_h, e_h)
calculates the harmonic force in the normal mode basis
pure subroutine, public normalmode_release(normalmode_env)
releases the normalmode environment
subroutine, public normalmode_env_create(normalmode_env, normalmode_section, p, kt, propagator)
creates the data needed for a normal mode transformation
pure subroutine, public normalmode_init_masses(normalmode_env, mass, mass_beads, mass_fict, q)
initializes the masses and fictitious masses compatible with the normal mode information
Methods to apply the piglet thermostat to PI runs.
elemental subroutine, public pint_calc_piglet_energy(pint_env)
returns the piglet kinetic energy contribution
subroutine, public pint_piglet_release(piglet_therm)
releases the piglet environment
subroutine, public pint_piglet_create(piglet_therm, pint_env, section)
creates the data structure for a piglet thermostating in PI runs
subroutine, public pint_piglet_step(vold, vnew, first_mode, masses, piglet_therm)
...
subroutine, public pint_piglet_init(piglet_therm, pint_env, section, dt, para_env)
initializes the data for a piglet run
Methods to apply a simple Lagevin thermostat to PI runs. v_new = c1*vold + SQRT(kT/m)*c2*random.
subroutine, public pint_pile_step(vold, vnew, p, ndim, first_mode, masses, pile_therm)
...
subroutine, public pint_pile_init(pile_therm, pint_env, normalmode_env, section)
initializes the data for a pile run
subroutine, public pint_pile_release(pile_therm)
releases the pile environment
subroutine, public pint_calc_pile_energy(pint_env)
returns the pile kinetic energy contribution
Public path integral routines that can be called from other modules.
subroutine, public pint_levy_walk(x0, n, v, x, rng_gaussian)
Perform a Brownian walk of length n around x0 with the variance v.
Methods to apply the QTB thermostat to PI runs. Based on the PILE implementation from Felix Uhl (pint...
subroutine, public pint_qtb_step(vold, vnew, p, ndim, masses, qtb_therm)
...
subroutine, public pint_calc_qtb_energy(pint_env)
returns the qtb kinetic energy contribution
subroutine, public pint_qtb_release(qtb_therm)
releases the qtb environment
subroutine, public pint_qtb_init(qtb_therm, pint_env, normalmode_env, section)
initializes the data for a QTB run
Data type and methods dealing with PI calcs in staging coordinates.
elemental subroutine, public staging_release(staging_env)
releases the staging environment, kept for symmetry reasons with staging_env_create
subroutine, public staging_env_create(staging_env, staging_section, p, kt)
creates the data needed for a staging transformation
pure subroutine, public staging_calc_uf_h(staging_env, mass_beads, ux, uf_h, e_h)
calculates the harmonic force in the staging basis
pure subroutine, public staging_init_masses(staging_env, mass, mass_beads, mass_fict, q)
initializes the masses and fictitious masses compatibly with the staging information
integer, parameter, public e_kin_thermo_id
integer, parameter, public e_conserved_id
integer, parameter, public thermostat_none
integer, parameter, public thermostat_gle
integer, parameter, public e_potential_id
integer, parameter, public thermostat_pile
integer, parameter, public thermostat_piglet
integer, parameter, public thermostat_nose
integer, parameter, public e_kin_virial_id
integer, parameter, public thermostat_qtb
methods to setup replicas of the same system differing only by atom positions and velocities (as used...
subroutine, public rep_env_create(rep_env, para_env, input, input_declaration, nrep, prep, sync_v, keep_wf_history, row_force)
creates a replica environment together with its force environment
subroutine, public rep_env_calc_e_f(rep_env, calc_f)
evaluates the forces
types used to handle many replica of the same system that differ only in atom positions,...
subroutine, public rep_env_release(rep_env)
releases the given replica environment
Type for storing MD parameters.
subroutine, public release_simpar_type(simpar)
Releases the simulation parameters type.
subroutine, public create_simpar_type(simpar)
Creates the simulation parameters type.
represent a list of objects
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represents a system: atoms, molecules, their pos,vel,...
structure to store local (to a processor) ordered lists of integers.
contains the initially parsed file and the initial parallel environment
data structure for array of solvent helium environments
stores all the informations relevant to an mpi environment
represent a list of objects
represent a list of objects
represent a list of objects
environment for a path integral run
keeps replicated information about the replicas