58#include "../../base/base_uses.f90"
84 INTEGER,
DIMENSION(:),
POINTER :: avbmc_atom => null()
86 INTEGER :: iupvolume = 0
87 INTEGER :: iuptrans = 0
88 INTEGER :: iupcltrans = 0
89 INTEGER :: nvirial = 0
92 INTEGER :: nswapmoves = 0
100 LOGICAL :: ldiscrete = .false.
101 LOGICAL :: lbias = .false.
102 LOGICAL :: ionode = .false.
103 LOGICAL :: lrestart = .false.
104 LOGICAL :: lstop = .false.
105 LOGICAL :: lhmc = .false.
106 CHARACTER(LEN=20) :: ensemble =
""
107 CHARACTER(LEN=default_path_length) :: restart_file_name =
""
108 CHARACTER(LEN=default_path_length) :: molecules_file =
""
109 CHARACTER(LEN=default_path_length) :: moves_file =
""
110 CHARACTER(LEN=default_path_length) :: coords_file =
""
111 CHARACTER(LEN=default_path_length) :: energy_file =
""
112 CHARACTER(LEN=default_path_length) :: displacement_file =
""
113 CHARACTER(LEN=default_path_length) :: cell_file =
""
114 CHARACTER(LEN=default_path_length) :: dat_file =
""
115 CHARACTER(LEN=default_path_length) :: data_file =
""
116 CHARACTER(LEN=default_path_length) :: box2_file =
""
118 CHARACTER(LEN=50) :: program =
""
119 REAL(
dp),
DIMENSION(:),
POINTER :: pmtraion_mol => null(), pmtrans_mol => null(), &
120 pmrot_mol => null(), pmswap_mol => null(), &
121 pbias => null(), pmavbmc_mol => null()
122 REAL(
dp) :: discrete_step = 0.0_dp
123 REAL(
dp) :: rmvolume = 0.0_dp, rmcltrans = 0.0_dp
124 REAL(
dp),
DIMENSION(:),
POINTER :: rmbond => null(), rmangle => null(), rmdihedral => null(), &
125 rmrot => null(), rmtrans => null()
126 REAL(
dp),
DIMENSION(:),
POINTER :: eta => null()
127 REAL(
dp) :: temperature = 0.0_dp
128 REAL(
dp) :: pressure = 0.0_dp
129 REAL(
dp) :: rclus = 0.0_dp
130 REAL(
dp) :: pmavbmc = 0.0_dp
131 REAL(
dp) :: pmswap = 0.0_dp
132 REAL(
dp) :: pmvolume = 0.0_dp, pmvol_box = 0.0_dp, pmclus_box = 0.0_dp
133 REAL(
dp) :: pmhmc = 0.0_dp, pmhmc_box = 0.0_dp
134 REAL(
dp) :: pmtraion = 0.0_dp
135 REAL(
dp) :: pmtrans = 0.0_dp
136 REAL(
dp) :: pmcltrans = 0.0_dp
137 REAL(
dp) :: beta = 0.0_dp
138 REAL(
dp) :: rcut = 0.0_dp
139 REAL(
dp),
DIMENSION(:),
POINTER :: avbmc_rmin => null(), avbmc_rmax => null()
140 REAL(
dp),
DIMENSION(:),
POINTER :: virial_temps => null()
142 mc_input_file => null(), mc_bias_file => null()
145 REAL(
dp) :: exp_min_val = 0.0_dp, exp_max_val = 0.0_dp, min_val = 0.0_dp, max_val = 0.0_dp
146 INTEGER :: rand2skip = 0
152 REAL(
dp) :: initial_ekin = 0.0_dp, final_ekin = 0.0_dp
158 INTEGER :: run_type_row = 0, run_type_column = 0, coord_row_start = 0, coord_row_end = 0, &
159 cell_row = 0, cell_column = 0, force_eval_row_start = 0, force_eval_row_end = 0, &
160 global_row_start = 0, global_row_end = 0, in_use = 0, nunits_empty = 0, &
161 motion_row_end = 0, motion_row_start = 0
162 INTEGER,
DIMENSION(:),
POINTER :: mol_set_nmol_row => null(), mol_set_nmol_column => null()
163 CHARACTER(LEN=default_string_length),
DIMENSION(:),
POINTER :: text => null()
164 CHARACTER(LEN=default_string_length),
DIMENSION(:),
POINTER :: atom_names_empty => null()
165 REAL(
dp),
DIMENSION(:, :),
POINTER :: coordinates_empty => null()
173 INTEGER :: nboxes = 0
174 CHARACTER(LEN=default_string_length),
DIMENSION(:),
POINTER :: names => null()
175 CHARACTER(LEN=default_string_length), &
176 DIMENSION(:, :),
POINTER :: atom_names => null()
177 REAL(
dp),
DIMENSION(:, :),
POINTER :: conf_prob => null(), mass => null()
178 INTEGER,
DIMENSION(:, :),
POINTER :: nchains => null()
179 INTEGER :: nmol_types = 0, nchain_total = 0
180 INTEGER,
DIMENSION(:),
POINTER :: nunits => null(), mol_type => null(), nunits_tot => null(), in_box => null()
192 REAL(kind=
dp) :: ave_energy = 0.0_dp
193 REAL(kind=
dp) :: ave_energy_squared = 0.0_dp
194 REAL(kind=
dp) :: ave_volume = 0.0_dp
195 REAL(kind=
dp) :: molecules = 0.0_dp
226 REAL(kind=
dp) :: trans_dis = 0.0_dp, qtrans_dis = 0.0_dp
227 REAL(kind=
dp) :: cltrans_dis = 0.0_dp, qcltrans_dis = 0.0_dp
228 INTEGER :: empty = 0, grown = 0, empty_conf = 0, empty_avbmc = 0
233 INTEGER :: successes = 0
234 INTEGER :: qsuccesses = 0
235 INTEGER :: attempts = 0
244 CHARACTER(len=*),
PARAMETER,
PRIVATE :: modulen =
'mc_types'
275 coord_row_start, coord_row_end, cell_row, cell_column, &
276 force_eval_row_start, force_eval_row_end, global_row_start, global_row_end, &
277 mol_set_nmol_row, mol_set_nmol_column, in_use, text, atom_names_empty, &
278 nunits_empty, coordinates_empty, motion_row_end, motion_row_start)
281 INTEGER,
INTENT(OUT),
OPTIONAL :: run_type_row, run_type_column, coord_row_start, &
282 coord_row_end, cell_row, cell_column, force_eval_row_start, force_eval_row_end, &
283 global_row_start, global_row_end
284 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: mol_set_nmol_row, mol_set_nmol_column
285 INTEGER,
INTENT(OUT),
OPTIONAL :: in_use
286 CHARACTER(LEN=default_string_length), &
287 DIMENSION(:),
OPTIONAL,
POINTER :: text, atom_names_empty
288 INTEGER,
INTENT(OUT),
OPTIONAL :: nunits_empty
289 REAL(
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: coordinates_empty
290 INTEGER,
INTENT(OUT),
OPTIONAL :: motion_row_end, motion_row_start
292 IF (
PRESENT(in_use)) in_use = mc_input_file%in_use
293 IF (
PRESENT(run_type_row)) run_type_row = mc_input_file%run_type_row
294 IF (
PRESENT(run_type_column)) run_type_column = mc_input_file%run_type_column
295 IF (
PRESENT(coord_row_start)) coord_row_start = mc_input_file%coord_row_start
296 IF (
PRESENT(coord_row_end)) coord_row_end = mc_input_file%coord_row_end
297 IF (
PRESENT(cell_row)) cell_row = mc_input_file%cell_row
298 IF (
PRESENT(cell_column)) cell_column = mc_input_file%cell_column
299 IF (
PRESENT(force_eval_row_start)) force_eval_row_start = mc_input_file%force_eval_row_start
300 IF (
PRESENT(force_eval_row_end)) force_eval_row_end = mc_input_file%force_eval_row_end
301 IF (
PRESENT(global_row_start)) global_row_start = mc_input_file%global_row_start
302 IF (
PRESENT(global_row_end)) global_row_end = mc_input_file%global_row_end
303 IF (
PRESENT(nunits_empty)) nunits_empty = mc_input_file%nunits_empty
304 IF (
PRESENT(motion_row_start)) motion_row_start = mc_input_file%motion_row_start
305 IF (
PRESENT(motion_row_end)) motion_row_end = mc_input_file%motion_row_end
307 IF (
PRESENT(mol_set_nmol_row)) mol_set_nmol_row => mc_input_file%mol_set_nmol_row
308 IF (
PRESENT(mol_set_nmol_column)) mol_set_nmol_column => mc_input_file%mol_set_nmol_column
309 IF (
PRESENT(text)) text => mc_input_file%text
310 IF (
PRESENT(atom_names_empty)) atom_names_empty => mc_input_file%atom_names_empty
311 IF (
PRESENT(coordinates_empty)) coordinates_empty => mc_input_file%coordinates_empty
394 SUBROUTINE get_mc_par(mc_par, nstep, nvirial, iuptrans, iupcltrans, iupvolume, &
395 nmoves, nswapmoves, rm, cl, diff, nstart, &
396 source, group, lbias, ionode, lrestart, lstop, rmvolume, rmcltrans, rmbond, rmangle, &
397 rmrot, rmtrans, temperature, pressure, rclus, BETA, pmswap, pmvolume, pmtraion, pmtrans, &
398 pmcltrans, ensemble, PROGRAM, restart_file_name, molecules_file, moves_file, coords_file, &
399 energy_file, displacement_file, cell_file, dat_file, data_file, box2_file, &
400 fft_lib, iprint, rcut, ldiscrete, discrete_step, &
401 pmavbmc, pbias, avbmc_atom, avbmc_rmin, avbmc_rmax, rmdihedral, &
402 input_file, mc_molecule_info, pmswap_mol, pmavbmc_mol, pmtrans_mol, pmrot_mol, &
403 pmtraion_mol, mc_input_file, mc_bias_file, pmvol_box, pmclus_box, virial_temps, &
404 exp_min_val, exp_max_val, min_val, max_val, eta, pmhmc, pmhmc_box, lhmc, rand2skip)
413 INTEGER,
INTENT(OUT),
OPTIONAL :: nstep, nvirial, iuptrans, iupcltrans, &
414 iupvolume, nmoves, nswapmoves, rm, cl, &
417 LOGICAL,
INTENT(OUT),
OPTIONAL :: lbias, ionode, lrestart, lstop
418 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: rmvolume, rmcltrans
419 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: rmbond, rmangle, rmrot, rmtrans
420 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: temperature, pressure, rclus, beta, &
421 pmswap, pmvolume, pmtraion, pmtrans, &
423 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: ensemble, program, restart_file_name, &
424 molecules_file, moves_file, coords_file, energy_file, displacement_file, cell_file, &
425 dat_file, data_file, box2_file,
fft_lib
426 INTEGER,
INTENT(OUT),
OPTIONAL :: iprint
427 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: rcut
428 LOGICAL,
INTENT(OUT),
OPTIONAL :: ldiscrete
429 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: discrete_step, pmavbmc
430 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: pbias
431 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: avbmc_atom
432 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: avbmc_rmin, avbmc_rmax, rmdihedral
435 REAL(
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: pmswap_mol
436 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: pmavbmc_mol, pmtrans_mol, pmrot_mol, &
439 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: pmvol_box, pmclus_box
440 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: virial_temps
441 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: exp_min_val, exp_max_val, min_val, &
443 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: eta
444 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: pmhmc, pmhmc_box
445 LOGICAL,
INTENT(OUT),
OPTIONAL :: lhmc
446 INTEGER,
INTENT(OUT),
OPTIONAL :: rand2skip
448 IF (
PRESENT(nstep)) nstep = mc_par%nstep
449 IF (
PRESENT(nvirial)) nvirial = mc_par%nvirial
450 IF (
PRESENT(iuptrans)) iuptrans = mc_par%iuptrans
451 IF (
PRESENT(iupcltrans)) iupcltrans = mc_par%iupcltrans
452 IF (
PRESENT(iupvolume)) iupvolume = mc_par%iupvolume
453 IF (
PRESENT(nmoves)) nmoves = mc_par%nmoves
454 IF (
PRESENT(nswapmoves)) nswapmoves = mc_par%nswapmoves
455 IF (
PRESENT(rm)) rm = mc_par%rm
456 IF (
PRESENT(cl)) cl = mc_par%cl
457 IF (
PRESENT(diff)) diff = mc_par%diff
458 IF (
PRESENT(nstart)) nstart = mc_par%nstart
459 IF (
PRESENT(source)) source = mc_par%source
460 IF (
PRESENT(group)) group = mc_par%group
461 IF (
PRESENT(iprint)) iprint = mc_par%iprint
463 IF (
PRESENT(lbias)) lbias = mc_par%lbias
464 IF (
PRESENT(ionode)) ionode = mc_par%ionode
465 IF (
PRESENT(lrestart)) lrestart = mc_par%lrestart
466 IF (
PRESENT(lstop)) lstop = mc_par%lstop
467 IF (
PRESENT(ldiscrete)) ldiscrete = mc_par%ldiscrete
469 IF (
PRESENT(virial_temps)) virial_temps => mc_par%virial_temps
470 IF (
PRESENT(avbmc_atom)) avbmc_atom => mc_par%avbmc_atom
471 IF (
PRESENT(avbmc_rmin)) avbmc_rmin => mc_par%avbmc_rmin
472 IF (
PRESENT(avbmc_rmax)) avbmc_rmax => mc_par%avbmc_rmax
473 IF (
PRESENT(rcut)) rcut = mc_par%rcut
474 IF (
PRESENT(discrete_step)) discrete_step = mc_par%discrete_step
475 IF (
PRESENT(rmvolume)) rmvolume = mc_par%rmvolume
476 IF (
PRESENT(rmcltrans)) rmcltrans = mc_par%rmcltrans
477 IF (
PRESENT(temperature)) temperature = mc_par%temperature
478 IF (
PRESENT(pressure)) pressure = mc_par%pressure
479 IF (
PRESENT(rclus)) rclus = mc_par%rclus
480 IF (
PRESENT(beta)) beta = mc_par%BETA
481 IF (
PRESENT(exp_max_val)) exp_max_val = mc_par%exp_max_val
482 IF (
PRESENT(exp_min_val)) exp_min_val = mc_par%exp_min_val
483 IF (
PRESENT(max_val)) max_val = mc_par%max_val
484 IF (
PRESENT(min_val)) min_val = mc_par%min_val
485 IF (
PRESENT(pmswap)) pmswap = mc_par%pmswap
486 IF (
PRESENT(pmvolume)) pmvolume = mc_par%pmvolume
487 IF (
PRESENT(lhmc)) lhmc = mc_par%lhmc
488 IF (
PRESENT(pmhmc)) pmhmc = mc_par%pmhmc
489 IF (
PRESENT(pmhmc_box)) pmhmc_box = mc_par%pmhmc_box
490 IF (
PRESENT(pmvol_box)) pmvol_box = mc_par%pmvol_box
491 IF (
PRESENT(pmclus_box)) pmclus_box = mc_par%pmclus_box
492 IF (
PRESENT(pmtraion)) pmtraion = mc_par%pmtraion
493 IF (
PRESENT(pmtrans)) pmtrans = mc_par%pmtrans
494 IF (
PRESENT(pmcltrans)) pmcltrans = mc_par%pmcltrans
495 IF (
PRESENT(pmavbmc)) pmavbmc = mc_par%pmavbmc
496 IF (
PRESENT(pmrot_mol)) pmrot_mol => mc_par%pmrot_mol
497 IF (
PRESENT(pmtrans_mol)) pmtrans_mol => mc_par%pmtrans_mol
498 IF (
PRESENT(pmtraion_mol)) pmtraion_mol => mc_par%pmtraion_mol
499 IF (
PRESENT(pmavbmc_mol)) pmavbmc_mol => mc_par%pmavbmc_mol
500 IF (
PRESENT(pbias)) pbias => mc_par%pbias
502 IF (
PRESENT(rmbond)) rmbond => mc_par%rmbond
503 IF (
PRESENT(rmangle)) rmangle => mc_par%rmangle
504 IF (
PRESENT(rmdihedral)) rmdihedral => mc_par%rmdihedral
505 IF (
PRESENT(rmrot)) rmrot => mc_par%rmrot
506 IF (
PRESENT(rmtrans)) rmtrans => mc_par%rmtrans
508 IF (
PRESENT(eta)) eta => mc_par%eta
510 IF (
PRESENT(ensemble)) ensemble = mc_par%ensemble
511 IF (
PRESENT(program))
PROGRAM = mc_par%program
512 IF (
PRESENT(restart_file_name)) restart_file_name = &
513 mc_par%restart_file_name
514 IF (
PRESENT(moves_file)) moves_file = mc_par%moves_file
515 IF (
PRESENT(coords_file)) coords_file = mc_par%coords_file
516 IF (
PRESENT(molecules_file)) molecules_file = mc_par%molecules_file
517 IF (
PRESENT(energy_file)) energy_file = mc_par%energy_file
518 IF (
PRESENT(displacement_file)) displacement_file = &
519 mc_par%displacement_file
520 IF (
PRESENT(cell_file)) cell_file = mc_par%cell_file
521 IF (
PRESENT(dat_file)) dat_file = mc_par%dat_file
522 IF (
PRESENT(data_file)) data_file = mc_par%data_file
523 IF (
PRESENT(box2_file)) box2_file = mc_par%box2_file
526 IF (
PRESENT(input_file)) input_file => mc_par%input_file
527 IF (
PRESENT(mc_molecule_info)) mc_molecule_info => mc_par%mc_molecule_info
528 IF (
PRESENT(mc_input_file)) mc_input_file => mc_par%mc_input_file
529 IF (
PRESENT(mc_bias_file)) mc_bias_file => mc_par%mc_bias_file
531 IF (
PRESENT(pmswap_mol)) pmswap_mol => mc_par%pmswap_mol
532 IF (
PRESENT(rand2skip)) rand2skip = mc_par%rand2skip
552 names, conf_prob, nchains, nunits, mol_type, nunits_tot, in_box, atom_names, &
562 INTEGER,
INTENT(OUT),
OPTIONAL :: nmol_types, nchain_total, nboxes
563 CHARACTER(LEN=default_string_length), &
564 DIMENSION(:),
OPTIONAL,
POINTER :: names
565 REAL(
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: conf_prob
566 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: nchains
567 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nunits, mol_type, nunits_tot, in_box
568 CHARACTER(LEN=default_string_length), &
569 DIMENSION(:, :),
OPTIONAL,
POINTER :: atom_names
570 REAL(
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: mass
572 IF (
PRESENT(nboxes)) nboxes = mc_molecule_info%nboxes
573 IF (
PRESENT(nchain_total)) nchain_total = mc_molecule_info%nchain_total
574 IF (
PRESENT(nmol_types)) nmol_types = mc_molecule_info%nmol_types
576 IF (
PRESENT(names)) names => mc_molecule_info%names
577 IF (
PRESENT(atom_names)) atom_names => mc_molecule_info%atom_names
579 IF (
PRESENT(conf_prob)) conf_prob => mc_molecule_info%conf_prob
580 IF (
PRESENT(mass)) mass => mc_molecule_info%mass
582 IF (
PRESENT(nchains)) nchains => mc_molecule_info%nchains
583 IF (
PRESENT(nunits)) nunits => mc_molecule_info%nunits
584 IF (
PRESENT(mol_type)) mol_type => mc_molecule_info%mol_type
585 IF (
PRESENT(nunits_tot)) nunits_tot => mc_molecule_info%nunits_tot
586 IF (
PRESENT(in_box)) in_box => mc_molecule_info%in_box
659 diff, nstart, rmvolume, rmcltrans, rmbond, rmangle, rmdihedral, rmrot, rmtrans, PROGRAM, &
660 nmoves, nswapmoves, lstop, temperature, pressure, rclus, iuptrans, iupcltrans, iupvolume, &
661 pmswap, pmvolume, pmtraion, pmtrans, pmcltrans, BETA, rcut, iprint, lbias, nstep, &
662 lrestart, ldiscrete, discrete_step, pmavbmc, mc_molecule_info, &
663 pmavbmc_mol, pmtrans_mol, pmrot_mol, pmtraion_mol, pmswap_mol, &
664 avbmc_rmin, avbmc_rmax, avbmc_atom, pbias, ensemble, pmvol_box, pmclus_box, eta, &
665 mc_input_file, mc_bias_file, exp_max_val, exp_min_val, min_val, max_val, &
666 pmhmc, pmhmc_box, lhmc, ionode, source, group, rand2skip)
669 INTEGER,
INTENT(IN),
OPTIONAL :: rm, cl, diff, nstart
670 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: rmvolume, rmcltrans
671 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: rmbond, rmangle, rmdihedral, rmrot, &
673 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: program
674 INTEGER,
INTENT(IN),
OPTIONAL :: nmoves, nswapmoves
675 LOGICAL,
INTENT(IN),
OPTIONAL :: lstop
676 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: temperature, pressure, rclus
677 INTEGER,
INTENT(IN),
OPTIONAL :: iuptrans, iupcltrans, iupvolume
678 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: pmswap, pmvolume, pmtraion, pmtrans, &
679 pmcltrans, beta, rcut
680 INTEGER,
INTENT(IN),
OPTIONAL :: iprint
681 LOGICAL,
INTENT(IN),
OPTIONAL :: lbias
682 INTEGER,
INTENT(IN),
OPTIONAL :: nstep
683 LOGICAL,
INTENT(IN),
OPTIONAL :: lrestart, ldiscrete
684 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: discrete_step, pmavbmc
686 REAL(
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: pmavbmc_mol, pmtrans_mol, pmrot_mol, &
687 pmtraion_mol, pmswap_mol, avbmc_rmin, &
689 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: avbmc_atom
690 REAL(
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: pbias
691 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: ensemble
692 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: pmvol_box, pmclus_box
693 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: eta
695 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: exp_max_val, exp_min_val, min_val, &
696 max_val, pmhmc, pmhmc_box
697 LOGICAL,
INTENT(IN),
OPTIONAL :: lhmc, ionode
698 INTEGER,
INTENT(IN),
OPTIONAL :: source
701 INTEGER,
INTENT(IN),
OPTIONAL :: rand2skip
708 IF (
PRESENT(nstep)) mc_par%nstep = nstep
709 IF (
PRESENT(rm)) mc_par%rm = rm
710 IF (
PRESENT(cl)) mc_par%cl = cl
711 IF (
PRESENT(diff)) mc_par%diff = diff
712 IF (
PRESENT(nstart)) mc_par%nstart = nstart
713 IF (
PRESENT(nmoves)) mc_par%nmoves = nmoves
714 IF (
PRESENT(nswapmoves)) mc_par%nswapmoves = nswapmoves
715 IF (
PRESENT(iprint)) mc_par%iprint = iprint
716 IF (
PRESENT(iuptrans)) mc_par%iuptrans = iuptrans
717 IF (
PRESENT(iupcltrans)) mc_par%iupcltrans = iupcltrans
718 IF (
PRESENT(iupvolume)) mc_par%iupvolume = iupvolume
720 IF (
PRESENT(ldiscrete)) mc_par%ldiscrete = ldiscrete
721 IF (
PRESENT(lstop)) mc_par%lstop = lstop
722 IF (
PRESENT(lbias)) mc_par%lbias = lbias
723 IF (
PRESENT(lrestart)) mc_par%lrestart = lrestart
725 IF (
PRESENT(exp_max_val)) mc_par%exp_max_val = exp_max_val
726 IF (
PRESENT(exp_min_val)) mc_par%exp_min_val = exp_min_val
727 IF (
PRESENT(max_val)) mc_par%max_val = max_val
728 IF (
PRESENT(min_val)) mc_par%min_val = min_val
729 IF (
PRESENT(beta)) mc_par%BETA = beta
730 IF (
PRESENT(temperature)) mc_par%temperature = temperature
731 IF (
PRESENT(rcut)) mc_par%rcut = rcut
732 IF (
PRESENT(pressure)) mc_par%pressure = pressure
733 IF (
PRESENT(rclus)) mc_par%rclus = rclus
734 IF (
PRESENT(pmvolume)) mc_par%pmvolume = pmvolume
735 IF (
PRESENT(lhmc)) mc_par%lhmc = lhmc
736 IF (
PRESENT(pmhmc)) mc_par%pmhmc = pmhmc
737 IF (
PRESENT(pmhmc_box)) mc_par%pmhmc_box = pmhmc_box
738 IF (
PRESENT(pmvol_box)) mc_par%pmvol_box = pmvol_box
739 IF (
PRESENT(pmclus_box)) mc_par%pmclus_box = pmclus_box
740 IF (
PRESENT(pmswap)) mc_par%pmswap = pmswap
741 IF (
PRESENT(pmtrans)) mc_par%pmtrans = pmtrans
742 IF (
PRESENT(pmcltrans)) mc_par%pmcltrans = pmcltrans
743 IF (
PRESENT(pmtraion)) mc_par%pmtraion = pmtraion
744 IF (
PRESENT(pmavbmc)) mc_par%pmavbmc = pmavbmc
746 IF (
PRESENT(discrete_step)) mc_par%discrete_step = discrete_step
747 IF (
PRESENT(rmvolume)) mc_par%rmvolume = rmvolume
748 IF (
PRESENT(rmcltrans)) mc_par%rmcltrans = rmcltrans
750 IF (
PRESENT(mc_input_file)) mc_par%mc_input_file => mc_input_file
751 IF (
PRESENT(mc_bias_file)) mc_par%mc_bias_file => mc_bias_file
755 IF (
PRESENT(eta))
THEN
756 DO iparm = 1,
SIZE(eta)
757 mc_par%eta(iparm) = eta(iparm)
760 IF (
PRESENT(rmbond))
THEN
761 DO iparm = 1,
SIZE(rmbond)
762 mc_par%rmbond(iparm) = rmbond(iparm)
765 IF (
PRESENT(rmangle))
THEN
766 DO iparm = 1,
SIZE(rmangle)
767 mc_par%rmangle(iparm) = rmangle(iparm)
770 IF (
PRESENT(rmdihedral))
THEN
771 DO iparm = 1,
SIZE(rmdihedral)
772 mc_par%rmdihedral(iparm) = rmdihedral(iparm)
775 IF (
PRESENT(rmrot))
THEN
776 DO iparm = 1,
SIZE(rmrot)
777 mc_par%rmrot(iparm) = rmrot(iparm)
780 IF (
PRESENT(rmtrans))
THEN
781 DO iparm = 1,
SIZE(rmtrans)
782 mc_par%rmtrans(iparm) = rmtrans(iparm)
786 IF (
PRESENT(pmavbmc_mol))
THEN
787 DO iparm = 1,
SIZE(pmavbmc_mol)
788 mc_par%pmavbmc_mol(iparm) = pmavbmc_mol(iparm)
791 IF (
PRESENT(pmtrans_mol))
THEN
792 DO iparm = 1,
SIZE(pmtrans_mol)
793 mc_par%pmtrans_mol(iparm) = pmtrans_mol(iparm)
796 IF (
PRESENT(pmrot_mol))
THEN
797 DO iparm = 1,
SIZE(pmrot_mol)
798 mc_par%pmrot_mol(iparm) = pmrot_mol(iparm)
801 IF (
PRESENT(pmtraion_mol))
THEN
802 DO iparm = 1,
SIZE(pmtraion_mol)
803 mc_par%pmtraion_mol(iparm) = pmtraion_mol(iparm)
806 IF (
PRESENT(pmswap_mol))
THEN
807 DO iparm = 1,
SIZE(pmswap_mol)
808 mc_par%pmswap_mol(iparm) = pmswap_mol(iparm)
812 IF (
PRESENT(avbmc_atom))
THEN
813 DO iparm = 1,
SIZE(avbmc_atom)
814 mc_par%avbmc_atom(iparm) = avbmc_atom(iparm)
817 IF (
PRESENT(avbmc_rmin))
THEN
818 DO iparm = 1,
SIZE(avbmc_rmin)
819 mc_par%avbmc_rmin(iparm) = avbmc_rmin(iparm)
822 IF (
PRESENT(avbmc_rmax))
THEN
823 DO iparm = 1,
SIZE(avbmc_rmax)
824 mc_par%avbmc_rmax(iparm) = avbmc_rmax(iparm)
827 IF (
PRESENT(pbias))
THEN
828 DO iparm = 1,
SIZE(pbias)
829 mc_par%pbias(iparm) = pbias(iparm)
833 IF (
PRESENT(program)) mc_par%program =
PROGRAM
834 IF (
PRESENT(ensemble)) mc_par%ensemble = ensemble
836 IF (
PRESENT(mc_molecule_info)) mc_par%mc_molecule_info => mc_molecule_info
837 IF (
PRESENT(source)) mc_par%source = source
838 IF (
PRESENT(group)) mc_par%group = group
839 IF (
PRESENT(ionode)) mc_par%ionode = ionode
841 IF (
PRESENT(rand2skip)) mc_par%rand2skip = rand2skip
853 INTEGER,
INTENT(IN) :: nmol_types
858 ALLOCATE (mc_par%pmtraion_mol(1:nmol_types))
859 ALLOCATE (mc_par%pmtrans_mol(1:nmol_types))
860 ALLOCATE (mc_par%pmrot_mol(1:nmol_types))
861 ALLOCATE (mc_par%pmswap_mol(1:nmol_types))
863 ALLOCATE (mc_par%eta(1:nmol_types))
865 ALLOCATE (mc_par%rmbond(1:nmol_types))
866 ALLOCATE (mc_par%rmangle(1:nmol_types))
867 ALLOCATE (mc_par%rmdihedral(1:nmol_types))
868 ALLOCATE (mc_par%rmtrans(1:nmol_types))
869 ALLOCATE (mc_par%rmrot(1:nmol_types))
871 ALLOCATE (mc_par%avbmc_atom(1:nmol_types))
872 ALLOCATE (mc_par%avbmc_rmin(1:nmol_types))
873 ALLOCATE (mc_par%avbmc_rmax(1:nmol_types))
874 ALLOCATE (mc_par%pmavbmc_mol(1:nmol_types))
875 ALLOCATE (mc_par%pbias(1:nmol_types))
877 ALLOCATE (mc_par%mc_input_file)
878 ALLOCATE (mc_par%mc_bias_file)
891 DEALLOCATE (mc_par%mc_input_file)
892 DEALLOCATE (mc_par%mc_bias_file)
894 DEALLOCATE (mc_par%pmtraion_mol)
895 DEALLOCATE (mc_par%pmtrans_mol)
896 DEALLOCATE (mc_par%pmrot_mol)
897 DEALLOCATE (mc_par%pmswap_mol)
899 DEALLOCATE (mc_par%eta)
901 DEALLOCATE (mc_par%rmbond)
902 DEALLOCATE (mc_par%rmangle)
903 DEALLOCATE (mc_par%rmdihedral)
904 DEALLOCATE (mc_par%rmtrans)
905 DEALLOCATE (mc_par%rmrot)
907 DEALLOCATE (mc_par%avbmc_atom)
908 DEALLOCATE (mc_par%avbmc_rmin)
909 DEALLOCATE (mc_par%avbmc_rmax)
910 DEALLOCATE (mc_par%pmavbmc_mol)
911 DEALLOCATE (mc_par%pbias)
912 IF (mc_par%ensemble ==
"VIRIAL")
THEN
913 DEALLOCATE (mc_par%virial_temps)
931 mc_molecule_info, empty_coords, lhmc)
934 CHARACTER(LEN=*),
INTENT(IN) :: input_file_name
936 REAL(
dp),
DIMENSION(:, :) :: empty_coords
937 LOGICAL,
INTENT(IN) :: lhmc
939 CHARACTER(default_string_length) :: cdum, line, method_name
940 CHARACTER(default_string_length), &
941 DIMENSION(:, :),
POINTER :: atom_names
942 INTEGER :: abc_column, abc_row, cell_column, cell_row, idum, iline, io_stat, irep, iunit, &
943 iw, line_number, nlines, nmol_types, nstart, row_number, unit
944 INTEGER,
DIMENSION(:),
POINTER :: nunits
952 nunits=nunits, atom_names=atom_names)
953 ALLOCATE (mc_input_file%coordinates_empty(1:3, 1:nunits(1)))
954 ALLOCATE (mc_input_file%atom_names_empty(1:nunits(1)))
955 DO iunit = 1, nunits(1)
956 mc_input_file%atom_names_empty(iunit) = atom_names(iunit, 1)
957 mc_input_file%coordinates_empty(1:3, iunit) = empty_coords(1:3, iunit)
959 mc_input_file%nunits_empty = nunits(1)
962 ALLOCATE (mc_input_file%mol_set_nmol_row(1:nmol_types))
963 ALLOCATE (mc_input_file%mol_set_nmol_column(1:nmol_types))
966 CALL open_file(file_name=input_file_name, &
967 unit_number=unit, file_action=
'READ', file_status=
'OLD')
971 READ (unit,
'(A)', iostat=io_stat) line
972 IF (io_stat /= 0)
EXIT
976 ALLOCATE (mc_input_file%text(1:nlines))
980 READ (unit,
'(A)') mc_input_file%text(iline)
988 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"&GLOBAL", .true., &
989 mc_input_file%global_row_end, idum, start_row_number=mc_input_file%global_row_start)
990 IF (mc_input_file%global_row_end == 0)
THEN
993 WRITE (iw, *)
'File name ', input_file_name
995 CALL cp_abort(__location__, &
996 'Could not find &END after &GLOBAL (make sure & is in the same column) and last line is blank')
1002 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"&MOTION", .true., &
1003 mc_input_file%motion_row_end, idum, start_row_number=mc_input_file%motion_row_start)
1004 IF (mc_input_file%motion_row_end == 0)
THEN
1007 WRITE (iw, *)
'File name ', input_file_name, mc_input_file%motion_row_start
1009 CALL cp_abort(__location__, &
1010 'Could not find &END after &MOTION (make sure & is in the same column) and last line is blank')
1014 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"&FORCE_EVAL", .true., &
1015 mc_input_file%force_eval_row_end, idum, start_row_number=mc_input_file%force_eval_row_start)
1018 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"&COORD", .true., &
1019 mc_input_file%coord_row_end, idum)
1020 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"&COORD", .false., &
1021 mc_input_file%coord_row_start, idum)
1023 IF (mc_input_file%coord_row_end == 0)
THEN
1026 WRITE (iw, *)
'File name ', input_file_name
1028 CALL cp_abort(__location__, &
1029 'Could not find &END after &COORD (make sure & is the first in the same column after &COORD)')
1033 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"RUN_TYPE", .false., &
1034 mc_input_file%run_type_row, mc_input_file%run_type_column)
1035 mc_input_file%run_type_column = mc_input_file%run_type_column + 9
1036 IF (mc_input_file%run_type_row == 0)
THEN
1039 WRITE (iw, *)
'File name ', input_file_name
1041 CALL cp_abort(__location__, &
1042 'Could not find RUN_TYPE in the input file (should be in the &GLOBAL section).')
1047 CALL mc_parse_text(mc_input_file%text, 1, nlines,
"&CELL", .false., &
1048 mc_input_file%cell_row, mc_input_file%cell_column)
1050 CALL mc_parse_text(mc_input_file%text, mc_input_file%cell_row + 1, nlines, &
1051 "ABC", .false., abc_row, abc_column)
1054 CALL mc_parse_text(mc_input_file%text, mc_input_file%cell_row + 1, abc_row, &
1055 "&CELL", .false., cell_row, cell_column)
1056 IF (cell_row == 0)
THEN
1057 mc_input_file%cell_row = abc_row
1058 mc_input_file%cell_column = abc_column + 4
1060 CALL mc_parse_text(mc_input_file%text, abc_row + 1, nlines, &
1061 "ABC", .false., mc_input_file%cell_row, mc_input_file%cell_column)
1063 IF (mc_input_file%cell_row == 0)
THEN
1066 WRITE (iw, *)
'File name ', input_file_name
1068 CALL cp_abort(__location__, &
1069 'Could not find &CELL section in the input file. Or could not find the ABC line after it.')
1073 IF (.NOT. lhmc)
THEN
1077 CALL mc_parse_text(mc_input_file%text, nstart, nlines,
"&MOLECULE", &
1078 .false., row_number, idum)
1079 IF (row_number == 0)
EXIT
1080 nstart = row_number + 1
1082 CALL mc_parse_text(mc_input_file%text, nstart, nlines,
"NMOL", &
1083 .false., mc_input_file%mol_set_nmol_row(irep), &
1084 mc_input_file%mol_set_nmol_column(irep))
1085 mc_input_file%mol_set_nmol_column(irep) = mc_input_file%mol_set_nmol_column(irep) + 5
1088 IF (irep /= nmol_types)
THEN
1091 WRITE (iw, *)
'File name ', input_file_name
1092 WRITE (iw, *)
'Number of molecule types ', nmol_types
1093 WRITE (iw, *)
'&MOLECULE sections found ', irep
1097 'Did not find MOLECULE sections for every molecule in the simulation (make sure both input files have all types)')
1103 CALL mc_parse_text(mc_input_file%text, 1, nlines, &
1104 "METHOD", .false., line_number, idum)
1105 READ (mc_input_file%text(line_number), *) cdum, method_name
1107 SELECT CASE (trim(adjustl(method_name)))
1110 CASE (
"QS",
"QUICKSTEP")
1113 cpabort(
'Cannot determine the type of force_env we are using (check METHOD)')
1127 DEALLOCATE (mc_input_file%mol_set_nmol_row)
1128 DEALLOCATE (mc_input_file%mol_set_nmol_column)
1129 DEALLOCATE (mc_input_file%text)
1130 DEALLOCATE (mc_input_file%atom_names_empty)
1131 DEALLOCATE (mc_input_file%coordinates_empty)
1150 SUBROUTINE mc_parse_text(text, nstart, nend, string_search, lend, &
1151 row_number, column_number, start_row_number)
1153 CHARACTER(LEN=*),
DIMENSION(:),
INTENT(IN) :: text
1154 INTEGER,
INTENT(IN) :: nstart, nend
1155 CHARACTER(LEN=*),
INTENT(IN) :: string_search
1156 LOGICAL,
INTENT(IN) :: lend
1157 INTEGER,
INTENT(OUT) :: row_number, column_number
1158 INTEGER,
INTENT(OUT),
OPTIONAL :: start_row_number
1160 CHARACTER(default_string_length) :: text_temp
1161 INTEGER :: iline, index_string, jline, string_size
1169 string_size = len_trim(string_search)
1170 whole_file:
DO iline = nstart, nend
1173 index_string = index(text(iline), string_search(1:string_size))
1175 IF (index_string > 0)
THEN
1176 IF (.NOT. lend)
THEN
1178 column_number = index_string
1180 IF (
PRESENT(start_row_number)) start_row_number = iline
1181 column_number = index_string
1182 DO jline = iline + 1, nend
1185 text_temp = text(jline)
1186 IF (text_temp(column_number:column_number) ==
"&")
THEN
1196 END SUBROUTINE mc_parse_text
1208 SUBROUTINE read_mc_section(mc_par, para_env, globenv, input_file_name, input_file, force_env_section)
1213 CHARACTER(LEN=*),
INTENT(IN) :: input_file_name
1216 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mc_section'
1218 CHARACTER(LEN=5) :: box_string, molecule_string, &
1219 tab_box_string, tab_string, &
1221 CHARACTER(LEN=default_string_length) :: format_box_string, format_string, &
1223 INTEGER :: handle, ia, ie, imol, itype, iw, &
1224 method_name_id, nmol_types, stop_num
1225 INTEGER,
DIMENSION(:),
POINTER :: temp_i_array
1226 REAL(
dp),
DIMENSION(:),
POINTER :: temp_r_array
1231 cpassert(
ASSOCIATED(input_file))
1233 CALL timeset(routinen, handle)
1235 NULLIFY (mc_section)
1241 mc_par%input_file => input_file
1244 mc_par%ionode = para_env%is_source()
1245 mc_par%group = para_env
1246 mc_par%source = para_env%source
1249 nmol_types = mc_par%mc_molecule_info%nmol_types
1254 SELECT CASE (method_name_id)
1262 IF (iw > 0)
WRITE (iw, *)
1265 mc_par%program = input_file_name
1266 CALL xstring(mc_par%program, ia, ie)
1267 mc_par%coords_file = mc_par%program(ia:ie)//
'.coordinates'
1268 mc_par%molecules_file = mc_par%program(ia:ie)//
'.molecules'
1269 mc_par%moves_file = mc_par%program(ia:ie)//
'.moves'
1270 mc_par%energy_file = mc_par%program(ia:ie)//
'.energy'
1271 mc_par%cell_file = mc_par%program(ia:ie)//
'.cell'
1272 mc_par%displacement_file = mc_par%program(ia:ie) &
1273 //
'.max_displacements'
1274 mc_par%data_file = mc_par%program(ia:ie)//
'.data'
1276 mc_par%dat_file = mc_par%program(ia:stop_num)//
'dat'
1280 c_val=mc_par%coords_file)
1282 c_val=mc_par%data_file)
1284 c_val=mc_par%cell_file)
1286 c_val=mc_par%displacement_file)
1288 c_val=mc_par%moves_file)
1290 c_val=mc_par%molecules_file)
1292 c_val=mc_par%energy_file)
1296 mc_par%fft_lib = globenv%default_fft_library
1316 i_val=mc_par%iupvolume)
1319 i_val=mc_par%iuptrans)
1321 i_val=mc_par%iupcltrans)
1326 IF (mc_par%pmhmc - mc_par%pmswap >= 1.0_dp .AND. mc_par%pmhmc == 1.0_dp)
THEN
1327 mc_par%lhmc = .true.
1329 mc_par%lhmc = .false.
1332 IF (.NOT. mc_par%lhmc)
THEN
1333 IF (
SIZE(temp_i_array) /= nmol_types)
THEN
1334 cpabort(
'AVBMC_ATOM must have as many values as there are molecule types.')
1337 DO imol = 1,
SIZE(temp_i_array)
1338 mc_par%avbmc_atom(imol) = temp_i_array(imol)
1346 r_val=mc_par%pmclus_box)
1348 r_val=mc_par%pmhmc_box)
1350 r_val=mc_par%pmvol_box)
1353 r_val=mc_par%rmvolume)
1355 r_val=mc_par%rmcltrans)
1371 IF (mc_par%ensemble ==
"VIRIAL")
THEN
1374 ALLOCATE (mc_par%virial_temps(1:
SIZE(temp_r_array)))
1375 DO imol = 1,
SIZE(temp_r_array)
1376 mc_par%virial_temps(imol) = temp_r_array(imol)
1381 IF (.NOT. mc_par%lhmc)
THEN
1382 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1383 cpabort(
'AVBMC_RMIN must have as many values as there are molecule types.')
1386 DO imol = 1,
SIZE(temp_r_array)
1387 mc_par%avbmc_rmin(imol) = temp_r_array(imol)
1390 IF (.NOT. mc_par%lhmc)
THEN
1391 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1392 cpabort(
'AVBMC_RMAXL must have as many values as there are molecule types.')
1395 DO imol = 1,
SIZE(temp_r_array)
1396 mc_par%avbmc_rmax(imol) = temp_r_array(imol)
1399 IF (.NOT. mc_par%lhmc)
THEN
1400 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1401 cpabort(
'PBIAS must have as many values as there are molecule types.')
1404 DO imol = 1,
SIZE(temp_r_array)
1405 mc_par%pbias(imol) = temp_r_array(imol)
1408 r_vals=temp_r_array)
1409 IF (.NOT. mc_par%lhmc)
THEN
1410 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1411 cpabort(
'PMAVBMC_MOL must have as many values as there are molecule types.')
1414 DO imol = 1,
SIZE(temp_r_array)
1415 mc_par%pmavbmc_mol(imol) = temp_r_array(imol)
1418 IF (.NOT. mc_par%lhmc)
THEN
1419 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1420 cpabort(
'ETA must have as many values as there are molecule types.')
1423 DO imol = 1,
SIZE(temp_r_array)
1424 mc_par%eta(imol) = temp_r_array(imol)
1427 r_vals=temp_r_array)
1428 IF (.NOT. mc_par%lhmc)
THEN
1429 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1430 cpabort(
'RMBOND must have as many values as there are molecule types.')
1433 DO imol = 1,
SIZE(temp_r_array)
1434 mc_par%rmbond(imol) = temp_r_array(imol)
1437 r_vals=temp_r_array)
1438 IF (.NOT. mc_par%lhmc)
THEN
1439 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1440 cpabort(
'RMANGLE must have as many values as there are molecule types.')
1443 DO imol = 1,
SIZE(temp_r_array)
1444 mc_par%rmangle(imol) = temp_r_array(imol)
1447 r_vals=temp_r_array)
1448 IF (.NOT. mc_par%lhmc)
THEN
1449 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1450 cpabort(
'RMDIHEDRAL must have as many values as there are molecule types.')
1453 DO imol = 1,
SIZE(temp_r_array)
1454 mc_par%rmdihedral(imol) = temp_r_array(imol)
1457 r_vals=temp_r_array)
1458 IF (.NOT. mc_par%lhmc)
THEN
1459 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1460 cpabort(
'RMROT must have as many values as there are molecule types.')
1463 DO imol = 1,
SIZE(temp_r_array)
1464 mc_par%rmrot(imol) = temp_r_array(imol)
1467 r_vals=temp_r_array)
1468 IF (.NOT. mc_par%lhmc)
THEN
1469 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1470 cpabort(
'RMTRANS must have as many values as there are molecule types.')
1473 DO imol = 1,
SIZE(temp_r_array)
1474 mc_par%rmtrans(imol) = temp_r_array(imol)
1478 r_vals=temp_r_array)
1479 IF (.NOT. mc_par%lhmc)
THEN
1480 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1481 cpabort(
'PMTRAION_MOL must have as many values as there are molecule types.')
1484 DO imol = 1,
SIZE(temp_r_array)
1485 mc_par%pmtraion_mol(imol) = temp_r_array(imol)
1489 r_vals=temp_r_array)
1490 IF (.NOT. mc_par%lhmc)
THEN
1491 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1492 cpabort(
'PMTRANS_MOL must have as many values as there are molecule types.')
1495 DO imol = 1,
SIZE(temp_r_array)
1496 mc_par%pmtrans_mol(imol) = temp_r_array(imol)
1500 r_vals=temp_r_array)
1501 IF (.NOT. mc_par%lhmc)
THEN
1502 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1503 cpabort(
'PMROT_MOL must have as many values as there are molecule types.')
1506 DO imol = 1,
SIZE(temp_r_array)
1507 mc_par%pmrot_mol(imol) = temp_r_array(imol)
1511 r_vals=temp_r_array)
1512 IF (.NOT. mc_par%lhmc)
THEN
1513 IF (
SIZE(temp_r_array) /= nmol_types)
THEN
1514 cpabort(
'PMSWAP_MOL must have as many values as there are molecule types.')
1517 DO imol = 1,
SIZE(temp_r_array)
1518 mc_par%pmswap_mol(imol) = temp_r_array(imol)
1532 WRITE (box_string,
'(I2)') mc_par%mc_molecule_info%nboxes
1533 WRITE (molecule_string,
'(I2)') mc_par%mc_molecule_info%nmol_types
1534 WRITE (tab_string,
'(I4)') 81 - 10*mc_par%mc_molecule_info%nmol_types
1535 WRITE (tab_box_string,
'(I4)') 81 - 10*mc_par%mc_molecule_info%nboxes
1536 WRITE (tab_string_int,
'(I4)') 81 - 5*mc_par%mc_molecule_info%nmol_types
1537 format_string =
"(A,T"//trim(adjustl(tab_string))//
","//trim(adjustl(molecule_string))//
"(2X,F8.4))"
1538 format_box_string =
"(A,T"//trim(adjustl(tab_box_string))//
","//trim(adjustl(box_string))//
"(2X,F8.4))"
1539 format_string_int =
"(A,T"//trim(adjustl(tab_string))//
","//trim(adjustl(molecule_string))//
"(I3,2X))"
1540 WRITE (iw,
'( A )')
' MC| Monte Carlo Protocol '
1541 WRITE (iw,
'( A,T71,I10 )')
' MC| total number of steps ', &
1543 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmvolume ', &
1545 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmvol_box ', &
1547 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmclus_box ', &
1549 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmhmc ', &
1551 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmhmc_box ', &
1553 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmswap ', &
1555 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmavbmc ', &
1557 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmtraion ', &
1559 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmtrans ', &
1561 WRITE (iw,
'( A,T71,F10.3 )')
' MC| pmcltrans ', &
1563 WRITE (iw,
'( A,T71,I10 )')
' MC| iupvolume ', &
1565 WRITE (iw,
'( A,T71,I10 )')
' MC| nvirial ', &
1567 WRITE (iw,
'( A,T71,I10 )')
' MC| iuptrans ', &
1569 WRITE (iw,
'( A,T71,I10 )')
' MC| iupcltrans ', &
1571 WRITE (iw,
'( A,T71,I10 )')
' MC| iprint ', &
1573 WRITE (iw,
'( A,T61,A20 )')
' MC| ensemble ', &
1574 adjustr(mc_par%ensemble)
1577 IF (.NOT. mc_par%lhmc)
THEN
1578 WRITE (iw, format_string)
' MC| pmswap_mol ', &
1580 WRITE (iw, format_string)
' MC| pmavbmc_mol ', &
1582 WRITE (iw, format_string)
' MC| pbias ', &
1584 WRITE (iw, format_string)
' MC| pmtraion_mol ', &
1586 WRITE (iw, format_string)
' MC| pmtrans_mol ', &
1588 WRITE (iw, format_string)
' MC| pmrot_mol ', &
1590 WRITE (iw, format_string)
' MC| eta [K]', &
1592 WRITE (iw, format_string)
' MC| rmbond [angstroms]', &
1594 WRITE (iw, format_string)
' MC| rmangle [degrees]', &
1596 WRITE (iw, format_string)
' MC| rmdihedral [degrees]', &
1598 WRITE (iw, format_string)
' MC| rmtrans [angstroms]', &
1600 WRITE (iw, format_string)
' MC| rmcltrans [angstroms]', &
1602 WRITE (iw, format_string)
' MC| rmrot [degrees]', &
1604 WRITE (iw, format_string_int)
' MC| AVBMC target atom ', &
1606 WRITE (iw, format_string)
' MC| AVBMC inner cutoff [ang]', &
1608 WRITE (iw, format_string)
' MC| AVBMC outer cutoff [ang]', &
1611 IF (mc_par%ensemble ==
'GEMC-NVT')
THEN
1612 WRITE (iw,
'( A,T58,A)')
' MC| Box 2 file', &
1613 trim(mc_par%box2_file)
1615 WRITE (iw,
'( A,T58,A )')
' MC| Name of restart file:', &
1616 trim(mc_par%restart_file_name)
1617 WRITE (iw,
'( A,A,T44,A )')
' MC| Name of output ', &
1618 'coordinate file:', &
1619 trim(mc_par%coords_file)
1620 WRITE (iw,
'( A,T44,A )')
' MC| Name of output data file:', &
1621 trim(mc_par%data_file)
1622 WRITE (iw,
'( A,A,T44,A )')
' MC| Name of output ', &
1623 'molecules file:', &
1624 trim(mc_par%molecules_file)
1625 WRITE (iw,
'( A,T44,A )')
' MC| Name of output moves file:', &
1626 trim(mc_par%moves_file)
1627 WRITE (iw,
'( A,T44,A )')
' MC| Name of output energy file:', &
1628 trim(mc_par%energy_file)
1629 WRITE (iw,
'( A,T44,A )')
' MC| Name of output cell file:', &
1630 trim(mc_par%cell_file)
1631 WRITE (iw,
'( A,A,T44,A )')
' MC| Name of output', &
1632 ' displacement file:', &
1633 trim(mc_par%displacement_file)
1634 IF (mc_par%ldiscrete)
THEN
1635 WRITE (iw,
'(A,A,T71,F10.3)')
' MC| discrete step size', &
1637 mc_par%discrete_step
1639 WRITE (iw,
'( A,A,T71,F10.3 )')
' MC| rmvolume ', &
1640 '[cubic angstroms]', &
1643 WRITE (iw,
'( A,T71,F10.2 )')
' MC| Temperature [K] ', &
1645 WRITE (iw,
'( A,T71,F10.5 )')
' MC| Pressure [bar] ', &
1647 WRITE (iw,
'( A,T71,F10.5 )')
' MC| Rclus [ang] ', &
1649 IF (mc_par%lrestart)
THEN
1650 WRITE (iw,
'(A,A)')
' MC| Initial data will be read from a', &
1653 IF (mc_par%lbias)
THEN
1654 WRITE (iw,
'(A)')
' MC| The moves will be biased.'
1656 WRITE (iw,
'(A)')
' MC| The moves will not be biased,'
1658 IF (mc_par%nmoves == 1)
THEN
1659 WRITE (iw,
'(A,A)')
' MC| A full energy calculation ', &
1660 'will be done at every step.'
1662 WRITE (iw,
'(A,I4,A,A)')
' MC| ', mc_par%nmoves, &
1663 ' moves will be attempted ', &
1664 'before a Quickstep energy calculation'
1665 WRITE (iw,
'(A)')
' MC| takes place.'
1668 WRITE (iw,
'(A,I4,A,A)')
' MC| ', mc_par%nswapmoves, &
1669 ' swap insertions will be attempted ', &
1670 'per molecular swap move'
1672 IF (mc_par%lhmc)
THEN
1673 WRITE (iw,
'(A)')
'********************************************************'
1674 WRITE (iw,
'(A)')
'************** ONLY DOING HYBRID MONTE CARLO MOVES **************************'
1675 WRITE (iw,
'(A)')
'********************************************************'
1684 mc_par%exp_max_val = 0.9_dp*log(huge(0.0_dp))
1685 mc_par%exp_min_val = 0.9_dp*log(tiny(0.0_dp))
1686 mc_par%max_val = exp(mc_par%exp_max_val)
1687 mc_par%min_val = 0.0_dp
1693 DO itype = 1, mc_par%mc_molecule_info%nmol_types
1697 mc_par%rmrot(itype) = mc_par%rmrot(itype)/180.0e0_dp*
pi
1698 mc_par%rmangle(itype) = mc_par%rmangle(itype)/180.0e0_dp*
pi
1699 mc_par%rmdihedral(itype) = mc_par%rmdihedral(itype)/180.0e0_dp*
pi
1700 mc_par%rmtrans(itype) =
cp_unit_to_cp2k(mc_par%rmtrans(itype),
"angstrom")
1701 mc_par%rmbond(itype) =
cp_unit_to_cp2k(mc_par%rmbond(itype),
"angstrom")
1703 mc_par%avbmc_rmin(itype) =
cp_unit_to_cp2k(mc_par%avbmc_rmin(itype),
"angstrom")
1704 mc_par%avbmc_rmax(itype) =
cp_unit_to_cp2k(mc_par%avbmc_rmax(itype),
"angstrom")
1708 mc_par%discrete_step =
cp_unit_to_cp2k(mc_par%discrete_step,
"angstrom")
1711 CALL timestop(handle)
1731 LOGICAL,
INTENT(OUT) :: lterminate
1733 INTEGER :: itype, jtype
1734 REAL(kind=
dp) :: rcutsq_max
1735 REAL(kind=
dp),
DIMENSION(1:3) :: abc
1741 NULLIFY (cell, potparm, fist_nonbond_env, fist_env)
1743 lterminate = .false.
1746 fist_nonbond_env=fist_nonbond_env)
1751 rcutsq_max = 0.0e0_dp
1752 DO itype = 1,
SIZE(potparm%pot, 1)
1753 DO jtype = itype,
SIZE(potparm%pot, 2)
1754 IF (potparm%pot(itype, jtype)%pot%rcutsq > rcutsq_max)
THEN
1755 rcutsq_max = potparm%pot(itype, jtype)%pot%rcutsq
1762 mc_par%rcut = rcutsq_max**0.5_dp
1764 IF (abc(itype) < 2.0_dp*mc_par%rcut)
THEN
1791 INTEGER,
INTENT(IN),
OPTIONAL :: box_number
1792 REAL(
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: coordinates_empty
1794 CHARACTER(LEN=default_string_length) :: name
1795 CHARACTER(LEN=default_string_length), &
1796 ALLOCATABLE,
DIMENSION(:) :: names_init
1797 INTEGER :: first_mol, iatom, ibox, imol, imolecule, itype, iunique, iunit, jtype, last_mol, &
1798 natom, natoms_large, nbend, nbond, nboxes, nmol_types, nmolecule, ntorsion, ntypes, &
1799 skip_box, this_molecule, total
1800 INTEGER,
DIMENSION(:),
POINTER :: molecule_list
1801 LOGICAL :: lnew_type
1802 TYPE(
atom_type),
DIMENSION(:),
POINTER :: atom_list
1806 POINTER :: molecule_kinds
1812 nboxes =
SIZE(force_env(:))
1815 ALLOCATE (mc_molecule_info)
1816 mc_molecule_info%nboxes = nboxes
1820 IF (
PRESENT(box_number))
THEN
1821 skip_box = box_number
1831 NULLIFY (subsys, molecule_kinds, molecule_kind)
1833 ALLOCATE (particles(1:nboxes))
1834 ALLOCATE (molecule_kinds(1:nboxes))
1839 IF (ibox == skip_box) cycle
1843 molecule_kinds=molecule_kinds(ibox)%list, &
1844 particles=particles(ibox)%list)
1845 ntypes = ntypes +
SIZE(molecule_kinds(ibox)%list%els(:))
1848 ALLOCATE (names_init(1:ntypes))
1855 IF (ibox == skip_box) cycle
1856 DO imolecule = 1,
SIZE(molecule_kinds(ibox)%list%els(:))
1857 molecule_kind => molecule_kinds(ibox)%list%els(imolecule)
1860 IF (natom > natoms_large) natoms_large = natom
1866 DO itype = 1, ntypes
1868 DO jtype = 1, itype - 1
1869 IF (trim(names_init(itype)) == trim(names_init(jtype)))
THEN
1874 nmol_types = nmol_types + 1
1876 names_init(itype) =
''
1882 mc_molecule_info%nmol_types = nmol_types
1883 ALLOCATE (mc_molecule_info%names(1:nmol_types))
1884 ALLOCATE (mc_molecule_info%nunits(1:nmol_types))
1885 ALLOCATE (mc_molecule_info%conf_prob(1:3, 1:nmol_types))
1886 ALLOCATE (mc_molecule_info%nchains(1:nmol_types, 1:nboxes))
1887 ALLOCATE (mc_molecule_info%nunits_tot(1:nboxes))
1888 ALLOCATE (mc_molecule_info%atom_names(1:natoms_large, 1:nmol_types))
1889 ALLOCATE (mc_molecule_info%mass(1:natoms_large, 1:nmol_types))
1895 IF (ibox == skip_box) cycle
1896 DO imolecule = 1,
SIZE(molecule_kinds(ibox)%list%els(:))
1898 IF (names_init(itype) ==
'') cycle
1899 iunique = iunique + 1
1900 mc_molecule_info%names(iunique) = names_init(itype)
1901 molecule_kind => molecule_kinds(ibox)%list%els(imolecule)
1903 nbond=nbond, nbend=nbend, ntorsion=ntorsion, atom_list=atom_list)
1905 DO iatom = 1, mc_molecule_info%nunits(iunique)
1906 atomic_kind => atom_list(iatom)%atomic_kind
1908 name=mc_molecule_info%atom_names(iatom, iunique), &
1909 mass=mc_molecule_info%mass(iatom, iunique))
1913 total = nbond + nbend + ntorsion
1915 IF (total == 0)
THEN
1916 mc_molecule_info%conf_prob(:, iunique) = 0.0e0_dp
1918 mc_molecule_info%conf_prob(1, iunique) = real(nbond,
dp)/real(total,
dp)
1919 mc_molecule_info%conf_prob(2, iunique) = real(nbend,
dp)/real(total,
dp)
1920 mc_molecule_info%conf_prob(3, iunique) = real(ntorsion,
dp)/real(total,
dp)
1927 IF (
PRESENT(coordinates_empty))
THEN
1928 ALLOCATE (coordinates_empty(1:3, 1:mc_molecule_info%nunits(1)))
1929 DO iunit = 1, mc_molecule_info%nunits(1)
1930 coordinates_empty(1:3, iunit) = particles(1)%list%els(iunit)%r(1:3)
1936 mc_molecule_info%nchains(:, :) = 0
1937 DO iunique = 1, nmol_types
1939 IF (ibox == skip_box) cycle
1940 DO imolecule = 1,
SIZE(molecule_kinds(ibox)%list%els(:))
1941 molecule_kind => molecule_kinds(ibox)%list%els(imolecule)
1944 IF (trim(name) /= mc_molecule_info%names(iunique)) cycle
1945 mc_molecule_info%nchains(iunique, ibox) = mc_molecule_info%nchains(iunique, ibox) + nmolecule
1949 mc_molecule_info%nchain_total = 0
1951 mc_molecule_info%nunits_tot(ibox) = 0
1952 IF (ibox == skip_box) cycle
1953 DO iunique = 1, nmol_types
1954 mc_molecule_info%nunits_tot(ibox) = mc_molecule_info%nunits_tot(ibox) + &
1955 mc_molecule_info%nunits(iunique)*mc_molecule_info%nchains(iunique, ibox)
1957 mc_molecule_info%nchain_total = mc_molecule_info%nchain_total + sum(mc_molecule_info%nchains(:, ibox))
1962 ALLOCATE (mc_molecule_info%mol_type(1:mc_molecule_info%nchain_total))
1963 ALLOCATE (mc_molecule_info%in_box(1:mc_molecule_info%nchain_total))
1967 IF (ibox == skip_box) cycle
1968 first_mol = last_mol + 1
1969 last_mol = first_mol + sum(mc_molecule_info%nchains(:, ibox)) - 1
1970 mc_molecule_info%in_box(first_mol:last_mol) = ibox
1971 DO imolecule = 1,
SIZE(molecule_kinds(ibox)%list%els(:))
1972 molecule_kind => molecule_kinds(ibox)%list%els(imolecule)
1974 name=name, molecule_list=molecule_list)
1977 DO iunique = 1, nmol_types
1978 IF (trim(name) == trim(mc_molecule_info%names(iunique)))
THEN
1979 this_molecule = iunique
1982 DO imol = 1,
SIZE(molecule_list(:))
1983 mc_molecule_info%mol_type(first_mol + molecule_list(imol) - 1) = this_molecule
1989 DEALLOCATE (names_init)
1990 DEALLOCATE (molecule_kinds)
1991 DEALLOCATE (particles)
2006 DEALLOCATE (mc_molecule_info%nchains)
2007 DEALLOCATE (mc_molecule_info%nunits)
2008 DEALLOCATE (mc_molecule_info%mol_type)
2009 DEALLOCATE (mc_molecule_info%in_box)
2010 DEALLOCATE (mc_molecule_info%names)
2011 DEALLOCATE (mc_molecule_info%atom_names)
2012 DEALLOCATE (mc_molecule_info%conf_prob)
2013 DEALLOCATE (mc_molecule_info%nunits_tot)
2014 DEALLOCATE (mc_molecule_info%mass)
2016 DEALLOCATE (mc_molecule_info)
2017 NULLIFY (mc_molecule_info)
2036 INTEGER :: imol_type, nboxes, nchain_total, &
2038 INTEGER,
DIMENSION(:),
POINTER :: nunits
2042 CALL get_mc_par(mc_par, mc_molecule_info=mc_molecule_info, lhmc=lhmc)
2045 nboxes=nboxes, nunits=nunits, nchain_total=nchain_total)
2052 IF (mc_par%pmavbmc_mol(nmol_types) < 0.9999e0_dp)
THEN
2053 cpabort(
'The last value of PMAVBMC_MOL needs to be 1.0')
2055 IF (mc_par%pmswap_mol(nmol_types) < 0.9999e0_dp)
THEN
2056 cpabort(
'The last value of PMSWAP_MOL needs to be 1.0')
2058 IF (mc_par%pmtraion_mol(nmol_types) < 0.9999e0_dp)
THEN
2059 cpabort(
'The last value of PMTRAION_MOL needs to be 1.0')
2061 IF (mc_par%pmtrans_mol(nmol_types) < 0.9999e0_dp)
THEN
2062 cpabort(
'The last value of PMTRANS_MOL needs to be 1.0')
2064 IF (mc_par%pmrot_mol(nmol_types) < 0.9999e0_dp)
THEN
2065 cpabort(
'The last value of PMROT_MOL needs to be 1.0')
2071 SELECT CASE (mc_par%ensemble)
2073 IF (nmol_types <= 1)
THEN
2074 cpabort(
'Cannot have GEMC-NPT simulation with only one molecule type')
2076 IF (nboxes <= 1)
THEN
2077 cpabort(
'Cannot have GEMC-NPT simulation with only one box')
2080 IF (nboxes <= 1)
THEN
2081 cpabort(
'Cannot have GEMC-NVT simulation with only one box')
2083 CASE (
"TRADITIONAL")
2084 IF (mc_par%pmswap > 0.0e0_dp)
THEN
2085 cpabort(
'You cannot do swap moves in a system with only one box')
2088 IF (nchain_total /= 2)
THEN
2089 cpabort(
'You need exactly two molecules in the box to compute the second virial.')
2095 DO imol_type = 1, nmol_types
2096 IF (mc_par%avbmc_atom(imol_type) > nunits(imol_type))
THEN
2097 cpabort(
'Cannot have avbmc_atom higher than the number of atoms for that molecule 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.
Handles all functions related to the CELL.
subroutine, public get_cell(cell, alpha, beta, gamma, deth, orthorhombic, abc, periodic, h, h_inv, symmetry_id, tag)
Get informations about a simulation cell.
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
various routines to log and control the output. The idea is that decisions about where to log should ...
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...
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_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
subroutine, public fist_env_get(fist_env, atomic_kind_set, particle_set, ewald_pw, local_particles, local_molecules, molecule_kind_set, molecule_set, cell, cell_ref, ewald_env, fist_nonbond_env, thermo, para_env, subsys, qmmm, qmmm_env, input, shell_model, shell_model_ad, shell_particle_set, core_particle_set, multipoles, results, exclusions, efield)
Purpose: Get the FIST environment.
subroutine, public fist_nonbond_env_get(fist_nonbond_env, potparm14, potparm, nonbonded, rlist_cut, rlist_lowsq, aup, lup, ei_scale14, vdw_scale14, shift_cutoff, do_electrostatics, r_last_update, r_last_update_pbc, rshell_last_update_pbc, rcore_last_update_pbc, cell_last_update, num_update, last_update, counter, natom_types, long_range_correction, ij_kind_full_fac, eam_data, nequip_data, deepmd_data, ace_data, charges)
sets a fist_nonbond_env
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_qs_force
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
integer, parameter, public default_path_length
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
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)
...
subroutine, public read_mc_section(mc_par, para_env, globenv, input_file_name, input_file, force_env_section)
reads in the Monte Carlo simulation parameters from an input file
subroutine, public mc_determine_molecule_info(force_env, mc_molecule_info, box_number, coordinates_empty)
figures out the number of total molecules, the number of atoms in each molecule, an array with the mo...
subroutine, public mc_molecule_info_destroy(mc_molecule_info)
deallocates all the arrays in the mc_molecule_info_type
subroutine, public mc_sim_par_destroy(mc_par)
destroys (deallocates) the mc_simulation_parameters type
subroutine, public mc_input_parameters_check(mc_par)
...
subroutine, public get_mc_input_file(mc_input_file, run_type_row, run_type_column, coord_row_start, coord_row_end, cell_row, cell_column, force_eval_row_start, force_eval_row_end, global_row_start, global_row_end, mol_set_nmol_row, mol_set_nmol_column, in_use, text, atom_names_empty, nunits_empty, coordinates_empty, motion_row_end, motion_row_start)
accesses the private elements of the mc_input_file_type
subroutine, public mc_input_file_destroy(mc_input_file)
destroys (deallocates) things in the mc_input_file_type
subroutine, public find_mc_rcut(mc_par, force_env, lterminate)
finds the largest interaction cutoff value in a classical simulation so we know the smallest size we ...
subroutine, public mc_sim_par_create(mc_par, nmol_types)
creates (allocates) the mc_simulation_parameters type
subroutine, public mc_input_file_create(mc_input_file, input_file_name, mc_molecule_info, empty_coords, lhmc)
creates (allocates) the mc_input_file_type
subroutine, public set_mc_par(mc_par, rm, cl, diff, nstart, rmvolume, rmcltrans, rmbond, rmangle, rmdihedral, rmrot, rmtrans, program, nmoves, nswapmoves, lstop, temperature, pressure, rclus, iuptrans, iupcltrans, iupvolume, pmswap, pmvolume, pmtraion, pmtrans, pmcltrans, beta, rcut, iprint, lbias, nstep, lrestart, ldiscrete, discrete_step, pmavbmc, mc_molecule_info, pmavbmc_mol, pmtrans_mol, pmrot_mol, pmtraion_mol, pmswap_mol, avbmc_rmin, avbmc_rmax, avbmc_atom, pbias, ensemble, pmvol_box, pmclus_box, eta, mc_input_file, mc_bias_file, exp_max_val, exp_min_val, min_val, max_val, pmhmc, pmhmc_box, lhmc, ionode, source, group, rand2skip)
changes the private elements of the mc_parameters_type
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.
represent a simple array based list of the given type
Definition of physical constants:
real(kind=dp), parameter, public boltzmann
real(kind=dp), parameter, public joule
Utilities for string manipulations.
elemental subroutine, public xstring(string, ia, ib)
...
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represents a system: atoms, molecules, their pos,vel,...
allows for the creation of an array of force_env
wrapper to abstract the force evaluation of the various methods
contains the initially parsed file and the initial parallel environment
stores all the informations relevant to an mpi environment
represents a pointer to a list
represents a pointer to a list