59#include "../../base/base_uses.f90"
65 PRIVATE :: change_bond_angle, change_bond_length, depth_first_search, &
70 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'mc_moves'
92 RECURSIVE SUBROUTINE depth_first_search(current_atom, avoid_atom, &
95 INTEGER,
INTENT(IN) :: current_atom, avoid_atom
96 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: connectivity
97 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: atom
102 IF (connectivity(iatom, current_atom) /= 0)
THEN
103 IF (connectivity(iatom, current_atom) /= avoid_atom)
THEN
104 atom(connectivity(iatom, current_atom)) = 1
105 CALL depth_first_search(connectivity(iatom, current_atom), &
106 current_atom, connectivity,
atom)
113 END SUBROUTINE depth_first_search
137 move_updates, start_atom, molecule_type, box_number, &
138 bias_energy, move_type, lreject, &
144 INTEGER,
INTENT(IN) :: start_atom, molecule_type, box_number
145 REAL(kind=
dp),
INTENT(INOUT) :: bias_energy
146 CHARACTER(LEN=*),
INTENT(IN) :: move_type
147 LOGICAL,
INTENT(OUT) :: lreject
150 CHARACTER(len=*),
PARAMETER :: routinen =
'mc_conformation_change'
152 CHARACTER(default_string_length) :: name
153 CHARACTER(default_string_length),
DIMENSION(:), &
155 INTEGER :: atom_number, end_atom, end_mol, handle, imol_type, imolecule, ipart, jbox, &
156 molecule_number, nunits_mol, source, start_mol
157 INTEGER,
DIMENSION(:),
POINTER :: mol_type, nunits
158 INTEGER,
DIMENSION(:, :),
POINTER :: nchains
159 LOGICAL :: ionode, lbias, loverlap
160 REAL(kind=
dp) :: beta, bias_energy_new, bias_energy_old, &
161 dis_length, exp_max_val, exp_min_val, &
163 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r_new, r_old
173 CALL timeset(routinen, handle)
176 NULLIFY (particles, subsys, molecule_kinds, molecule_kind, &
180 CALL get_mc_par(mc_par, lbias=lbias, mc_molecule_info=mc_molecule_info, &
181 beta=beta, exp_max_val=exp_max_val, &
182 exp_min_val=exp_min_val, group=group, source=source, ionode=ionode)
184 mol_type=mol_type, names=names)
187 nunits_mol = nunits(molecule_type)
188 ALLOCATE (r_old(1:3, 1:nunits_mol))
189 ALLOCATE (r_new(1:3, 1:nunits_mol))
193 DO jbox = 1, box_number - 1
194 start_mol = start_mol + sum(nchains(:, jbox))
196 end_mol = start_mol + sum(nchains(:, box_number)) - 1
199 end_atom = start_atom + nunits_mol - 1
202 DO imolecule = 1, sum(nchains(:, box_number))
203 IF (atom_number == start_atom)
THEN
204 molecule_number = imolecule
207 atom_number = atom_number + nunits(mol_type(imolecule + start_mol - 1))
209 IF (molecule_number == 0) cpabort(
'Cannot find the molecule number')
217 bias_energy_old = bias_energy
227 particles=particles, molecule_kinds=molecule_kinds)
228 DO imol_type = 1,
SIZE(molecule_kinds%els(:))
229 molecule_kind_test => molecule_kinds%els(imol_type)
231 IF (trim(adjustl(name)) == trim(adjustl(names(molecule_type))))
THEN
232 molecule_kind => molecule_kinds%els(imol_type)
238 DO ipart = start_atom, end_atom
239 r_old(1:3, ipart - start_atom + 1) = particles%els(ipart)%r(1:3)
242 IF (.NOT.
ASSOCIATED(molecule_kind)) cpabort(
'Cannot find the molecule type')
244 IF (move_type ==
'bond')
THEN
247 moves%bond%attempts = moves%bond%attempts + 1
248 move_updates%bond%attempts = move_updates%bond%attempts + 1
249 moves%bias_bond%attempts = moves%bias_bond%attempts + 1
250 move_updates%bias_bond%attempts = move_updates%bias_bond%attempts + 1
251 IF (.NOT. lbias)
THEN
252 moves%bond%qsuccesses = moves%bond%qsuccesses + 1
253 move_updates%bond%qsuccesses = &
254 move_updates%bond%qsuccesses + 1
255 moves%bias_bond%qsuccesses = moves%bias_bond%qsuccesses + 1
256 move_updates%bias_bond%qsuccesses = &
257 move_updates%bias_bond%qsuccesses + 1
261 CALL change_bond_length(r_old, r_new, mc_par, molecule_type, &
262 molecule_kind, dis_length, particles, rng_stream)
264 ELSE IF (move_type ==
'angle')
THEN
267 moves%angle%attempts = moves%angle%attempts + 1
268 move_updates%angle%attempts = move_updates%angle%attempts + 1
269 moves%bias_angle%attempts = moves%bias_angle%attempts + 1
270 move_updates%bias_angle%attempts = move_updates%bias_angle%attempts + 1
271 IF (.NOT. lbias)
THEN
272 moves%angle%qsuccesses = moves%angle%qsuccesses + 1
273 move_updates%angle%qsuccesses = &
274 move_updates%angle%qsuccesses + 1
275 moves%bias_angle%qsuccesses = moves%bias_angle%qsuccesses + 1
276 move_updates%bias_angle%qsuccesses = &
277 move_updates%bias_angle%qsuccesses + 1
281 CALL change_bond_angle(r_old, r_new, mc_par, molecule_type, &
282 molecule_kind, particles, rng_stream)
283 dis_length = 1.0e0_dp
286 moves%dihedral%attempts = moves%dihedral%attempts + 1
287 move_updates%dihedral%attempts = move_updates%dihedral%attempts + 1
288 moves%bias_dihedral%attempts = moves%bias_dihedral%attempts + 1
289 move_updates%bias_dihedral%attempts = move_updates%bias_dihedral%attempts + 1
290 IF (.NOT. lbias)
THEN
291 moves%dihedral%qsuccesses = moves%dihedral%qsuccesses + 1
292 move_updates%dihedral%qsuccesses = &
293 move_updates%dihedral%qsuccesses + 1
294 moves%bias_dihedral%qsuccesses = moves%bias_dihedral%qsuccesses + 1
295 move_updates%bias_dihedral%qsuccesses = &
296 move_updates%bias_dihedral%qsuccesses + 1
300 CALL change_dihedral(r_old, r_new, mc_par, molecule_type, &
301 molecule_kind, particles, rng_stream)
302 dis_length = 1.0e0_dp
307 DO ipart = start_atom, end_atom
308 particles%els(ipart)%r(1:3) = r_new(1:3, ipart - start_atom + 1)
315 nunits(:), loverlap, mol_type(start_mol:end_mol), &
316 molecule_number=molecule_number)
319 nunits(:), loverlap, mol_type(start_mol:end_mol), &
320 molecule_number=molecule_number)
321 IF (loverlap) lreject = .true.
334 potential_energy=bias_energy_new)
338 value = -beta*(bias_energy_new - bias_energy_old)
339 IF (
value > exp_max_val)
THEN
341 ELSE IF (
value < exp_min_val)
THEN
344 w = exp(
value)*dis_length**2
349 IF (w >= 1.0e0_dp)
THEN
354 rand = rng_stream%next()
356 CALL group%bcast(rand, source)
362 IF (move_type ==
'bond')
THEN
363 moves%bond%qsuccesses = moves%bond%qsuccesses + 1
364 move_updates%bond%successes = &
365 move_updates%bond%successes + 1
366 moves%bias_bond%successes = moves%bias_bond%successes + 1
367 move_updates%bias_bond%successes = &
368 move_updates%bias_bond%successes + 1
369 ELSE IF (move_type ==
'angle')
THEN
370 moves%angle%qsuccesses = moves%angle%qsuccesses + 1
371 move_updates%angle%successes = &
372 move_updates%angle%successes + 1
373 moves%bias_angle%successes = moves%bias_angle%successes + 1
374 move_updates%bias_angle%successes = &
375 move_updates%bias_angle%successes + 1
377 moves%dihedral%qsuccesses = moves%dihedral%qsuccesses + 1
378 move_updates%dihedral%successes = &
379 move_updates%dihedral%successes + 1
380 moves%bias_dihedral%successes = moves%bias_dihedral%successes + 1
381 move_updates%bias_dihedral%successes = &
382 move_updates%bias_dihedral%successes + 1
385 bias_energy = bias_energy + bias_energy_new - &
394 DO ipart = start_atom, end_atom
395 particles%els(ipart)%r(1:3) = r_old(1:3, ipart - start_atom + 1)
408 CALL timestop(handle)
433 move_updates, start_atom, box_number, &
434 bias_energy, molecule_type, &
440 INTEGER,
INTENT(IN) :: start_atom, box_number
441 REAL(kind=
dp),
INTENT(INOUT) :: bias_energy
442 INTEGER,
INTENT(IN) :: molecule_type
443 LOGICAL,
INTENT(OUT) :: lreject
446 CHARACTER(len=*),
PARAMETER :: routinen =
'mc_molecule_translation'
448 INTEGER :: atom_number, end_atom, end_mol, handle, imolecule, ipart, iparticle, jbox, &
449 molecule_number, move_direction, nunits_mol, source, start_mol
450 INTEGER,
DIMENSION(:),
POINTER :: mol_type, nunits, nunits_tot
451 INTEGER,
DIMENSION(:, :),
POINTER :: nchains
452 LOGICAL :: ionode, lbias, loverlap
453 REAL(
dp),
DIMENSION(:),
POINTER :: rmtrans
454 REAL(kind=
dp) :: beta, bias_energy_new, bias_energy_old, &
455 dis_mol, exp_max_val, exp_min_val, &
457 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r_old
466 CALL timeset(routinen, handle)
469 NULLIFY (particles, subsys)
473 beta=beta, exp_max_val=exp_max_val, &
474 exp_min_val=exp_min_val, rmtrans=rmtrans, ionode=ionode, source=source, &
475 group=group, mc_molecule_info=mc_molecule_info)
477 nchains=nchains, nunits=nunits, mol_type=mol_type)
481 DO jbox = 1, box_number - 1
482 start_mol = start_mol + sum(nchains(:, jbox))
484 end_mol = start_mol + sum(nchains(:, box_number)) - 1
487 ALLOCATE (r_old(1:3, 1:nunits_tot(box_number)))
490 nunits_mol = nunits(molecule_type)
491 end_atom = start_atom + nunits_mol - 1
494 DO imolecule = 1, sum(nchains(:, box_number))
495 IF (atom_number == start_atom)
THEN
496 molecule_number = imolecule
499 atom_number = atom_number + nunits(mol_type(imolecule + start_mol - 1))
501 IF (molecule_number == 0) cpabort(
'Cannot find the molecule number')
511 DO ipart = 1, nunits_tot(box_number)
512 r_old(1:3, ipart) = particles%els(ipart)%r(1:3)
516 bias_energy_old = bias_energy
526 moves%trans%attempts = moves%trans%attempts + 1
527 move_updates%trans%attempts = move_updates%trans%attempts + 1
528 moves%bias_trans%attempts = moves%bias_trans%attempts + 1
529 move_updates%bias_trans%attempts = move_updates%bias_trans%attempts + 1
530 IF (.NOT. lbias)
THEN
531 moves%trans%qsuccesses = moves%trans%qsuccesses + 1
532 move_updates%trans%qsuccesses = move_updates%trans%qsuccesses + 1
533 moves%bias_trans%qsuccesses = moves%bias_trans%qsuccesses + 1
534 move_updates%bias_trans%qsuccesses = move_updates%bias_trans%qsuccesses + 1
540 IF (ionode) rand = rng_stream%next()
541 CALL group%bcast(rand, source)
543 move_direction = int(3*rand) + 1
546 IF (ionode) rand = rng_stream%next()
547 CALL group%bcast(rand, source)
548 dis_mol = rmtrans(molecule_type)*(rand - 0.5e0_dp)*2.0e0_dp
551 DO iparticle = start_atom, end_atom
552 particles%els(iparticle)%r(move_direction) = &
553 particles%els(iparticle)%r(move_direction) + dis_mol
561 nunits(:), loverlap, mol_type(start_mol:end_mol), &
562 molecule_number=molecule_number)
565 nunits(:), loverlap, mol_type(start_mol:end_mol), &
566 molecule_number=molecule_number)
567 IF (loverlap) lreject = .true.
579 potential_energy=bias_energy_new)
581 value = -beta*(bias_energy_new - bias_energy_old)
582 IF (
value > exp_max_val)
THEN
584 ELSE IF (
value < exp_min_val)
THEN
592 IF (w >= 1.0e0_dp)
THEN
596 IF (ionode) rand = rng_stream%next()
597 CALL group%bcast(rand, source)
603 moves%bias_trans%successes = moves%bias_trans%successes + 1
604 move_updates%bias_trans%successes = move_updates%bias_trans%successes + 1
605 moves%trans%qsuccesses = moves%trans%qsuccesses + 1
606 move_updates%trans%successes = &
607 move_updates%trans%successes + 1
608 moves%qtrans_dis = moves%qtrans_dis + abs(dis_mol)
609 bias_energy = bias_energy + bias_energy_new - &
618 DO ipart = 1, nunits_tot(box_number)
619 particles%els(ipart)%r(1:3) = r_old(1:3, ipart)
631 CALL timestop(handle)
657 move_updates, box_number, &
658 start_atom, molecule_type, bias_energy, lreject, &
664 INTEGER,
INTENT(IN) :: box_number, start_atom, molecule_type
665 REAL(kind=
dp),
INTENT(INOUT) :: bias_energy
666 LOGICAL,
INTENT(OUT) :: lreject
669 CHARACTER(len=*),
PARAMETER :: routinen =
'mc_molecule_rotation'
671 INTEGER :: atom_number, dir, end_atom, end_mol, handle, ii, imolecule, ipart, iunit, jbox, &
672 molecule_number, nunits_mol, source, start_mol
673 INTEGER,
DIMENSION(:),
POINTER :: mol_type, nunits, nunits_tot
674 INTEGER,
DIMENSION(:, :),
POINTER :: nchains
675 LOGICAL :: ionode, lbias, loverlap, lx, ly
676 REAL(
dp),
DIMENSION(:),
POINTER :: rmrot
677 REAL(
dp),
DIMENSION(:, :),
POINTER :: mass
678 REAL(kind=
dp) :: beta, bias_energy_new, bias_energy_old, cosdg, dgamma, exp_max_val, &
679 exp_min_val, masstot, nxcm, nycm, nzcm, rand, rx, rxnew, ry, rynew, rz, rznew, sindg, &
681 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r_old
689 CALL timeset(routinen, handle)
691 NULLIFY (rmrot, subsys, particles)
695 beta=beta, exp_max_val=exp_max_val, &
696 exp_min_val=exp_min_val, rmrot=rmrot, mc_molecule_info=mc_molecule_info, &
697 ionode=ionode, group=group, source=source)
699 nunits_tot=nunits_tot, nchains=nchains, mass=mass, &
704 DO jbox = 1, box_number - 1
705 start_mol = start_mol + sum(nchains(:, jbox))
707 end_mol = start_mol + sum(nchains(:, box_number)) - 1
709 nunits_mol = nunits(molecule_type)
712 NULLIFY (particles, subsys)
715 ALLOCATE (r_old(1:3, 1:nunits_tot(box_number)))
723 end_atom = start_atom + nunits_mol - 1
726 DO imolecule = 1, sum(nchains(:, box_number))
727 IF (atom_number == start_atom)
THEN
728 molecule_number = imolecule
731 atom_number = atom_number + nunits(mol_type(imolecule + start_mol - 1))
733 IF (molecule_number == 0) cpabort(
'Cannot find the molecule number')
743 DO ipart = 1, nunits_tot(box_number)
744 r_old(1:3, ipart) = particles%els(ipart)%r(1:3)
748 bias_energy_old = bias_energy
758 masstot = sum(mass(1:nunits(molecule_type), molecule_type))
761 moves%bias_rot%attempts = moves%bias_rot%attempts + 1
762 move_updates%bias_rot%attempts = move_updates%bias_rot%attempts + 1
763 moves%rot%attempts = moves%rot%attempts + 1
764 move_updates%rot%attempts = move_updates%rot%attempts + 1
765 IF (.NOT. lbias)
THEN
766 moves%rot%qsuccesses = moves%rot%qsuccesses + 1
767 move_updates%rot%qsuccesses = move_updates%rot%qsuccesses + 1
768 moves%bias_rot%qsuccesses = moves%bias_rot%qsuccesses + 1
769 move_updates%bias_rot%qsuccesses = move_updates%bias_rot%qsuccesses + 1
775 IF (ionode) rand = rng_stream%next()
777 CALL group%bcast(rand, source)
779 dir = int(3*rand) + 1
783 ELSE IF (dir == 2)
THEN
792 DO ii = 1, nunits_mol
793 nxcm = nxcm + particles%els(start_atom - 1 + ii)%r(1)*mass(ii, molecule_type)
794 nycm = nycm + particles%els(start_atom - 1 + ii)%r(2)*mass(ii, molecule_type)
795 nzcm = nzcm + particles%els(start_atom - 1 + ii)%r(3)*mass(ii, molecule_type)
802 IF (ionode) rand = rng_stream%next()
803 CALL group%bcast(rand, source)
804 dgamma = rmrot(molecule_type)*(rand - 0.5e0_dp)*2.0e0_dp
815 DO iunit = start_atom, end_atom
816 ry = particles%els(iunit)%r(2) - nycm
817 rz = particles%els(iunit)%r(3) - nzcm
818 rynew = cosdg*ry - sindg*rz
819 rznew = cosdg*rz + sindg*ry
821 particles%els(iunit)%r(2) = rynew + nycm
822 particles%els(iunit)%r(3) = rznew + nzcm
829 DO iunit = start_atom, end_atom
830 rx = particles%els(iunit)%r(1) - nxcm
831 rz = particles%els(iunit)%r(3) - nzcm
832 rxnew = cosdg*rx + sindg*rz
833 rznew = cosdg*rz - sindg*rx
835 particles%els(iunit)%r(1) = rxnew + nxcm
836 particles%els(iunit)%r(3) = rznew + nzcm
844 DO iunit = start_atom, end_atom
845 rx = particles%els(iunit)%r(1) - nxcm
846 ry = particles%els(iunit)%r(2) - nycm
848 rxnew = cosdg*rx - sindg*ry
849 rynew = cosdg*ry + sindg*rx
851 particles%els(iunit)%r(1) = rxnew + nxcm
852 particles%els(iunit)%r(2) = rynew + nycm
863 nunits(:), loverlap, mol_type(start_mol:end_mol), &
864 molecule_number=molecule_number)
867 nunits(:), loverlap, mol_type(start_mol:end_mol), &
868 molecule_number=molecule_number)
869 IF (loverlap) lreject = .true.
882 potential_energy=bias_energy_new)
884 value = -beta*(bias_energy_new - bias_energy_old)
885 IF (
value > exp_max_val)
THEN
887 ELSE IF (
value < exp_min_val)
THEN
895 IF (w >= 1.0e0_dp)
THEN
899 IF (ionode) rand = rng_stream%next()
900 CALL group%bcast(rand, source)
906 moves%bias_rot%successes = moves%bias_rot%successes + 1
907 move_updates%bias_rot%successes = move_updates%bias_rot%successes + 1
908 moves%rot%qsuccesses = moves%rot%qsuccesses + 1
909 move_updates%rot%successes = move_updates%rot%successes + 1
910 bias_energy = bias_energy + bias_energy_new - &
919 DO ipart = 1, nunits_tot(box_number)
920 particles%els(ipart)%r(1:3) = r_old(1:3, ipart)
932 CALL timestop(handle)
960 old_energy, box_number, &
961 energy_check, r_old, iw, discrete_array, rng_stream)
966 REAL(kind=
dp),
INTENT(INOUT) :: old_energy
967 INTEGER,
INTENT(IN) :: box_number
968 REAL(kind=
dp),
INTENT(INOUT) :: energy_check
969 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: r_old
970 INTEGER,
INTENT(IN) :: iw
971 INTEGER,
DIMENSION(1:3, 1:2),
INTENT(INOUT) :: discrete_array
974 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mc_volume_move'
977 CHARACTER(LEN=40) :: dat_file
978 INTEGER :: cl, end_atom, end_mol, handle, iatom, idim, imolecule, iside, iside_change, &
979 iunit, jbox, nunits_mol, output_unit, print_level, source, start_atom, start_mol
980 INTEGER,
DIMENSION(:),
POINTER :: mol_type, nunits, nunits_tot
981 INTEGER,
DIMENSION(:, :),
POINTER :: nchains
982 LOGICAL :: ionode, ldiscrete, lincrease, loverlap, &
984 REAL(
dp),
DIMENSION(:, :),
POINTER :: mass
985 REAL(kind=
dp) :: beta, discrete_step, energy_term, exp_max_val, exp_min_val, new_energy, &
986 pressure, pressure_term, rand, rcut, rmvolume, temp_var,
value, vol_dis, volume_term, w
987 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r
988 REAL(kind=
dp),
DIMENSION(1:3) :: abc, center_of_mass, center_of_mass_new, &
989 diff, new_cell_length, old_cell_length
990 REAL(kind=
dp),
DIMENSION(1:3, 1:3) :: hmat_test
991 TYPE(
cell_type),
POINTER :: cell, cell_old, cell_test
1000 CALL timeset(routinen, handle)
1004 beta=beta, exp_max_val=exp_max_val, &
1005 exp_min_val=exp_min_val, source=source, group=group, &
1006 dat_file=dat_file, rmvolume=rmvolume, pressure=pressure, cl=cl, &
1008 ldiscrete=ldiscrete, mc_molecule_info=mc_molecule_info)
1010 nunits=nunits, nunits_tot=nunits_tot, mol_type=mol_type, &
1014 DO jbox = 1, box_number - 1
1015 start_mol = start_mol + sum(nchains(:, jbox))
1017 end_mol = start_mol + sum(nchains(:, box_number)) - 1
1022 NULLIFY (particles_old, cell_old, oldsys, cell_test, cell)
1025 ALLOCATE (r(1:3, 1:nunits_tot(box_number)))
1028 moves%volume%attempts = moves%volume%attempts + 1
1029 move_updates%volume%attempts = move_updates%volume%attempts + 1
1035 CALL cell_clone(cell, cell_old, tag=
"CELL_OLD")
1039 old_cell_length(1) = abc(1)
1040 old_cell_length(2) = abc(2)
1041 old_cell_length(3) = abc(3)
1044 DO iatom = 1, nunits_tot(box_number)
1045 r(1:3, iatom) = particles_old%els(iatom)%r(1:3)
1051 IF (ionode) rand = rng_stream%next()
1052 CALL group%bcast(rand, source)
1056 IF (rand < 0.5_dp)
THEN
1062 new_cell_length(1:3) = old_cell_length(1:3)
1067 IF (ionode) rand = rng_stream%next()
1068 CALL group%bcast(rand, source)
1069 iside_change = ceiling(3.0_dp*rand)
1070 IF (discrete_array(iside_change, 1) == 1)
THEN
1071 new_cell_length(iside_change) = &
1072 new_cell_length(iside_change) + discrete_step
1078 IF (ionode) rand = rng_stream%next()
1079 CALL group%bcast(rand, source)
1080 iside_change = ceiling(3.0_dp*rand)
1081 IF (discrete_array(iside_change, 2) == 1)
THEN
1082 new_cell_length(iside_change) = &
1083 new_cell_length(iside_change) - discrete_step
1088 vol_dis = (new_cell_length(1)*new_cell_length(2)*new_cell_length(3)) &
1089 - old_cell_length(1)*old_cell_length(2)*old_cell_length(3)
1093 vol_dis = rmvolume*(rand - 0.5e0_dp)*2.0e0_dp
1102 temp_var = vol_dis + &
1103 old_cell_length(1)*old_cell_length(2)* &
1106 IF (temp_var <= 0.0e0_dp)
THEN
1109 new_cell_length(1) = (temp_var)**(1.0e0_dp/3.0e0_dp)
1110 new_cell_length(2) = new_cell_length(1)
1111 new_cell_length(3) = new_cell_length(1)
1115 CALL group%bcast(loverlap, source)
1122 IF (output_unit > 0)
WRITE (output_unit, *) &
1123 "Volume move rejected because we tried to make too small of box.", vol_dis
1125 CALL timestop(handle)
1130 hmat_test(:, :) = 0.0e0_dp
1131 hmat_test(1, 1) = new_cell_length(1)
1132 hmat_test(2, 2) = new_cell_length(2)
1133 hmat_test(3, 3) = new_cell_length(3)
1134 CALL cell_create(cell_test, hmat=hmat_test(:, :), periodic=cell%perd)
1144 DO imolecule = 1, sum(nchains(:, box_number))
1145 nunits_mol = nunits(mol_type(imolecule + start_mol - 1))
1146 start_atom = end_atom + 1
1147 end_atom = start_atom + nunits_mol - 1
1150 center_of_mass(:), mass(:, mol_type(imolecule + start_mol - 1)))
1155 center_of_mass_new(iside) = center_of_mass(iside)* &
1156 new_cell_length(iside)/old_cell_length(iside)
1160 diff(idim) = center_of_mass_new(idim) - center_of_mass(idim)
1162 DO iunit = start_atom, end_atom
1163 particles_old%els(iunit)%r(idim) = &
1164 particles_old%els(iunit)%r(idim) + diff(idim)
1171 nunits(:), loverlap, mol_type(start_mol:end_mol), &
1172 cell_length=new_cell_length)
1175 CALL group%bcast(loverlap, source)
1182 IF (output_unit > 0)
WRITE (output_unit, *) &
1183 "Volume move rejected due to overlap.", vol_dis
1185 CALL timestop(handle)
1188 DO iatom = 1, nunits_tot(box_number)
1189 particles_old%els(iatom)%r(1:3) = r_old(1:3, iatom)
1196 ltoo_small = .false.
1199 IF (new_cell_length(1) < 2.0_dp*rcut) ltoo_small = .true.
1200 IF (new_cell_length(2) < 2.0_dp*rcut) ltoo_small = .true.
1201 IF (new_cell_length(3) < 2.0_dp*rcut) ltoo_small = .true.
1203 IF (ltoo_small)
THEN
1204 WRITE (iw, *)
'new_cell_lengths ', &
1206 WRITE (iw, *)
'rcut ', rcut/
angstrom
1210 CALL group%bcast(ltoo_small, source)
1211 IF (ltoo_small)
THEN
1212 cpabort(
"Attempted a volume move where box size got too small.")
1218 potential_energy=new_energy)
1222 energy_term = new_energy - old_energy
1223 volume_term = -real(sum(nchains(:, box_number)),
dp)/beta* &
1224 log(new_cell_length(1)*new_cell_length(2)*new_cell_length(3)/ &
1225 (old_cell_length(1)*old_cell_length(2)*old_cell_length(3)))
1226 pressure_term = pressure*vol_dis
1228 value = -beta*(energy_term + volume_term + pressure_term)
1229 IF (
value > exp_max_val)
THEN
1231 ELSE IF (
value < exp_min_val)
THEN
1241 IF (w >= 1.0e0_dp)
THEN
1245 IF (ionode) rand = rng_stream%next()
1246 CALL group%bcast(rand, source)
1252 moves%volume%successes = moves%volume%successes + 1
1253 move_updates%volume%successes = move_updates%volume%successes + 1
1256 energy_check = energy_check + (new_energy - old_energy)
1257 old_energy = new_energy
1259 DO iatom = 1, nunits_tot(box_number)
1260 r_old(1:3, iatom) = particles_old%els(iatom)%r(1:3)
1266 discrete_array(:, :), discrete_step)
1273 DO iatom = 1, nunits_tot(box_number)
1274 particles_old%els(iatom)%r(1:3) = r_old(1:3, iatom)
1285 CALL timestop(handle)
1306 SUBROUTINE change_bond_length(r_old, r_new, mc_par, molecule_type, molecule_kind, &
1307 dis_length, particles, rng_stream)
1309 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: r_old
1310 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(OUT) :: r_new
1312 INTEGER,
INTENT(IN) :: molecule_type
1314 REAL(kind=
dp),
INTENT(OUT) :: dis_length
1318 CHARACTER(len=*),
PARAMETER :: routinen =
'change_bond_length'
1320 INTEGER :: bond_number, handle, i, iatom, ibond, &
1321 ipart, natom, nbond, source
1322 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_a, atom_b, counter
1323 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: connection, connectivity
1324 INTEGER,
DIMENSION(:),
POINTER :: nunits
1326 REAL(
dp),
DIMENSION(:),
POINTER :: rmbond
1327 REAL(kind=
dp) :: atom_mass, mass_a, mass_b, new_length_a, &
1328 new_length_b, old_length, rand
1329 REAL(kind=
dp),
DIMENSION(1:3) :: bond_a, bond_b
1330 TYPE(
bond_type),
DIMENSION(:),
POINTER :: bond_list
1336 CALL timeset(routinen, handle)
1338 NULLIFY (rmbond, mc_molecule_info)
1341 CALL get_mc_par(mc_par, mc_molecule_info=mc_molecule_info, source=source, &
1342 group=group, rmbond=rmbond, ionode=ionode)
1346 DO ipart = 1, nunits(molecule_type)
1347 r_new(1:3, ipart) = r_old(1:3, ipart)
1352 rand = rng_stream%next()
1354 CALL group%bcast(rand, source)
1356 bond_list=bond_list)
1357 bond_number = ceiling(rand*real(nbond,
dp))
1359 ALLOCATE (connection(1:natom, 1:2))
1361 ALLOCATE (connectivity(1:6, 1:natom))
1362 ALLOCATE (counter(1:natom))
1363 ALLOCATE (atom_a(1:natom))
1364 ALLOCATE (atom_b(1:natom))
1365 connection(:, :) = 0
1366 connectivity(:, :) = 0
1375 IF (bond_list(ibond)%a == iatom)
THEN
1376 counter(iatom) = counter(iatom) + 1
1377 connectivity(counter(iatom), iatom) = bond_list(ibond)%b
1378 ELSE IF (bond_list(ibond)%b == iatom)
THEN
1379 counter(iatom) = counter(iatom) + 1
1380 connectivity(counter(iatom), iatom) = bond_list(ibond)%a
1388 atom_a(bond_list(bond_number)%a) = 1
1389 CALL depth_first_search(bond_list(bond_number)%a, bond_list(bond_number)%b, &
1390 connectivity(:, :), atom_a(:))
1392 atom_b(bond_list(bond_number)%b) = 1
1393 CALL depth_first_search(bond_list(bond_number)%b, bond_list(bond_number)%a, &
1394 connectivity(:, :), atom_b(:))
1403 IF (atom_a(iatom) == 1)
THEN
1404 mass_a = mass_a + atom_mass
1406 mass_b = mass_b + atom_mass
1411 IF (ionode) rand = rng_stream%next()
1412 CALL group%bcast(rand, source)
1414 dis_length = rmbond(molecule_type)*2.0e0_dp*(rand - 0.5e0_dp)
1418 bond_a(i) = r_new(i, bond_list(bond_number)%a) - &
1419 r_new(i, bond_list(bond_number)%b)
1420 bond_b(i) = -bond_a(i)
1425 old_length = norm2(bond_a)
1426 new_length_a = dis_length*mass_b/(mass_a + mass_b)
1427 new_length_b = dis_length*mass_a/(mass_a + mass_b)
1430 bond_a(i) = bond_a(i)/old_length*new_length_a
1431 bond_b(i) = bond_b(i)/old_length*new_length_b
1435 IF (atom_a(iatom) == 1)
THEN
1436 r_new(1, iatom) = r_new(1, iatom) + bond_a(1)
1437 r_new(2, iatom) = r_new(2, iatom) + bond_a(2)
1438 r_new(3, iatom) = r_new(3, iatom) + bond_a(3)
1440 r_new(1, iatom) = r_new(1, iatom) + bond_b(1)
1441 r_new(2, iatom) = r_new(2, iatom) + bond_b(2)
1442 r_new(3, iatom) = r_new(3, iatom) + bond_b(3)
1447 dis_length = (old_length + dis_length)/old_length
1449 DEALLOCATE (connection)
1450 DEALLOCATE (connectivity)
1451 DEALLOCATE (counter)
1455 CALL timestop(handle)
1457 END SUBROUTINE change_bond_length
1474 SUBROUTINE change_bond_angle(r_old, r_new, mc_par, molecule_type, molecule_kind, &
1475 particles, rng_stream)
1477 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: r_old
1478 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(OUT) :: r_new
1480 INTEGER,
INTENT(IN) :: molecule_type
1485 CHARACTER(len=*),
PARAMETER :: routinen =
'change_bond_angle'
1487 INTEGER :: bend_number, handle, i, iatom, ibond, &
1488 ipart, natom, nbend, nbond, source
1489 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_a, atom_c, counter
1490 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: connection, connectivity
1491 INTEGER,
DIMENSION(:),
POINTER :: nunits
1493 REAL(
dp),
DIMENSION(:),
POINTER :: rmangle
1494 REAL(kind=
dp) :: atom_mass, bis_length, dis_angle, dis_angle_a, dis_angle_c, mass_a, mass_c, &
1495 new_angle_a, new_angle_c, old_angle, old_length_a, old_length_c, rand, temp_length
1496 REAL(kind=
dp),
DIMENSION(1:3) :: bisector, bond_a, bond_c, cross_prod, &
1497 cross_prod_plane, temp
1498 TYPE(
bend_type),
DIMENSION(:),
POINTER :: bend_list
1499 TYPE(
bond_type),
DIMENSION(:),
POINTER :: bond_list
1505 CALL timeset(routinen, handle)
1507 NULLIFY (bend_list, bond_list, rmangle, mc_molecule_info)
1510 CALL get_mc_par(mc_par, rmangle=rmangle, source=source, &
1511 group=group, ionode=ionode, mc_molecule_info=mc_molecule_info)
1515 DO ipart = 1, nunits(molecule_type)
1516 r_new(1:3, ipart) = r_old(1:3, ipart)
1521 rand = rng_stream%next()
1523 CALL group%bcast(rand, source)
1525 bend_list=bend_list, bond_list=bond_list, nbond=nbond)
1526 bend_number = ceiling(rand*real(nbend,
dp))
1528 ALLOCATE (connection(1:natom, 1:2))
1530 ALLOCATE (connectivity(1:6, 1:natom))
1531 ALLOCATE (counter(1:natom))
1532 ALLOCATE (atom_a(1:natom))
1533 ALLOCATE (atom_c(1:natom))
1534 connection(:, :) = 0
1535 connectivity(:, :) = 0
1544 IF (bond_list(ibond)%a == iatom)
THEN
1545 counter(iatom) = counter(iatom) + 1
1546 connectivity(counter(iatom), iatom) = bond_list(ibond)%b
1547 ELSE IF (bond_list(ibond)%b == iatom)
THEN
1548 counter(iatom) = counter(iatom) + 1
1549 connectivity(counter(iatom), iatom) = bond_list(ibond)%a
1557 atom_a(bend_list(bend_number)%a) = 1
1558 CALL depth_first_search(bend_list(bend_number)%a, bend_list(bend_number)%b, &
1559 connectivity(:, :), atom_a(:))
1561 atom_c(bend_list(bend_number)%c) = 1
1562 CALL depth_first_search(bend_list(bend_number)%c, bend_list(bend_number)%b, &
1563 connectivity(:, :), atom_c(:))
1572 IF (atom_a(iatom) == 1) mass_a = mass_a + atom_mass
1573 IF (atom_c(iatom) == 1) mass_c = mass_c + atom_mass
1577 IF (ionode) rand = rng_stream%next()
1578 CALL group%bcast(rand, source)
1580 dis_angle = rmangle(molecule_type)*2.0e0_dp*(rand - 0.5e0_dp)
1590 bond_a(i) = r_new(i, bend_list(bend_number)%a) - &
1591 r_new(i, bend_list(bend_number)%b)
1592 bond_c(i) = r_new(i, bend_list(bend_number)%c) - &
1593 r_new(i, bend_list(bend_number)%b)
1595 old_length_a = norm2(bond_a)
1596 old_length_c = norm2(bond_c)
1597 old_angle = acos(dot_product(bond_a, bond_c)/(old_length_a*old_length_c))
1600 bisector(i) = bond_a(i)/old_length_a + &
1601 bond_c(i)/old_length_c
1603 bis_length = norm2(bisector)
1604 bisector(1:3) = bisector(1:3)/bis_length
1608 cross_prod(1) = bond_a(2)*bond_c(3) - bond_a(3)*bond_c(2)
1609 cross_prod(2) = bond_a(3)*bond_c(1) - bond_a(1)*bond_c(3)
1610 cross_prod(3) = bond_a(1)*bond_c(2) - bond_a(2)*bond_c(1)
1611 cross_prod(1:3) = cross_prod(1:3)/norm2(cross_prod)
1614 cross_prod_plane(1) = cross_prod(2)*bisector(3) - cross_prod(3)*bisector(2)
1615 cross_prod_plane(2) = cross_prod(3)*bisector(1) - cross_prod(1)*bisector(3)
1616 cross_prod_plane(3) = cross_prod(1)*bisector(2) - cross_prod(2)*bisector(1)
1617 cross_prod_plane(1:3) = cross_prod_plane(1:3)/ &
1618 norm2(cross_prod_plane)
1624 r_new(1:3, iatom) = r_new(1:3, iatom) - &
1625 r_old(1:3, bend_list(bend_number)%b)
1631 dis_angle_a = dis_angle*mass_c/(mass_a + mass_c)
1632 dis_angle_c = dis_angle*mass_a/(mass_a + mass_c)
1637 temp(1:3) = r_new(1:3, iatom) - &
1638 dot_product(cross_prod(1:3), r_new(1:3, iatom))* &
1640 temp_length = norm2(temp)
1644 IF (atom_a(iatom) == 1)
THEN
1648 IF (dot_product(cross_prod_plane(1:3), r_new(1:3, iatom)) &
1652 new_angle_a = acos(dot_product(bisector, temp(1:3))/ &
1653 (temp_length)) + dis_angle_a
1655 r_new(1:3, iatom) = cos(new_angle_a)*temp_length*bisector(1:3) - &
1656 sin(new_angle_a)*temp_length*cross_prod_plane(1:3) + &
1657 dot_product(cross_prod(1:3), r_new(1:3, iatom))* &
1662 new_angle_a = acos(dot_product(bisector, temp(1:3))/ &
1663 (temp_length)) - dis_angle_a
1665 r_new(1:3, iatom) = cos(new_angle_a)*temp_length*bisector(1:3) + &
1666 sin(new_angle_a)*temp_length*cross_prod_plane(1:3) + &
1667 dot_product(cross_prod(1:3), r_new(1:3, iatom))* &
1671 ELSE IF (atom_c(iatom) == 1)
THEN
1675 IF (dot_product(cross_prod_plane(1:3), r_new(1:3, iatom)) &
1678 new_angle_c = acos(dot_product(bisector(1:3), temp(1:3))/ &
1679 (temp_length)) - dis_angle_c
1681 r_new(1:3, iatom) = cos(new_angle_c)*temp_length*bisector(1:3) - &
1682 sin(new_angle_c)*temp_length*cross_prod_plane(1:3) + &
1683 dot_product(cross_prod(1:3), r_new(1:3, iatom))* &
1686 new_angle_c = acos(dot_product(bisector(1:3), temp(1:3))/ &
1687 (temp_length)) + dis_angle_c
1689 r_new(1:3, iatom) = cos(new_angle_c)*temp_length*bisector(1:3) + &
1690 sin(new_angle_c)*temp_length*cross_prod_plane(1:3) + &
1691 dot_product(cross_prod(1:3), r_new(1:3, iatom))* &
1699 r_new(1:3, iatom) = r_new(1:3, iatom) + &
1700 r_old(1:3, bend_list(bend_number)%b)
1704 DEALLOCATE (connection)
1705 DEALLOCATE (connectivity)
1706 DEALLOCATE (counter)
1711 CALL timestop(handle)
1713 END SUBROUTINE change_bond_angle
1733 SUBROUTINE change_dihedral(r_old, r_new, mc_par, molecule_type, molecule_kind, &
1734 particles, rng_stream)
1736 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: r_old
1737 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(OUT) :: r_new
1739 INTEGER,
INTENT(IN) :: molecule_type
1744 CHARACTER(len=*),
PARAMETER :: routinen =
'change_dihedral'
1746 INTEGER :: handle, i, iatom, ibond, ipart, natom, &
1747 nbond, ntorsion, source, torsion_number
1748 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_a, atom_d, counter
1749 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: connection, connectivity
1750 INTEGER,
DIMENSION(:),
POINTER :: nunits
1752 REAL(
dp),
DIMENSION(:),
POINTER :: rmdihedral
1753 REAL(kind=
dp) :: atom_mass, dis_angle, dis_angle_a, &
1754 dis_angle_d, mass_a, mass_d, &
1755 old_length_a, rand, u, v, w, x, y, z
1756 REAL(kind=
dp),
DIMENSION(1:3) :: bond_a, temp
1757 TYPE(
bond_type),
DIMENSION(:),
POINTER :: bond_list
1760 TYPE(
torsion_type),
DIMENSION(:),
POINTER :: torsion_list
1764 CALL timeset(routinen, handle)
1766 NULLIFY (rmdihedral, torsion_list, bond_list, mc_molecule_info)
1769 CALL get_mc_par(mc_par, rmdihedral=rmdihedral, &
1770 source=source, group=group, ionode=ionode, &
1771 mc_molecule_info=mc_molecule_info)
1775 DO ipart = 1, nunits(molecule_type)
1776 r_new(1:3, ipart) = r_old(1:3, ipart)
1781 rand = rng_stream%next()
1784 CALL group%bcast(rand, source)
1786 bond_list=bond_list, nbond=nbond, &
1787 ntorsion=ntorsion, torsion_list=torsion_list)
1788 torsion_number = ceiling(rand*real(ntorsion,
dp))
1790 ALLOCATE (connection(1:natom, 1:2))
1792 ALLOCATE (connectivity(1:6, 1:natom))
1793 ALLOCATE (counter(1:natom))
1794 ALLOCATE (atom_a(1:natom))
1795 ALLOCATE (atom_d(1:natom))
1796 connection(:, :) = 0
1797 connectivity(:, :) = 0
1806 IF (bond_list(ibond)%a == iatom)
THEN
1807 counter(iatom) = counter(iatom) + 1
1808 connectivity(counter(iatom), iatom) = bond_list(ibond)%b
1809 ELSE IF (bond_list(ibond)%b == iatom)
THEN
1810 counter(iatom) = counter(iatom) + 1
1811 connectivity(counter(iatom), iatom) = bond_list(ibond)%a
1820 atom_a(torsion_list(torsion_number)%a) = 1
1821 CALL depth_first_search(torsion_list(torsion_number)%b, &
1822 torsion_list(torsion_number)%c, connectivity(:, :), atom_a(:))
1824 atom_d(torsion_list(torsion_number)%d) = 1
1825 CALL depth_first_search(torsion_list(torsion_number)%c, &
1826 torsion_list(torsion_number)%b, connectivity(:, :), atom_d(:))
1835 IF (atom_a(iatom) == 1) mass_a = mass_a + atom_mass
1836 IF (atom_d(iatom) == 1) mass_d = mass_d + atom_mass
1840 IF (ionode) rand = rng_stream%next()
1841 CALL group%bcast(rand, source)
1843 dis_angle = rmdihedral(molecule_type)*2.0e0_dp*(rand - 0.5e0_dp)
1847 bond_a(i) = r_new(i, torsion_list(torsion_number)%c) - &
1848 r_new(i, torsion_list(torsion_number)%b)
1850 old_length_a = norm2(bond_a)
1851 bond_a(1:3) = bond_a(1:3)/old_length_a
1856 dis_angle_a = dis_angle*mass_d/(mass_a + mass_d)
1857 dis_angle_d = -dis_angle*mass_a/(mass_a + mass_d)
1861 IF (atom_a(iatom) == 1)
THEN
1863 r_new(1:3, iatom) = r_new(1:3, iatom) - &
1864 r_new(1:3, torsion_list(torsion_number)%b)
1873 temp(1) = (u*(u*x + v*y + w*z) + (x*(v**2 + w**2) - u*(v*y + w*z))*cos(dis_angle_a) + &
1874 sqrt(u**2 + v**2 + w**2)*(v*z - w*y)*sin(dis_angle_a))/(u**2 + v**2 + w**2)
1875 temp(2) = (v*(u*x + v*y + w*z) + (y*(u**2 + w**2) - v*(u*x + w*z))*cos(dis_angle_a) + &
1876 sqrt(u**2 + v**2 + w**2)*(w*x - u*z)*sin(dis_angle_a))/(u**2 + v**2 + w**2)
1877 temp(3) = (w*(u*x + v*y + w*z) + (z*(v**2 + u**2) - w*(u*x + v*y))*cos(dis_angle_a) + &
1878 sqrt(u**2 + v**2 + w**2)*(u*y - v*x)*sin(dis_angle_a))/(u**2 + v**2 + w**2)
1881 temp(1:3) = temp(1:3) + r_new(1:3, torsion_list(torsion_number)%b)
1882 r_new(1:3, iatom) = temp(1:3)
1884 ELSE IF (atom_d(iatom) == 1)
THEN
1887 r_new(1:3, iatom) = r_new(1:3, iatom) - &
1888 r_new(1:3, torsion_list(torsion_number)%c)
1897 temp(1) = (u*(u*x + v*y + w*z) + (x*(v**2 + w**2) - u*(v*y + w*z))*cos(dis_angle_d) + &
1898 sqrt(u**2 + v**2 + w**2)*(v*z - w*y)*sin(dis_angle_d))/(u**2 + v**2 + w**2)
1899 temp(2) = (v*(u*x + v*y + w*z) + (y*(u**2 + w**2) - v*(u*x + w*z))*cos(dis_angle_d) + &
1900 sqrt(u**2 + v**2 + w**2)*(w*x - u*z)*sin(dis_angle_d))/(u**2 + v**2 + w**2)
1901 temp(3) = (w*(u*x + v*y + w*z) + (z*(v**2 + u**2) - w*(u*x + v*y))*cos(dis_angle_d) + &
1902 sqrt(u**2 + v**2 + w**2)*(u*y - v*x)*sin(dis_angle_d))/(u**2 + v**2 + w**2)
1905 temp(1:3) = temp(1:3) + r_new(1:3, torsion_list(torsion_number)%c)
1906 r_new(1:3, iatom) = temp(1:3)
1911 DEALLOCATE (connection)
1912 DEALLOCATE (connectivity)
1913 DEALLOCATE (counter)
1918 CALL timestop(handle)
1920 END SUBROUTINE change_dihedral
1947 energy_check, r_old, old_energy, start_atom_swap, &
1949 molecule_type, box_number, bias_energy_old, last_bias_energy, &
1950 move_type, rng_stream)
1955 REAL(kind=
dp),
INTENT(INOUT) :: energy_check
1956 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: r_old
1957 REAL(kind=
dp),
INTENT(INOUT) :: old_energy
1958 INTEGER,
INTENT(IN) :: start_atom_swap, target_atom, &
1959 molecule_type, box_number
1960 REAL(kind=
dp),
INTENT(INOUT) :: bias_energy_old, last_bias_energy
1961 CHARACTER(LEN=*),
INTENT(IN) :: move_type
1964 CHARACTER(len=*),
PARAMETER :: routinen =
'mc_avbmc_move'
1966 INTEGER :: end_mol, handle, ipart, jbox, natom, &
1967 nswapmoves, source, start_mol
1968 INTEGER,
DIMENSION(:),
POINTER :: avbmc_atom, mol_type, nunits, nunits_tot
1969 INTEGER,
DIMENSION(:, :),
POINTER :: nchains
1970 LOGICAL :: ionode, lbias, ldum, lin, loverlap
1971 REAL(
dp),
DIMENSION(:),
POINTER :: avbmc_rmax, avbmc_rmin, pbias
1972 REAL(
dp),
DIMENSION(:, :),
POINTER :: mass
1973 REAL(kind=
dp) :: beta, bias_energy_new, del_quickstep_energy, distance, exp_max_val, &
1974 exp_min_val, max_val, min_val, new_energy, prefactor, rand, rdum, volume_in, volume_out, &
1975 w, weight_new, weight_old
1976 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r_new
1977 REAL(kind=
dp),
DIMENSION(1:3) :: abc, rij
1989 CALL timeset(routinen, handle)
1993 beta=beta, max_val=max_val, min_val=min_val, exp_max_val=exp_max_val, &
1994 exp_min_val=exp_min_val, avbmc_atom=avbmc_atom, &
1995 avbmc_rmin=avbmc_rmin, avbmc_rmax=avbmc_rmax, &
1996 nswapmoves=nswapmoves, ionode=ionode, source=source, &
1997 group=group, pbias=pbias, mc_molecule_info=mc_molecule_info)
1999 mass=mass, nunits=nunits, nunits_tot=nunits_tot, mol_type=mol_type)
2002 DO jbox = 1, box_number - 1
2003 start_mol = start_mol + sum(nchains(:, jbox))
2005 end_mol = start_mol + sum(nchains(:, box_number)) - 1
2008 NULLIFY (particles, subsys, molecule_kinds, molecule_kind, &
2009 particles_force, subsys_force)
2012 ALLOCATE (r_new(1:3, 1:nunits_tot(box_number)))
2021 particles=particles, molecule_kinds=molecule_kinds)
2022 molecule_kind => molecule_kinds%els(1)
2034 particles=particles, molecule_kinds=molecule_kinds)
2035 molecule_kind => molecule_kinds%els(1)
2043 rij(1) = particles%els(start_atom_swap + avbmc_atom(molecule_type) - 1)%r(1) - &
2044 particles%els(target_atom)%r(1) - abc(1)*anint( &
2045 (particles%els(start_atom_swap + avbmc_atom(molecule_type) - 1)%r(1) - &
2046 particles%els(target_atom)%r(1))/abc(1))
2047 rij(2) = particles%els(start_atom_swap + avbmc_atom(molecule_type) - 1)%r(2) - &
2048 particles%els(target_atom)%r(2) - abc(2)*anint( &
2049 (particles%els(start_atom_swap + avbmc_atom(molecule_type) - 1)%r(2) - &
2050 particles%els(target_atom)%r(2))/abc(2))
2051 rij(3) = particles%els(start_atom_swap + avbmc_atom(molecule_type) - 1)%r(3) - &
2052 particles%els(target_atom)%r(3) - abc(3)*anint( &
2053 (particles%els(start_atom_swap + avbmc_atom(molecule_type) - 1)%r(3) - &
2054 particles%els(target_atom)%r(3))/abc(3))
2055 distance = sqrt(rij(1)**2 + rij(2)**2 + rij(3)**2)
2056 IF (distance <= avbmc_rmax(molecule_type) .AND. distance >= avbmc_rmin(molecule_type))
THEN
2065 IF (move_type ==
'in')
THEN
2066 moves%avbmc_inin%attempts = &
2067 moves%avbmc_inin%attempts + 1
2069 moves%avbmc_inout%attempts = &
2070 moves%avbmc_inout%attempts + 1
2073 IF (move_type ==
'in')
THEN
2074 moves%avbmc_outin%attempts = &
2075 moves%avbmc_outin%attempts + 1
2077 moves%avbmc_outout%attempts = &
2078 moves%avbmc_outout%attempts + 1
2084 IF (move_type ==
'in')
THEN
2088 exp_min_val, nswapmoves, &
2089 weight_old, start_atom_swap, nunits_tot(box_number), nunits, nunits(molecule_type), &
2090 mass(:, molecule_type), ldum, rdum, &
2091 bias_energy_old, ionode, .true., mol_type(start_mol:end_mol), nchains(:, box_number), &
2092 source, group, rng_stream, &
2093 avbmc_atom=avbmc_atom(molecule_type), &
2094 rmin=avbmc_rmin(molecule_type), rmax=avbmc_rmax(molecule_type), move_type=
'out', &
2095 target_atom=target_atom)
2101 exp_min_val, nswapmoves, &
2102 weight_old, start_atom_swap, nunits_tot(box_number), nunits, nunits(molecule_type), &
2103 mass(:, molecule_type), ldum, rdum, &
2104 bias_energy_old, ionode, .true., mol_type(start_mol:end_mol), nchains(:, box_number), &
2105 source, group, rng_stream, &
2106 avbmc_atom=avbmc_atom(molecule_type), &
2107 rmin=avbmc_rmin(molecule_type), rmax=avbmc_rmax(molecule_type), move_type=
'in', &
2108 target_atom=target_atom)
2114 exp_min_val, nswapmoves, &
2115 weight_new, start_atom_swap, nunits_tot(box_number), nunits, nunits(molecule_type), &
2116 mass(:, molecule_type), loverlap, bias_energy_new, &
2117 bias_energy_old, ionode, .false., mol_type(start_mol:end_mol), nchains(:, box_number), &
2118 source, group, rng_stream, &
2119 avbmc_atom=avbmc_atom(molecule_type), &
2120 rmin=avbmc_rmin(molecule_type), rmax=avbmc_rmax(molecule_type), move_type=move_type, &
2121 target_atom=target_atom)
2127 bias_energy_new = bias_energy_new + bias_energy_old
2131 IF (move_type ==
'in')
THEN
2135 exp_min_val, nswapmoves, &
2136 weight_old, start_atom_swap, nunits_tot(box_number), nunits, nunits(molecule_type), &
2137 mass(:, molecule_type), ldum, rdum, old_energy, &
2138 ionode, .true., mol_type(start_mol:end_mol), nchains(:, box_number), &
2139 source, group, rng_stream, &
2140 avbmc_atom=avbmc_atom(molecule_type), &
2141 rmin=avbmc_rmin(molecule_type), rmax=avbmc_rmax(molecule_type), move_type=
'out', &
2142 target_atom=target_atom)
2148 exp_min_val, nswapmoves, &
2149 weight_old, start_atom_swap, nunits_tot(box_number), nunits, nunits(molecule_type), &
2150 mass(:, molecule_type), ldum, rdum, old_energy, &
2151 ionode, .true., mol_type(start_mol:end_mol), nchains(:, box_number), &
2152 source, group, rng_stream, &
2153 avbmc_atom=avbmc_atom(molecule_type), &
2154 rmin=avbmc_rmin(molecule_type), rmax=avbmc_rmax(molecule_type), move_type=
'in', &
2155 target_atom=target_atom)
2161 exp_min_val, nswapmoves, &
2162 weight_new, start_atom_swap, nunits_tot(box_number), nunits, nunits(molecule_type), &
2163 mass(:, molecule_type), loverlap, new_energy, old_energy, &
2164 ionode, .false., mol_type(start_mol:end_mol), nchains(:, box_number), &
2165 source, group, rng_stream, &
2166 avbmc_atom=avbmc_atom(molecule_type), &
2167 rmin=avbmc_rmin(molecule_type), rmax=avbmc_rmax(molecule_type), move_type=move_type, &
2168 target_atom=target_atom)
2183 DO ipart = 1, nunits_tot(box_number)
2184 particles%els(ipart)%r(1:3) = r_old(1:3, ipart)
2187 CALL timestop(handle)
2200 DO ipart = 1, nunits_tot(box_number)
2201 particles_force%els(ipart)%r(1:3) = particles%els(ipart)%r(1:3)
2207 potential_energy=new_energy)
2211 volume_in = 4.0_dp/3.0_dp*
pi*(avbmc_rmax(molecule_type)**3 - avbmc_rmin(molecule_type)**3)
2212 volume_out = abc(1)*abc(2)*abc(3) - volume_in
2214 IF (lin .AND. move_type ==
'in' .OR. &
2215 .NOT. lin .AND. move_type ==
'out')
THEN
2218 ELSE IF (.NOT. lin .AND. move_type ==
'in')
THEN
2219 prefactor = (1.0_dp - pbias(molecule_type))*volume_in/(pbias(molecule_type)*volume_out)
2221 prefactor = pbias(molecule_type)*volume_out/((1.0_dp - pbias(molecule_type))*volume_in)
2228 del_quickstep_energy = (-beta)*(new_energy - old_energy - &
2229 (bias_energy_new - bias_energy_old))
2231 IF (del_quickstep_energy > exp_max_val)
THEN
2232 del_quickstep_energy = max_val
2233 ELSE IF (del_quickstep_energy < exp_min_val)
THEN
2234 del_quickstep_energy = 0.0_dp
2236 del_quickstep_energy = exp(del_quickstep_energy)
2239 w = prefactor*del_quickstep_energy*weight_new/weight_old
2244 w = prefactor*weight_new/weight_old
2248 IF (w >= 1.0e0_dp)
THEN
2251 IF (ionode) rand = rng_stream%next()
2252 CALL group%bcast(rand, source)
2260 IF (move_type ==
'in')
THEN
2261 moves%avbmc_inin%successes = &
2262 moves%avbmc_inin%successes + 1
2264 moves%avbmc_inout%successes = &
2265 moves%avbmc_inout%successes + 1
2268 IF (move_type ==
'in')
THEN
2269 moves%avbmc_outin%successes = &
2270 moves%avbmc_outin%successes + 1
2272 moves%avbmc_outout%successes = &
2273 moves%avbmc_outout%successes + 1
2279 IF (.NOT. lbias)
THEN
2280 new_energy = new_energy + old_energy
2284 energy_check = energy_check + (new_energy - old_energy)
2285 old_energy = new_energy
2290 last_bias_energy = bias_energy_new
2291 bias_energy_old = bias_energy_new
2297 DO ipart = 1, nunits_tot(box_number)
2298 r_old(1:3, ipart) = particles%els(ipart)%r(1:3)
2305 DO ipart = 1, nunits_tot(box_number)
2306 particles%els(ipart)%r(1:3) = r_old(1:3, ipart)
2312 DO ipart = 1, nunits_tot(box_number)
2313 particles%els(ipart)%r(1:3) = r_old(1:3, ipart)
2322 CALL timestop(handle)
2347 SUBROUTINE mc_hmc_move(mc_par, force_env, globenv, moves, move_updates, &
2348 old_energy, box_number, &
2349 energy_check, r_old, rng_stream)
2355 REAL(kind=
dp),
INTENT(INOUT) :: old_energy
2356 INTEGER,
INTENT(IN) :: box_number
2357 REAL(kind=
dp),
INTENT(INOUT) :: energy_check
2358 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: r_old
2361 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mc_hmc_move'
2363 INTEGER :: handle, iatom, source
2364 INTEGER,
DIMENSION(:),
POINTER :: nunits_tot
2366 REAL(kind=
dp) :: beta, energy_term, exp_max_val, &
2367 exp_min_val, new_energy, rand,
value, w
2368 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r
2377 CALL timeset(routinen, handle)
2381 beta=beta, exp_max_val=exp_max_val, &
2382 exp_min_val=exp_min_val, source=source, group=group, &
2383 mc_molecule_info=mc_molecule_info)
2387 NULLIFY (particles_old, oldsys, hmc_ekin)
2390 ALLOCATE (r(1:3, 1:nunits_tot(box_number)))
2394 moves%hmc%attempts = moves%hmc%attempts + 1
2395 move_updates%hmc%attempts = move_updates%hmc%attempts + 1
2402 DO iatom = 1, nunits_tot(box_number)
2403 r(1:3, iatom) = particles_old%els(iatom)%r(1:3)
2407 CALL qs_mol_dyn(force_env, globenv, hmc_e_initial=hmc_ekin%initial_ekin, hmc_e_final=hmc_ekin%final_ekin)
2411 potential_energy=new_energy)
2415 energy_term = new_energy + hmc_ekin%final_ekin - old_energy - hmc_ekin%initial_ekin
2417 value = -beta*(energy_term)
2418 IF (
value > exp_max_val)
THEN
2420 ELSE IF (
value < exp_min_val)
THEN
2426 IF (w >= 1.0e0_dp)
THEN
2430 IF (ionode) rand = rng_stream%next()
2431 CALL group%bcast(rand, source)
2437 moves%hmc%successes = moves%hmc%successes + 1
2438 move_updates%hmc%successes = move_updates%hmc%successes + 1
2441 energy_check = energy_check + (new_energy - old_energy)
2442 old_energy = new_energy
2444 DO iatom = 1, nunits_tot(box_number)
2445 r_old(1:3, iatom) = particles_old%els(iatom)%r(1:3)
2451 DO iatom = 1, nunits_tot(box_number)
2452 particles_old%els(iatom)%r(1:3) = r_old(1:3, iatom)
2459 DEALLOCATE (hmc_ekin)
2462 CALL timestop(handle)
2487 move_updates, box_number, bias_energy, lreject, rng_stream)
2492 INTEGER,
INTENT(IN) :: box_number
2493 REAL(kind=
dp),
INTENT(INOUT) :: bias_energy
2494 LOGICAL,
INTENT(OUT) :: lreject
2497 CHARACTER(len=*),
PARAMETER :: routinen =
'mc_cluster_translation'
2499 INTEGER :: cstart, end_mol, handle, imol, ipart, iparticle, iunit, jbox, jpart, junit, &
2500 move_direction, nend, nunit, source, start_mol, total_clus, total_clusafmo
2501 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: cluster
2502 INTEGER,
DIMENSION(:),
POINTER :: mol_type, nunits, nunits_tot
2503 INTEGER,
DIMENSION(:, :),
POINTER :: nchains
2504 LOGICAL :: ionode, lbias, loverlap
2505 REAL(kind=
dp) :: beta, bias_energy_new, bias_energy_old, &
2506 dis_mol, exp_max_val, exp_min_val, &
2507 rand, rmcltrans,
value, w
2508 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: r_old
2517 CALL timeset(routinen, handle)
2520 NULLIFY (particles, subsys)
2524 beta=beta, exp_max_val=exp_max_val, &
2525 exp_min_val=exp_min_val, rmcltrans=rmcltrans, ionode=ionode, source=source, &
2526 group=group, mc_molecule_info=mc_molecule_info)
2528 nchains=nchains, nunits=nunits, mol_type=mol_type)
2532 DO jbox = 1, box_number - 1
2533 start_mol = start_mol + sum(nchains(:, jbox))
2535 end_mol = start_mol + sum(nchains(:, box_number)) - 1
2538 ALLOCATE (r_old(1:3, 1:nunits_tot(box_number)))
2541 nend = sum(nchains(:, box_number))
2542 ALLOCATE (cluster(nend, nend))
2545 cluster(ipart, jpart) = 0
2551 CALL cluster_search(mc_par, bias_env, cluster, nchains(:, box_number), &
2552 nunits, mol_type(start_mol:end_mol), total_clus)
2554 CALL cluster_search(mc_par, force_env, cluster, nchains(:, box_number), &
2555 nunits, mol_type(start_mol:end_mol), total_clus)
2565 DO ipart = 1, nunits_tot(box_number)
2566 r_old(1:3, ipart) = particles%els(ipart)%r(1:3)
2570 bias_energy_old = bias_energy
2579 moves%cltrans%attempts = moves%cltrans%attempts + 1
2580 move_updates%cltrans%attempts = move_updates%cltrans%attempts + 1
2581 moves%bias_cltrans%attempts = moves%bias_cltrans%attempts + 1
2582 move_updates%bias_cltrans%attempts = move_updates%bias_cltrans%attempts + 1
2583 IF (.NOT. lbias)
THEN
2584 moves%cltrans%qsuccesses = moves%cltrans%qsuccesses + 1
2585 move_updates%cltrans%qsuccesses = move_updates%cltrans%qsuccesses + 1
2586 moves%bias_cltrans%qsuccesses = moves%bias_cltrans%qsuccesses + 1
2587 move_updates%bias_cltrans%qsuccesses = move_updates%bias_cltrans%qsuccesses + 1
2591 IF (ionode) rand = rng_stream%next()
2592 CALL group%bcast(rand, source)
2593 move_direction = int(3*rand) + 1
2596 IF (ionode) rand = rng_stream%next()
2597 CALL group%bcast(rand, source)
2598 dis_mol = rmcltrans*(rand - 0.5e0_dp)*2.0e0_dp
2601 IF (ionode) rand = rng_stream%next()
2602 CALL group%bcast(rand, source)
2603 jpart = int(1 + rand*total_clus)
2608 IF (cluster(jpart, cstart) /= 0)
THEN
2609 imol = cluster(jpart, cstart)
2611 DO ipart = 1, imol - 1
2612 nunit = nunits(mol_type(ipart + start_mol - 1))
2613 iunit = iunit + nunit
2615 nunit = nunits(mol_type(imol + start_mol - 1))
2616 junit = iunit + nunit - 1
2617 DO iparticle = iunit, junit
2618 particles%els(iparticle)%r(move_direction) = &
2619 particles%els(iparticle)%r(move_direction) + dis_mol
2628 cluster(ipart, jpart) = 0
2634 CALL cluster_search(mc_par, bias_env, cluster, nchains(:, box_number), &
2635 nunits, mol_type(start_mol:end_mol), total_clusafmo)
2637 CALL cluster_search(mc_par, force_env, cluster, nchains(:, box_number), &
2638 nunits, mol_type(start_mol:end_mol), total_clusafmo)
2645 nunits(:), loverlap, mol_type(start_mol:end_mol))
2648 nunits(:), loverlap, mol_type(start_mol:end_mol))
2649 IF (loverlap) lreject = .true.
2654 IF (total_clusafmo /= total_clus)
THEN
2658 IF (total_clusafmo /= total_clus)
THEN
2673 potential_energy=bias_energy_new)
2675 value = -beta*(bias_energy_new - bias_energy_old)
2676 IF (
value > exp_max_val)
THEN
2678 ELSE IF (
value < exp_min_val)
THEN
2686 IF (w >= 1.0e0_dp)
THEN
2690 IF (ionode) rand = rng_stream%next()
2691 CALL group%bcast(rand, source)
2696 moves%bias_cltrans%successes = moves%bias_cltrans%successes + 1
2697 move_updates%bias_cltrans%successes = move_updates%bias_cltrans%successes + 1
2698 moves%cltrans%qsuccesses = moves%cltrans%qsuccesses + 1
2699 move_updates%cltrans%successes = &
2700 move_updates%cltrans%successes + 1
2701 moves%qcltrans_dis = moves%qcltrans_dis + abs(dis_mol)
2702 bias_energy = bias_energy + bias_energy_new - &
2711 DO ipart = 1, nunits_tot(box_number)
2712 particles%els(ipart)%r(1:3) = r_old(1:3, ipart)
2721 DEALLOCATE (cluster)
2725 CALL timestop(handle)
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.
Handles all functions related to the CELL.
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public cell_clone(cell_in, cell_out, tag)
Clone cell variable.
subroutine, public get_cell(cell, alpha, beta, gamma, deth, orthorhombic, abc, periodic, h, h_inv, symmetry_id, tag)
Get informations about a simulation cell.
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
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 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
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.
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_fist_force
Define type storing the global information of a run. Keep the amount of stored data small....
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
contains miscellaneous subroutines used in the Monte Carlo runs,mostly geared towards changes in coor...
subroutine, public generate_cbmc_swap_config(force_env, beta, max_val, min_val, exp_max_val, exp_min_val, nswapmoves, rosenbluth_weight, start_atom, natoms_tot, nunits, nunits_mol, mass, loverlap, choosen_energy, old_energy, ionode, lremove, mol_type, nchains, source, group, rng_stream, avbmc_atom, rmin, rmax, move_type, target_atom)
takes the last molecule in a force environment and moves it around to different center of mass positi...
subroutine, public get_center_of_mass(coordinates, natom, center_of_mass, mass)
calculates the center of mass of a given molecule
subroutine, public check_for_overlap(force_env, nchains, nunits, loverlap, mol_type, cell_length, molecule_number)
looks for overlaps (intermolecular distances less than rmin)
subroutine, public create_discrete_array(cell, discrete_array, step_size)
generates an array that tells us which sides of the simulation cell we can increase or decrease using...
subroutine, public cluster_search(mc_par, force_env, cluster, nchains, nunits, mol_type, total_clus)
determine the number of cluster present in the given configuration based on the rclus value
the various moves in Monte Carlo (MC) simulations, including change of internal conformation,...
subroutine, public mc_molecule_rotation(mc_par, force_env, bias_env, moves, move_updates, box_number, start_atom, molecule_type, bias_energy, lreject, rng_stream)
rotates the given molecule randomly around the x,y, or z axis... only works for water at the moment
subroutine, public mc_avbmc_move(mc_par, force_env, bias_env, moves, energy_check, r_old, old_energy, start_atom_swap, target_atom, molecule_type, box_number, bias_energy_old, last_bias_energy, move_type, rng_stream)
performs either a bond or angle change move for a given molecule
subroutine, public mc_volume_move(mc_par, force_env, moves, move_updates, old_energy, box_number, energy_check, r_old, iw, discrete_array, rng_stream)
performs a Monte Carlo move that alters the volume of the simulation box
subroutine, public mc_molecule_translation(mc_par, force_env, bias_env, moves, move_updates, start_atom, box_number, bias_energy, molecule_type, lreject, rng_stream)
translates the given molecule randomly in either the x,y, or z direction
subroutine, public mc_cluster_translation(mc_par, force_env, bias_env, moves, move_updates, box_number, bias_energy, lreject, rng_stream)
translates the cluster randomly in either the x,y, or z direction
subroutine, public mc_hmc_move(mc_par, force_env, globenv, moves, move_updates, old_energy, box_number, energy_check, r_old, rng_stream)
performs a hybrid Monte Carlo move that runs a short MD sequence
subroutine, public mc_conformation_change(mc_par, force_env, bias_env, moves, move_updates, start_atom, molecule_type, box_number, bias_energy, move_type, lreject, rng_stream)
performs either a bond or angle change move for a given molecule
holds all the structure types needed for Monte Carlo, except the mc_environment_type
subroutine, public get_mc_par(mc_par, nstep, nvirial, iuptrans, iupcltrans, iupvolume, nmoves, nswapmoves, rm, cl, diff, nstart, source, group, lbias, ionode, lrestart, lstop, rmvolume, rmcltrans, rmbond, rmangle, rmrot, rmtrans, temperature, pressure, rclus, beta, pmswap, pmvolume, pmtraion, pmtrans, pmcltrans, ensemble, program, restart_file_name, molecules_file, moves_file, coords_file, energy_file, displacement_file, cell_file, dat_file, data_file, box2_file, fft_lib, iprint, rcut, ldiscrete, discrete_step, pmavbmc, pbias, avbmc_atom, avbmc_rmin, avbmc_rmax, rmdihedral, input_file, mc_molecule_info, pmswap_mol, pmavbmc_mol, pmtrans_mol, pmrot_mol, pmtraion_mol, mc_input_file, mc_bias_file, pmvol_box, pmclus_box, virial_temps, exp_min_val, exp_max_val, min_val, max_val, eta, pmhmc, pmhmc_box, lhmc, rand2skip)
...
subroutine, public get_mc_molecule_info(mc_molecule_info, nmol_types, nchain_total, nboxes, names, conf_prob, nchains, nunits, mol_type, nunits_tot, in_box, atom_names, mass)
...
Perform a molecular dynamics (MD) run using QUICKSTEP.
subroutine, public qs_mol_dyn(force_env, globenv, averages, rm_restart_info, hmc_e_initial, hmc_e_final, mdctrl)
Main driver module for Molecular Dynamics.
Interface to the message passing library MPI.
represent a simple array based list of the given type
Define the molecule kind structure types and the corresponding functionality.
subroutine, public get_molecule_kind(molecule_kind, atom_list, bond_list, bend_list, ub_list, impr_list, opbend_list, colv_list, fixd_list, g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, name, mass, charge, kind_number, natom, nbend, nbond, nub, nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, molecule_list, nelectron, nelectron_alpha, nelectron_beta, bond_kind_set, bend_kind_set, ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, molname_generated)
Get informations about a molecule kind.
Parallel (pseudo)random number generator (RNG) for multiple streams and substreams of random numbers.
represent a simple array based list of the given type
Definition of physical constants:
real(kind=dp), parameter, public angstrom
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,...
wrapper to abstract the force evaluation of the various methods
contains the initially parsed file and the initial parallel environment
represent a list of objects
represent a list of objects