30#include "../base/base_uses.f90"
35 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
36 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_tmc'
53 cpassert(.NOT.
ASSOCIATED(section))
55 section, __location__, name=
"TMC", &
56 description=
"A parallelized MC algorithm, presampling the configurations, espacially the Markov chain elements", &
58 n_keywords=1, n_subsections=1, repeats=.false.)
60 NULLIFY (keyword, subsection)
64 name=
"GROUP_ENERGY_SIZE", &
65 description=
"amount of CPUs per group for energy calculation", &
66 usage=
"GROUP_ENERGY_SIZE {INTEGER}", &
73 name=
"GROUP_ENERGY_NR", &
74 description=
"amount of groups for exact energy calculation", &
75 usage=
"GROUP_ENERGY_NR {INTEGER}", &
82 name=
"GROUP_CC_SIZE", &
83 description=
"amount of of CPUs per group for configurational change", &
84 usage=
"GROUP_CC_SIZE {INTEGER}", &
91 name=
"GROUP_ANALYSIS_NR", &
92 description=
"amount of groups (cores) for analysing the configurations", &
93 usage=
"GROUP_ANALYSIS_NR {INTEGER}", &
94 default_i_val=1, lone_keyword_i_val=1)
100 description=
"the minimum Markov Chain elements, to be sampled", &
101 usage=
"NUM_MC_ELEM {INTEGER}", &
108 name=
"RND_DETERMINISTIC", &
109 description=
"the initialisation number for the random number generator", &
110 usage=
"RND_DETERMINISTIC {INTEGER}", &
117 description=
"Select specialized types. Selectable: "// &
118 "IDEAL_GAS (constant configuration energy E=0.0)", &
119 usage=
"TASK_TYPE {OPTION}", &
125 name=
"NR_TEMPERATURE", &
126 description=
"the number of different temperature for parallel tempering", &
127 usage=
"NR_TEMPERATURE {INTEGER}", &
133 name=
"TEMPERATURE", &
134 description=
"one temperature OR for parallel tempering: "// &
135 "Tmin Tmax or each temperature T1 T2 T3 ..."// &
136 " If every single temperature is specified, "// &
137 "do NOT use keyword NR_TEMPERATURE", &
138 usage=
"TEMPERATURE {REAL} |OR| TEMPERATURE {REAL} {REAL} ...", &
139 default_r_vals=(/330.0_dp/), &
140 n_var=-1, type_of_var=
real_t)
145 name=
"NUM_MV_ELEM_IN_CELL", &
146 description=
"the number of elements (atoms or molecules) "// &
147 "moves in cell or sub box. "// &
148 "if 0 all elements are moved once in a MC move", &
149 usage=
"NUM_MV_ELEM_IN_CELL {INTEGER}", &
164 CALL create_tmc_move_type_section(subsection)
169 CALL create_tmc_nmc_move_type_section(subsection)
175 description=
"specifies the size ot the sub box. "// &
176 "Standard moves only within subbox of random position, "// &
177 "to compensate the potential difference of the approximate potential.", &
178 usage=
"SUB_BOX {REAL} {REAL} {REAL} OR SUB_BOX {REAL} for cubic", &
179 default_r_vals=(/-1.0_dp/), &
180 n_var=-1, type_of_var=
real_t)
186 description=
"enables NPT calculation with specified constant pressure [bar]", &
187 usage=
"PRESSURE {REAL}", &
188 default_r_val=-1.0_dp)
193 name=
"VOLUME_ISOTROPIC", &
194 description=
"volume move is equal in each direction", &
195 usage=
"VOLUME_ISOTROPIC {LOGICAL}", &
196 default_l_val=.true., lone_keyword_l_val=.true.)
201 name=
"MOVE_CENTER_OF_MASS", &
202 description=
"Moves the center of mass of defined molecules (in volume moves)", &
203 usage=
"MOVE_CENTER_OF_MASS {LOGICAL}", &
204 default_l_val=.false., lone_keyword_l_val=.true.)
209 name=
"ESIMATE_ACC_PROB", &
210 description=
"set the estimation of the acceptance probability using run time information of the energy", &
211 usage=
"ESIMATE_ACC_PROB {LOGICAL}", &
212 default_l_val=.true.)
217 name=
"SPECULATIVE_CANCELING", &
218 description=
"enables or disables the speculative canceling. If we have further knowledge of "// &
219 "acceptance probabilities using parent acceptance or the estimated energy.", &
220 usage=
"SPECULATIVE_CANCELING {LOGICAL}", &
221 default_l_val=.true.)
226 name=
"USE_SCF_ENERGY_INFO", &
227 description=
"enables or disables the usage of SCF energy information for "// &
228 "estimating the acceptance probability.", &
229 usage=
"USE_SCF_ENERGY_INFO {LOGICAL}", &
230 default_l_val=.false., lone_keyword_l_val=.true.)
235 name=
"RESULT_LIST_IN_MEMORY", &
236 description=
"enables the storing of the whole Markov Chain", &
237 usage=
"RESULT_LIST_IN_MEMORY {LOGICAL}", &
238 default_l_val=.false.)
243 name=
"INFO_OUT_STEP_SIZE", &
244 description=
"the number the amount of calculated configurations between to output printings.", &
245 usage=
"INFO_OUT_STEP_SIZE {INTEGER}", &
252 description=
"if existing use the last restart file", &
253 usage=
"RESTART_IN {FILENAME}", &
259 name=
"RESTART_OUT", &
260 description=
"Defines the frequency to write restart files. "// &
261 "If no frequency is specified (lone keyword) "// &
262 "the restart file is written at the end (only). "// &
263 "If the value is 0, no restart file is written at all. "// &
264 "The frequency specifies is related "// &
265 "to the calculated Markov chain elements", &
266 usage=
"RESTART_OUT {INTEGER}", &
267 default_i_val=-1, lone_keyword_i_val=-9)
271 CALL keyword_create(keyword, __location__, name=
"ENERGY_FILE_NAME", &
272 description=
"input file name for the exact potential energy calculation.", &
273 usage=
"ENERGY_FILE_NAME {filename}", &
286 name=
"PRINT_ONLY_ACC", &
287 description=
"printing only accepted elements of the Markov Chain.", &
288 usage=
"PRINT_ONLY_ACC {LOGICAL}", &
289 default_l_val=.true., lone_keyword_l_val=.true.)
294 name=
"PRINT_COORDS", &
295 description=
"printing coordinates of the Markov Chain elements", &
296 usage=
"PRINT_COORDS {LOGICAL}", &
297 default_l_val=.true., lone_keyword_l_val=.true.)
302 name=
"PRINT_FORCES", &
303 description=
"printing forces of the Markov Chain elements", &
304 usage=
"PRINT_FORCES {LOGICAL}", &
305 default_l_val=.false., lone_keyword_l_val=.true.)
310 name=
"PRINT_DIPOLE", &
311 description=
"enables the calculation and printing the exact cell dipoles"// &
312 " (only for QS methods)", &
313 usage=
"PRINT_DIPOLE {LOGICAL}", &
314 default_l_val=.false., lone_keyword_l_val=.true.)
320 description=
"printing the cell vectors of the Markov Chain elements", &
321 usage=
"PRINT_CELL {LOGICAL}", &
322 default_l_val=.false., lone_keyword_l_val=.true.)
327 name=
"PRINT_ENERGIES", &
328 description=
"printing the different calculated energies (approximated, scf and exact)", &
329 usage=
"PRINT_ENERGIES {LOGICAL}", &
330 default_l_val=.false., lone_keyword_l_val=.true.)
335 description=
"file name for GrapgViz dot file", &
336 usage=
"DOT_TREE {filename}", &
341 CALL keyword_create(keyword, __location__, name=
"ALL_CONF_FILE_NAME", &
342 description=
"file name for printing every single calculated configuration (e.g. for fitting).", &
343 usage=
"ALL_CONF_FILE_NAME {filename}", &
349 name=
"PRINT_TEST_OUTPUT", &
350 description=
"printing different values for regtest comparison", &
351 usage=
"PRINT_TEST_OUTPUT {LOGICAL}", &
352 default_l_val=.false., lone_keyword_l_val=.true.)
356 CALL create_tmc_ana_section(subsection)
360 CALL create_tmc_ana_files(subsection)
372 SUBROUTINE create_tmc_nmc_move_type_section(section)
380 cpassert(.NOT.
ASSOCIATED(section))
382 description=
"This section specifies the TMC move types, "// &
383 "which are performed within the nested Monte Carlo (NMC). "// &
384 "thus using the approximate potential.", &
385 n_keywords=1, n_subsections=0, repeats=.true.)
390 name=
"NR_NMC_STEPS", &
391 description=
"the number of Nested Mont Carlo moves with in one MC move "// &
392 "should be huge enough to reach euilibrium state", &
393 usage=
"NR_NMC_STEPS {INTEGER}", &
398 CALL keyword_create(keyword, __location__, name=
"NMC_FILE_NAME", &
399 description=
"input file name for the approximate potential for Nested Monte Carlo.", &
400 usage=
"NMC_FILE_NAME {filename}", &
406 description=
"Defines the probability of the NMC move "// &
407 "(considering the ration between the selected other moves) "// &
408 "the probabilities of the move types in the NMC section "// &
409 "defines only the weight within the NMC steps", &
410 usage=
"PROB {real}", type_of_var=
real_t, &
411 default_r_val=1.0_dp)
415 CALL keyword_create(keyword, __location__, name=
"INIT_ACC_PROB", &
416 description=
"Defines the initial probability of accepting the move. ", &
417 usage=
"INIT_ACC_PROB {real}", type_of_var=
real_t, &
418 default_r_val=0.5_dp, n_var=1)
423 CALL create_tmc_move_type_section(subsection)
426 END SUBROUTINE create_tmc_nmc_move_type_section
433 SUBROUTINE create_tmc_move_type_section(section)
438 cpassert(.NOT.
ASSOCIATED(section))
440 description=
"This section specifies the TMC move type, "// &
441 "and its properties. "// &
442 "Selectable types are: "// &
443 "ATOM_TRANS atom translation, "// &
444 "MOL_TRANS molecule translation, "// &
445 "MOL_ROT molecule rotation, "// &
446 "PROT_REORDER proton reordering, "// &
447 "PT_SWAP Parallel Tempering swap, "// &
448 "VOL_MOVE volume change, "// &
449 "ATOM_SWAP swaps two atoms of different type.", &
450 n_keywords=1, n_subsections=0, repeats=.true.)
454 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
455 description=
"The name of the move type described in this section.", &
456 usage=
"ATOM_TRANS", default_c_val=
"DEFAULT")
461 description=
"Defines the size of the move: "// &
462 "ATOM_TRANS [A], "// &
463 "MOL_TRANS [A], "// &
464 "MOL_ROT [degree], "// &
465 "PROT_REORDER [], "// &
468 usage=
"SIZE {real}", type_of_var=
real_t, &
469 default_r_val=-1.0_dp, n_var=1)
474 description=
"Defines the probability of the move "// &
475 "(considering the ration between the selected moves)", &
476 usage=
"PROB {real}", type_of_var=
real_t, &
477 default_r_val=1.0_dp, n_var=1)
481 CALL keyword_create(keyword, __location__, name=
"INIT_ACC_PROB", &
482 description=
"Defines the initial probability of accepting the move. ", &
483 usage=
"INIT_ACC_PROB {real}", type_of_var=
real_t, &
484 default_r_val=0.23_dp, n_var=1)
489 description=
"Defines the atomic kinds involved in the move. "// &
490 "Up to now only used for the atom swap.", &
491 usage=
"ATOMS {KIND1} {KIND2} ... ", type_of_var=
char_t, &
492 n_var=-1, repeats=.true.)
496 END SUBROUTINE create_tmc_move_type_section
503 SUBROUTINE create_tmc_ana_section(section)
506 cpassert(.NOT.
ASSOCIATED(section))
508 description=
"Analysing the Markov Chain elements with the specified methods", &
509 n_keywords=1, n_subsections=1, repeats=.false.)
511 CALL create_tmc_ana_kinds(section=section)
513 END SUBROUTINE create_tmc_ana_section
520 SUBROUTINE create_tmc_ana_files(section)
527 cpassert(.NOT.
ASSOCIATED(section))
528 CALL section_create(section, __location__, name=
"TMC_ANALYSIS_FILES", &
529 description=
"Analysing the Markov Chain elements with the specified methods, "// &
530 "reading form default or specified files", &
531 n_keywords=1, n_subsections=1, repeats=.false.)
533 CALL create_tmc_ana_kinds(section=section)
536 name=
"NR_TEMPERATURE", &
537 description=
"the number of different temperature for parallel tempering", &
538 usage=
"NR_TEMPERATURE {INTEGER}", &
544 name=
"TEMPERATURE", &
545 description=
"one temperature OR for parallel tempering: "// &
546 "Tmin Tmax or each temperature T1 T2 T3 ..."// &
547 " If every single temperature is specified, "// &
548 "do NOT use keyword NR_TEMPERATURE", &
549 usage=
"TEMPERATURE {REAL} |OR| TEMPERATURE {REAL} {REAL} ...", &
550 default_r_vals=(/330.0_dp/), &
551 n_var=-1, type_of_var=
real_t)
556 name=
"DIRECTORIES", &
557 description=
"Analysing multiple directories, "// &
558 "created by standard parallel MC (e.g. using TMC farming ", &
559 usage=
"DIRECTORIES {DIR1/} {DIR2/} ...", &
560 default_c_vals=(/
"./"/), &
561 n_var=-1, type_of_var=
char_t)
565 CALL keyword_create(keyword, __location__, name=
"FORCE_ENV_FILE", &
566 description=
"input file name for force env, "// &
567 "to get initial configuration with dimensions and cell", &
568 usage=
"FORCE_ENV_FILE {filename}", &
569 default_c_val=
"", lone_keyword_c_val=
"")
573 CALL keyword_create(keyword, __location__, name=
"POSITION_FILE", &
574 description=
"file name for analysing the position file", &
575 usage=
"POSITION_FILE {filename}", &
576 default_c_val=
"", lone_keyword_c_val=
"")
581 description=
"file name for analysing the cell file", &
582 usage=
"CELL_FILE {filename}", &
583 default_c_val=
"", lone_keyword_c_val=
"")
588 description=
"file name for analysing the dipole file", &
589 usage=
"DIPOLE_FILE {filename}", &
590 default_c_val=
"", lone_keyword_c_val=
"")
596 description=
"start analysis at element with number #", &
597 usage=
"START_ELEM {INTEGER}", &
604 description=
"end analysis at element with number #", &
605 usage=
"END_ELEM {INTEGER}", &
610 END SUBROUTINE create_tmc_ana_files
617 SUBROUTINE create_tmc_ana_kinds(section)
623 NULLIFY (subsection, keyword)
627 description=
"Enables/disables the reading and writing of analysis restart files", &
628 usage=
"RESTART {LOGICAL}", &
629 default_l_val=.true., lone_keyword_l_val=.true.)
633 CALL keyword_create(keyword, __location__, name=
"PREFIX_ANA_FILES", &
634 description=
"specifies a prefix for all analysis files.", &
635 usage=
"PREFIX_ANA_FILES {prefix}", &
642 description=
"Mass density in the simulation cell, or if specified in sub cubes", &
643 usage=
"DENSITY or DENSITY {INTEGER} {INTEGER} {INTEGER}", &
644 default_i_vals=(/1/), &
651 description=
"Radial Distribution Function for each pair of atoms "// &
652 "using the amount of specified bins within MAX(cell_length)/2", &
653 usage=
"G_R or G_R {INTEGER}", &
654 default_i_val=-1, lone_keyword_i_val=-1)
659 name=
"CLASSICAL_DIPOLE_MOMENTS", &
660 description=
"calculates the classical dipole Moment. "// &
661 "Following flag specifies if they should be written. "// &
662 "Class. Dip. Mom. are also used to unfold the exact dipole moment. ", &
663 usage=
"CLASSICAL_DIPOLE_MOMENTS or CLASSICAL_DIPOLE_MOMENTS {LOGICAL}", &
664 default_l_val=.true., lone_keyword_l_val=.true.)
674 name=
"DIPOLE_ANALYSIS", &
675 description=
"Enables analysis of dipole moments, espacially dielectric constant. "// &
676 "An additional type can be specified, e.g. analyzing ice structures. "// &
677 "using SYM_XYZ also dipoles (-x,y,z) .. .. (-x,-y,z).... (-x,-y-z) "// &
678 "are regarded, only use it if this configurations have "// &
679 "all the same energy.", &
680 usage=
"DIPOLE_ANALYSIS or DIPOLE_ANALYSIS {type}", &
687 description=
"Calculates the deviation of the position from the last configuration", &
688 usage=
"DEVIATION {LOGICAL}", &
689 default_l_val=.false., lone_keyword_l_val=.true.)
692 END SUBROUTINE create_tmc_ana_kinds
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public schonherr2014
Defines the basic variable types.
integer, parameter, public dp
tree nodes creation, searching, deallocation, references etc.
character(len= *), parameter, public tmc_default_unspecified_name
character(len= *), parameter, public tmc_default_dot_file_name