-
Notifications
You must be signed in to change notification settings - Fork 1
/
input_cp2k_colvar.F
2303 lines (1934 loc) · 121 KB
/
input_cp2k_colvar.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!--------------------------------------------------------------------------------------------------!
! CP2K: A general program to perform molecular dynamics simulations !
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
! !
! SPDX-License-Identifier: GPL-2.0-or-later !
!--------------------------------------------------------------------------------------------------!
! **************************************************************************************************
!> \par History
!> - taken out of input_cp2k_motion
!> \author teo & fawzi
! **************************************************************************************************
MODULE input_cp2k_colvar
USE bibliography, ONLY: Branduardi2007
USE colvar_types, ONLY: &
do_clv_fix_point, do_clv_geo_center, do_clv_x, do_clv_xy, do_clv_xyz, do_clv_xz, do_clv_y, &
do_clv_yz, do_clv_z, plane_def_atoms, plane_def_vec
USE cp_output_handling, ONLY: add_last_numeric,&
cp_print_key_section_create,&
high_print_level,&
low_print_level
USE cp_units, ONLY: cp_unit_to_cp2k
USE input_constants, ONLY: gaussian,&
numerical,&
rmsd_all,&
rmsd_list,&
rmsd_weightlist
USE input_keyword_types, ONLY: keyword_create,&
keyword_release,&
keyword_type
USE input_section_types, ONLY: section_add_keyword,&
section_add_subsection,&
section_create,&
section_release,&
section_type
USE input_val_types, ONLY: char_t,&
integer_t,&
lchar_t,&
real_t
USE kinds, ONLY: dp
USE string_utilities, ONLY: s2a
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .FALSE.
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_colvar'
PUBLIC :: create_colvar_section, &
create_colvar_xyz_d_section, &
create_colvar_xyz_od_section
CONTAINS
! **************************************************************************************************
!> \brief creates the colvar section
!> \param section the section to be created
!> \param skip_recursive_colvar ...
!> \author teo
! **************************************************************************************************
RECURSIVE SUBROUTINE create_colvar_section(section, skip_recursive_colvar)
TYPE(section_type), POINTER :: section
LOGICAL, OPTIONAL :: skip_recursive_colvar
LOGICAL :: skip
TYPE(section_type), POINTER :: print_key, subsection
skip = .FALSE.
IF (PRESENT(skip_recursive_colvar)) skip = skip_recursive_colvar
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="COLVAR", &
description="This section specifies the nature of the collective variables.", &
n_keywords=1, n_subsections=1, repeats=.TRUE.)
NULLIFY (subsection, print_key)
CALL create_colvar_var_section(subsection=subsection, &
section=section, skip_recursive_colvar=skip)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="Controls the printing of the colvar specifications", &
n_keywords=0, n_subsections=1, repeats=.TRUE.)
NULLIFY (print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
description="Controls the printing of basic information during colvar setup.", &
print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_clv_info_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_section
! **************************************************************************************************
!> \brief Create the restart section for colvar restraints
!> This section will be only used for restraint restarts.
!> Constraints are handled automatically
!> \param section the section to create
!> \author Teodoro Laino 08.2006
! **************************************************************************************************
SUBROUTINE create_clv_info_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
NULLIFY (keyword)
CALL section_create(section, __LOCATION__, name="COLVAR_FUNC_INFO", &
description="Specify further data possibly used by colvars, depending "// &
"on the starting geometry, for computing the functions value.", &
n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
description="Colvar function data."// &
" The order is an internal order. So if you decide to edit/modify/add these values by hand"// &
" you should know very well what you are doing.!", repeats=.TRUE., &
usage="{Real} ...", type_of_var=real_t, n_var=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_clv_info_section
! **************************************************************************************************
!> \brief creates the collective variables for the colvar section
!> \param subsection ...
!> \param section the section to be created
!> \param skip_recursive_colvar ...
!> \author teo
! **************************************************************************************************
RECURSIVE SUBROUTINE create_colvar_var_section(subsection, section, skip_recursive_colvar)
TYPE(section_type), POINTER :: subsection, section
LOGICAL, INTENT(IN) :: skip_recursive_colvar
CPASSERT(.NOT. ASSOCIATED(subsection))
CPASSERT(ASSOCIATED(section))
CALL create_colvar_dist_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_angle_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_torsion_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_coord_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_pop_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_gyr_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_d_pl_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_a_pl_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_rot_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_dfunct_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_qparm_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_hydronium_shell_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_hydronium_dist_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_acid_hyd_dist_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_acid_hyd_shell_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_rmsd_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_xyz_d_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_xyz_od_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_u_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_wc_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_hbp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_ring_puckering_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_cond_dist_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
IF (.NOT. skip_recursive_colvar) THEN
CALL create_colvar_rpath_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_dpath_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_colvar_comb_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END IF
END SUBROUTINE create_colvar_var_section
! **************************************************************************************************
!> \brief collective variables specifying coordination
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_coord_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="coordination", &
description="Section to define the coordination number as a collective variable.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
variants=(/"POINTS_FROM"/), &
description="Specify indexes of atoms/points building the coordination variable. ", &
usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
variants=(/"POINTS_TO"/), &
description="Specify indexes of atoms/points building the coordination variable. ", &
usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO_B", &
variants=(/"POINTS_TO_B"/), &
description="For the CV given by the multiplication of two coorination numbers,"// &
" here specify indexes of the third set of atoms/points. ", &
usage="ATOMS_TO_B {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_FROM", &
description="Specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_FROM {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO", &
description="Specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_TO {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO_B", &
description="For the CV given by the multiplication of two coorination numbers,"// &
" here specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_TO_B {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL keyword_create(keyword, __LOCATION__, name="R0", &
variants=(/"R_0"/), &
description="Specify the R0 parameter in the coordination function.", &
usage="R0 {real}", default_r_val=3.0_dp, &
unit_str="bohr", n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NN", &
variants=(/"EXPON_NUMERATOR"/), &
description="Sets the value of the numerator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="NN {integer}", default_i_val=6, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ND", &
variants=(/"EXPON_DENOMINATOR"/), &
description="Sets the value of the denominator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="ND {integer}", default_i_val=12, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="R0_B", &
variants=(/"R_0_B"/), &
description="For the CV given by the multiplication of two coorination numbers,"// &
" specify the R0 parameter in the second coordination function.", &
usage="R0_B {real}", default_r_val=3.0_dp, &
unit_str="bohr", n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NN_B", &
variants=(/"EXPON_NUMERATOR_B"/), &
description="For the CV given by the multiplication of two coorination numbers,"// &
" Sets the value of the numerator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="NN_B {integer}", default_i_val=6, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ND_B", &
variants=(/"EXPON_DENOMINATOR_B"/), &
description="For the CV given by the multiplication of two coorination numbers,"// &
" Sets the value of the denominator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="ND_B {integer}", default_i_val=12, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_colvar_coord_section
! **************************************************************************************************
!> \brief ...
!> \param section ...
! **************************************************************************************************
SUBROUTINE create_colvar_cond_dist_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="CONDITIONED_DISTANCE", &
description="Section to define the conditioned distance as a collective variable.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_DISTANCE", &
description="Specify indexes of atoms/points from which the distance is computed. ", &
usage="ATOMS_DISTANCE {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
variants=(/"POINTS_FROM"/), &
description="Specify indexes of atoms/points building the coordination variable. ", &
usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
variants=(/"POINTS_TO"/), &
description="Specify indexes of atoms/points building the coordination variable. ", &
usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_FROM", &
description="Specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_FROM {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO", &
description="Specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_TO {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL keyword_create(keyword, __LOCATION__, name="R0", &
variants=(/"R_0"/), &
description="Specify the R0 parameter in the coordination function.", &
usage="R0 {real}", default_r_val=3.0_dp, &
unit_str="bohr", n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NN", &
variants=(/"EXPON_NUMERATOR"/), &
description="Sets the value of the numerator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="NN {integer}", default_i_val=6, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ND", &
variants=(/"EXPON_DENOMINATOR"/), &
description="Sets the value of the denominator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="ND {integer}", default_i_val=12, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
description="Specify the lambda parameter at the exponent of the conditioned distance function.", &
usage="R0 {real}", default_r_val=3.0_dp, &
unit_str="bohr", n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_colvar_cond_dist_section
! **************************************************************************************************
!> \brief collective variables specifying population of a specie based on coordination
!> \param section the section to be created
!> \date 01.2009
!> \author Fabio Sterpone
! **************************************************************************************************
SUBROUTINE create_colvar_pop_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="population", &
description="Section to define the population of specie as a collective variable. "// &
"See also <https://doi.org/10.1021/jp3019588>.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
variants=(/"POINTS_FROM"/), &
description="Specify indexes of atoms/points building the coordination variable. ", &
usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
variants=(/"POINTS_TO"/), &
description="Specify indexes of atoms/points building the coordination variable. ", &
usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_FROM", &
description="Specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_FROM {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO", &
description="Specify alternatively kinds of atoms building the coordination variable.", &
usage="KINDS_TO {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL keyword_create(keyword, __LOCATION__, name="R0", &
variants=(/"R_0"/), &
description="Specify the R0 parameter in the coordination function.", &
usage="R0 {real}", default_r_val=3.0_dp, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NN", &
variants=(/"EXPON_NUMERATOR"/), &
description="Sets the value of the numerator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="NN {integer}", default_i_val=6, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ND", &
variants=(/"EXPON_DENOMINATOR"/), &
description="Sets the value of the denominator of the exponential factor"// &
" in the coordination FUNCTION.", &
usage="ND {integer}", default_i_val=12, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="n0", &
variants=(/"n_0"/), &
description="Specify the n0 parameter that sets the coordination of the species.", &
usage="n0 {integer}", default_i_val=4, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SIGMA", &
description="Specify the gaussian width of used to build the population istogram.", &
usage="SIGMA {real}", default_r_val=0.5_dp, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_colvar_pop_section
! **************************************************************************************************
!> \brief ...
!> \param section ...
! **************************************************************************************************
SUBROUTINE create_colvar_gyr_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="GYRATION_RADIUS", &
description="Section to define the gyration radius as a collective variable.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
variants=(/"POINTS"/), &
description="Specify indexes of atoms/points defyining the gyration radius variable. ", &
usage="ATOMS {integer} {integer} ..", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KINDS", &
description="Specify alternatively kinds of atoms defining the gyration radius.", &
usage="KINDS {CHAR} {CHAR} ..", repeats=.TRUE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_gyr_section
! **************************************************************************************************
!> \brief collective variables specifying torsion
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_dfunct_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="DISTANCE_FUNCTION", &
description="Section to define functions between two distances as collective variables."// &
" The function is defined as d1+coeff*d2", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
variants=(/"POINTS"/), &
description="Specifies the indexes of atoms/points for the two bonds d1=(1-2) d2=(3-4).", &
usage="ATOMS {integer} {integer} {integer} {integer}", &
n_var=4, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COEFFICIENT", &
description="Specifies the coefficient in the function for the constraint."// &
" -1.0 has to be used for distance difference, 1.0 for distance addition", &
usage="COEFFICIENT {real}", &
type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PBC", &
description="Whether periodic boundary conditions should be applied on the "// &
"atomic position before computing the colvar or not.", &
usage="PBC", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_dfunct_section
! **************************************************************************************************
!> \brief collective variables specifying torsion
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_torsion_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="torsion", &
description="Section to define the torsion as a collective variables.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
variants=(/"POINTS"/), &
description="Specifies the indexes of atoms/points defining the torsion.", &
usage="ATOMS {integer} {integer} {integer} {integer}", &
n_var=4, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_torsion_section
! **************************************************************************************************
!> \brief collective variables specifying torsion
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_rot_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="bond_rotation", &
description="Section to define the rotation of a bond/line with respect to"// &
" another bond/line", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="P1_BOND1", &
description="Specifies the index of atom/point defining the first point"// &
" of the first bond/line.", &
usage="P1_BOND1 {integer}", &
n_var=1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="P2_BOND1", &
description="Specifies the index of atom/point defining the second point"// &
" of the first bond/line.", &
usage="P2_BOND1 {integer}", &
n_var=1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="P1_BOND2", &
description="Specifies the index of atom/point defining the first point"// &
" of the second bond/line.", &
usage="P1_BOND2 {integer}", &
n_var=1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="P2_BOND2", &
description="Specifies the index of atom/point defining the second point"// &
" of the second bond/line.", &
usage="P2_BOND2 {integer}", &
n_var=1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_rot_section
! **************************************************************************************************
!> \brief collective variables specifying angles
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_angle_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="angle", &
description="Section to define the angle as a collective variables.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
variants=(/"POINTS"/), &
description="Specifies the indexes of atoms/points defining the angle.", &
usage="ATOMS {integer} {integer} {integer}", &
n_var=3, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_angle_section
! **************************************************************************************************
!> \brief creates the colvar section regarded to the collective variables dist
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_dist_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="distance", &
description="Section to define the distance as a collective variables.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
variants=(/"POINTS"/), &
description="Specifies the indexes of atoms/points defining the distance.", &
usage="ATOMS {integer} {integer}", &
n_var=2, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="AXIS", &
description="Define the axes along which the colvar should be evaluated", &
usage="AXIS (XYZ | X | Y | Z | XY| XZ | YZ)", &
enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
enum_i_vals=(/do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz/), &
default_i_val=do_clv_xyz)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SIGN", &
description="Whether the distance along one Cartesian axis has to be considered with sign."// &
" This option is valid if only one dimension is selected.", &
usage="SIGN", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_dist_section
! **************************************************************************************************
!> \brief creates the colvar section regarded to the collective variables dist
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_xyz_d_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="XYZ_DIAG", &
description="Section to define the distance of an atom from its starting "// &
"position ((X-X(0))^2+(Y-Y(0))^2+(Z-Z(0))^2) or part of its components as a collective variable. "// &
"If absolute_position is specified, instead the CV is represented by the "// &
"instantaneous position of the atom (only available for X, Y or Z components).", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOM", &
variants=(/"POINT"/), &
description="Specifies the index of the atom/point.", &
usage="ATOM {integer}", &
n_var=1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COMPONENT", &
description="Define the component of the position vector which will be used "// &
"as a colvar.", &
usage="AXIS (XYZ | X | Y | Z | XY| XZ | YZ)", &
enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
enum_i_vals=(/do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz/), &
default_i_val=do_clv_xyz)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PBC", &
description="Whether periodic boundary conditions should be applied on the "// &
"atomic position before computing the colvar or not.", &
usage="PBC", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ABSOLUTE_POSITION", &
description="If enabled, the absolute position of the atoms will be used. ", &
usage="ABSOLUTE_POSITION", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_xyz_d_section
! **************************************************************************************************
!> \brief creates the colvar section regarded to the collective variables dist
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_colvar_xyz_od_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="XYZ_OUTERDIAG", &
description="Section to define the cross term (XA-XA(0))*(XB-XB(0))+(XA-XA(0))*(YB-YB(0))"// &
" or part of its components as a collective variable. The final term is given by the product"// &
" of the components of A with the components of B.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
variants=(/"POINTS"/), &
description="Specifies the index of the atoms/points A and B.", &
usage="ATOMS {integer} {integer}", &
n_var=2, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COMPONENT_A", &
description="Define the component of the position vector which will be used "// &
"as a colvar for atom A.", &
usage="AXIS (XYZ | X | Y | Z | XY| XZ | YZ)", &
enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
enum_i_vals=(/do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz/), &
default_i_val=do_clv_xyz)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COMPONENT_B", &
description="Define the component of the position vector which will be used "// &
"as a colvar for atom B.", &
usage="AXIS (XYZ | X | Y | Z | XY| XZ | YZ)", &
enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
enum_i_vals=(/do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz/), &
default_i_val=do_clv_xyz)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PBC", &
description="Whether periodic boundary conditions should be applied on the "// &
"atomic position before computing the colvar or not.", &
usage="PBC", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Must be present in each colvar and handled properly
CALL create_point_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_colvar_xyz_od_section
! **************************************************************************************************
!> \brief energy as collective variable
!> \param section the section to be created
!> \author Sebastiano Caravati
! **************************************************************************************************
SUBROUTINE create_colvar_u_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="u", &
description="Section to define the energy as a generalized collective variable.", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL section_create(subsection, __LOCATION__, name="MIXED", &
description="This section allows to use any function of the energy subsystems"// &
" in a mixed_env calculation as a collective variable.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="ENERGY_FUNCTION", &
description="Specifies the functional form of the collective variable in mathematical notation.", &
usage="ENERGY_FUNCTION (E1+E2-LOG(E1/E2))", type_of_var=lchar_t, &
n_var=1)
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="VARIABLES", &
description="Defines the variables of the functional form. To allow an efficient"// &
" mapping the order of the energy variables will be considered identical to the"// &
" order of the force_eval in the force_eval_order list.", &
usage="VARIABLES x", type_of_var=char_t, &
n_var=-1)
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PARAMETERS", &
description="Defines the parameters of the functional form", &
usage="PARAMETERS a b D", type_of_var=char_t, &
n_var=-1, repeats=.TRUE.)
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="VALUES", &
description="Defines the values of parameter of the functional form", &
usage="VALUES ", type_of_var=real_t, &
n_var=-1, repeats=.TRUE., unit_str="internal_cp2k")
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)