-
Notifications
You must be signed in to change notification settings - Fork 1
/
input_cp2k_mm.F
3021 lines (2556 loc) · 162 KB
/
input_cp2k_mm.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 !
!--------------------------------------------------------------------------------------------------!
! **************************************************************************************************
!> \brief creates the mm section of the input
!> \note
!> moved out of input_cp2k
!> \par History
!> 04.2004 created
!> \author fawzi
! **************************************************************************************************
MODULE input_cp2k_mm
USE bibliography, ONLY: &
Batzner2022, Clabaut2020, Clabaut2021, Devynck2012, Dick1958, Foiles1986, Mitchell1993, &
Musaelian2023, QUIP_ref, Siepmann1995, Tersoff1988, Tosi1964a, Tosi1964b, Wang2018, &
Yamada2000, Zeng2023
USE cp_output_handling, ONLY: cp_print_key_section_create,&
debug_print_level,&
high_print_level,&
low_print_level,&
medium_print_level,&
silent_print_level
USE cp_units, ONLY: cp_unit_to_cp2k
USE force_field_kind_types, ONLY: &
do_ff_amber, do_ff_charmm, do_ff_cubic, do_ff_fues, do_ff_g87, do_ff_g96, do_ff_harmonic, &
do_ff_legendre, do_ff_mixed_bend_stretch, do_ff_mm2, do_ff_mm3, do_ff_mm4, do_ff_morse, &
do_ff_opls, do_ff_quartic, do_ff_undef
USE input_constants, ONLY: use_mom_ref_coac,&
use_mom_ref_com,&
use_mom_ref_user,&
use_mom_ref_zero
USE input_cp2k_field, ONLY: create_per_efield_section
USE input_cp2k_poisson, ONLY: create_poisson_section
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: default_string_length,&
dp
USE string_utilities, ONLY: newline,&
s2a
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_mm'
PUBLIC :: create_mm_section, create_dipoles_section
PUBLIC :: create_NONBONDED14_section, create_LJ_section, create_Williams_section, &
create_Goodwin_section, &
create_GENPOT_section, create_TABPOT_section, create_neighbor_lists_section
PUBLIC :: create_CHARGE_section
!***
CONTAINS
! **************************************************************************************************
!> \brief Create the input section for FIST.. Come on.. Let's get woohooo
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_mm_section(section)
TYPE(section_type), POINTER :: section
TYPE(section_type), POINTER :: subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="mm", &
description="This section contains all information to run a MM calculation.", &
n_keywords=5, n_subsections=0, repeats=.FALSE.)
NULLIFY (subsection)
CALL create_forcefield_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_neighbor_lists_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_poisson_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_per_efield_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_print_mm_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_mm_section
! **************************************************************************************************
!> \brief Create the print mm section
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_print_mm_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="print", &
description="Section of possible print options in MM code.", &
n_keywords=0, n_subsections=1, repeats=.FALSE.)
NULLIFY (print_key, keyword)
CALL cp_print_key_section_create(print_key, __LOCATION__, "DERIVATIVES", &
description="Controls the printing of derivatives.", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "EWALD_INFO", &
description="Controls the printing of Ewald energy components during the "// &
"evaluation of the electrostatics.", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL create_dipoles_section(print_key, "DIPOLE", medium_print_level)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "NEIGHBOR_LISTS", &
description="Activates the printing of the neighbor lists.", &
print_level=high_print_level, filename="", unit_str="angstrom")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "ITER_INFO", &
description="Activates the printing of iteration info during the self-consistent "// &
"calculation of a polarizable forcefield.", &
print_level=medium_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "SUBCELL", &
description="Activates the printing of the subcells used for the "// &
"generation of neighbor lists.", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_BANNER", &
description="Controls the printing of the banner of the MM program", &
print_level=silent_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
description="Controls the printing of information regarding the run.", &
print_level=low_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "FF_PARAMETER_FILE", description= &
"Controls the printing of Force Field parameter file", &
print_level=debug_print_level + 1, filename="", common_iter_levels=2)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "FF_INFO", description= &
"Controls the printing of information in the forcefield settings", &
print_level=high_print_level, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="spline_info", &
description="if the printkey is active prints information regarding the splines"// &
" used in the nonbonded interactions", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="spline_data", &
description="if the printkey is active prints on separated files the splined function"// &
" together with the reference one. Useful to check the spline behavior.", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
END SUBROUTINE create_print_mm_section
! **************************************************************************************************
!> \brief Create the forcefield section. This section is useful to set up the
!> proper force_field for FIST calculations
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_forcefield_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="FORCEFIELD", &
description="Section specifying information regarding how to set up properly"// &
" a force_field for the classical calculations.", &
n_keywords=2, n_subsections=2, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL keyword_create( &
keyword, __LOCATION__, name="PARMTYPE", &
description="Define the kind of torsion potential", &
usage="PARMTYPE {OFF,CHM,G87,G96}", &
enum_c_vals=s2a("OFF", "CHM", "G87", "G96", "AMBER"), &
enum_desc=s2a("Provides force field parameters through the input file", &
"Provides force field parameters through an external file with CHARMM format", &
"Provides force field parameters through an external file with GROMOS 87 format", &
"Provides force field parameters through an external file with GROMOS 96 format", &
"Provides force field parameters through an external file with AMBER format (from v.8 on)"), &
enum_i_vals=(/do_ff_undef, &
do_ff_charmm, &
do_ff_g87, &
do_ff_g96, &
do_ff_amber/), &
default_i_val=do_ff_undef)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PARM_FILE_NAME", &
description="Specifies the filename that contains the parameters of the FF.", &
usage="PARM_FILE_NAME {FILENAME}", type_of_var=lchar_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="VDW_SCALE14", &
description="Scaling factor for the VDW 1-4 ", &
usage="VDW_SCALE14 1.0", default_r_val=1.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EI_SCALE14", &
description="Scaling factor for the electrostatics 1-4 ", &
usage="EI_SCALE14 1.0", default_r_val=0.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SHIFT_CUTOFF", &
description="Add a constant energy shift to the real-space "// &
"non-bonding interactions (both Van der Waals and "// &
"electrostatic) such that the energy at the cutoff radius is "// &
"zero. This makes the non-bonding interactions continuous at "// &
"the cutoff.", &
usage="SHIFT_CUTOFF <LOGICAL>", default_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DO_NONBONDED", &
description="Controls the computation of all the real-space "// &
"(short-range) nonbonded interactions. This also "// &
"includes the real-space corrections for excluded "// &
"or scaled 1-2, 1-3 and 1-4 interactions. When set "// &
"to F, the neighborlists are not created and all "// &
"interactions that depend on them are not computed.", &
usage="DO_NONBONDED T", 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="DO_ELECTROSTATICS", &
description="Controls the computation of all the real-space "// &
"(short-range) electrostatics interactions. This does not "// &
"affect the QM/MM electrostatic coupling when turned off.", &
usage="DO_ELECTROSTATICS T", 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="IGNORE_MISSING_CRITICAL_PARAMS", &
description="Do not abort when critical force-field parameters "// &
"are missing. CP2K will run as if the terms containing the "// &
"missing parameters are zero.", &
usage="IGNORE_MISSING_BOND_PARAMS T", default_l_val=.FALSE., &
lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="MULTIPLE_POTENTIAL", &
description="Enables the possibility to define NONBONDED and NONBONDED14 as a"// &
" sum of different kinds of potential. Useful for piecewise defined potentials.", &
usage="MULTIPLE_POTENTIAL T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
!Universal scattering potential at very short distances
CALL keyword_create(keyword, __LOCATION__, name="ZBL_SCATTERING", &
description="A short range repulsive potential is added, to simulate "// &
"collisions and scattering.", &
usage="ZBL_SCATTERING T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
!
! subsections
!
CALL create_SPLINE_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_NONBONDED_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_NONBONDED14_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_CHARGE_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_CHARGES_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_SHELL_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_BOND_section(subsection, "BOND")
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_BEND_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_TORSION_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_IMPROPER_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_OPBEND_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_DIPOLE_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_QUADRUPOLE_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_forcefield_section
! **************************************************************************************************
!> \brief This section specifies the parameters for the splines
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_SPLINE_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="SPLINE", &
description="specifies parameters to set up the splines used in the"// &
" nonboned interactions (both pair body potential and many body potential)", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="R0_NB", &
description="Specify the minimum value of the distance interval "// &
"that brackets the value of emax_spline.", &
usage="R0_NB <REAL>", default_r_val=cp_unit_to_cp2k(value=0.9_dp, &
unit_str="bohr"), &
unit_str="angstrom")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RCUT_NB", &
description="Cutoff radius for nonbonded interactions. This value overrides"// &
" the value specified in the potential definition and is global for all potentials.", &
usage="RCUT_NB {real}", default_r_val=cp_unit_to_cp2k(value=-1.0_dp, &
unit_str="angstrom"), &
unit_str="angstrom")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EMAX_SPLINE", &
description="Specify the maximum value of the potential up to which"// &
" splines will be constructed", &
usage="EMAX_SPLINE <REAL>", &
default_r_val=0.5_dp, unit_str="hartree")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EMAX_ACCURACY", &
description="Specify the maximum value of energy used to check the accuracy"// &
" requested through EPS_SPLINE. Energy values larger than EMAX_ACCURACY"// &
" generally do not satisfy the requested accuracy", &
usage="EMAX_ACCURACY <REAL>", default_r_val=0.02_dp, unit_str="hartree")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EPS_SPLINE", &
description="Specify the threshold for the choice of the number of"// &
" points used in the splines (comparing the splined value with the"// &
" analytically evaluated one)", &
usage="EPS_SPLINE <REAL>", default_r_val=1.0E-7_dp, unit_str="hartree")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, name="NPOINTS", &
description="Override the default search for an accurate spline by specifying a fixed number of spline points.", &
usage="NPOINTS 1024", default_i_val=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="UNIQUE_SPLINE", &
description="For few potentials (Lennard-Jones) one global optimal spline is generated instead"// &
" of different optimal splines for each kind of potential", &
usage="UNIQUE_SPLINE <LOGICAL>", lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_SPLINE_section
! **************************************************************************************************
!> \brief This section specifies the torsion of the MM atoms
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_TORSION_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="TORSION", &
description="Specifies the torsion potential of the MM system.", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
description="Defines the atomic kinds involved in the tors.", &
usage="ATOMS {KIND1} {KIND2} {KIND3} {KIND4}", type_of_var=char_t, &
n_var=4)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KIND", &
description="Define the kind of torsion potential", &
usage="KIND CHARMM", &
enum_c_vals=s2a("CHARMM", "G87", "G96", "AMBER", "OPLS"), &
enum_desc=s2a("Functional Form (CHARMM|G87|G96|AMBER): K * [ 1 + cos[M*PHI - PHI0]]", &
"Functional Form (CHARMM|G87|G96|AMBER): K * [ 1 + cos[M*PHI - PHI0]]", &
"Functional Form (CHARMM|G87|G96|AMBER): K * [ 1 + cos[M*PHI - PHI0]]", &
"Functional Form (CHARMM|G87|G96|AMBER): K * [ 1 + cos[M*PHI - PHI0]]", &
"Functional Form: K / 2 * [ 1 + (-1)^(M-1) * cos[M*PHI]]"), &
enum_i_vals=(/do_ff_charmm, &
do_ff_g87, &
do_ff_g96, &
do_ff_amber, &
do_ff_opls/), &
default_i_val=do_ff_charmm)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="K", &
description="Defines the force constant of the potential", &
usage="K {real}", type_of_var=real_t, &
n_var=1, unit_str="hartree")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PHI0", &
description="Defines the phase of the potential.", &
usage="PHI0 {real}", type_of_var=real_t, &
n_var=1, unit_str="rad", default_r_val=0.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="M", &
description="Defines the multiplicity of the potential.", &
usage="M {integer}", type_of_var=integer_t, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_TORSION_section
! **************************************************************************************************
!> \brief This section specifies the improper torsion of the MM atoms
!> \param section the section to create
!> \author louis vanduyfhuys
! **************************************************************************************************
SUBROUTINE create_IMPROPER_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="IMPROPER", &
description="Specifies the improper torsion potential of the MM system.", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
description="Defines the atomic kinds involved in the improper tors.", &
usage="ATOMS {KIND1} {KIND2} {KIND3} {KIND4}", type_of_var=char_t, &
n_var=4)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KIND", &
description="Define the kind of improper torsion potential", &
usage="KIND CHARMM", &
enum_c_vals=s2a("CHARMM", "G87", "G96", "HARMONIC"), &
enum_desc=s2a("Functional Form (CHARMM): K * [ PHI - PHI0 ]**2", &
"Functional Form (G87|G96|HARMONIC): 0.5 * K * [ PHI - PHI0 ]**2", &
"Functional Form (G87|G96|HARMONIC): 0.5 * K * [ PHI - PHI0 ]**2", &
"Functional Form (G87|G96|HARMONIC): 0.5 * K * [ PHI - PHI0 ]**2"), &
enum_i_vals=(/do_ff_charmm, &
do_ff_g87, &
do_ff_g96, &
do_ff_harmonic/), &
default_i_val=do_ff_charmm)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="K", &
description="Defines the force constant of the potential", &
usage="K {real}", type_of_var=real_t, &
n_var=1, unit_str="hartree*rad^-2")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PHI0", &
description="Defines the phase of the potential.", &
usage="PHI0 {real}", type_of_var=real_t, &
n_var=1, unit_str="rad")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_IMPROPER_section
! **************************************************************************************************
!> \brief This section specifies the out of plane bend of the MM atoms
!> \param section the section to create
!> \author louis vanduyfhuys
! **************************************************************************************************
SUBROUTINE create_OPBEND_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="OPBEND", &
description="Specifies the out of plane bend potential of the MM system."// &
" (Only defined for atom quadruples which are also defined as an improper"// &
" pattern in the topology.)", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
description="Defines the atomic kinds involved in the opbend.", &
usage="ATOMS {KIND1} {KIND2} {KIND3} {KIND4}", type_of_var=char_t, &
n_var=4)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KIND", &
description="Define the kind of out of plane bend potential", &
usage="KIND HARMONIC", &
enum_c_vals=s2a("HARMONIC", "MM2", "MM3", "MM4"), &
enum_desc=s2a("Functional Form (HARMONIC): 0.5 * K * [ PHI - PHI0 ]**2", &
"Functional Form (MM2|MM3|MM4): K * [ PHI - PHI0 ]**2", &
"Functional Form (MM2|MM3|MM4): K * [ PHI - PHI0 ]**2", &
"Functional Form (MM2|MM3|MM4): K * [ PHI - PHI0 ]**2"), &
enum_i_vals=(/do_ff_harmonic, &
do_ff_mm2, &
do_ff_mm3, &
do_ff_mm4/), &
default_i_val=do_ff_harmonic)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="K", &
description="Defines the force constant of the potential", &
usage="K {real}", type_of_var=real_t, &
n_var=1, unit_str="hartree*rad^-2")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PHI0", &
description="Defines the phase of the potential.", &
usage="PHI0 {real}", type_of_var=real_t, &
n_var=1, unit_str="rad")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_OPBEND_section
! **************************************************************************************************
!> \brief This section specifies the bend of the MM atoms
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_BEND_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="BEND", &
description="Specifies the bend potential of the MM system.", &
n_keywords=11, n_subsections=1, repeats=.TRUE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
description="Defines the atomic kinds involved in the bend.", &
usage="ATOMS {KIND1} {KIND2} {KIND3}", type_of_var=char_t, &
n_var=3)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, name="KIND", &
description="Define the kind of bend potential", &
usage="KIND HARMONIC", &
enum_c_vals=s2a("HARMONIC", "CHARMM", "AMBER", "G87", "G96", "CUBIC", "MIXED_BEND_STRETCH", "MM3", &
"LEGENDRE"), &
enum_desc=s2a("Functional Form (HARMONIC|G87): 1/2*K*(THETA-THETA0)^2", &
"Functional Form (CHARMM|AMBER): K*(THETA-THETA0)^2", &
"Functional Form (CHARMM|AMBER): K*(THETA-THETA0)^2", &
"Functional Form (HARMONIC|G87): 1/2*K*(THETA-THETA0)^2", &
"Functional Form (G96): 1/2*K*(COS(THETA)-THETA0)^2", &
"Functional Form (CUBIC): K*(THETA-THETA0)**2*(1+CB*(THETA-THETA0))", &
"Functional Form (MIXED_BEND_STRETCH): K*(THETA-THETA0)**2*(1+CB*(THETA-THETA0))+"// &
" KSS*(R12-R012)*(R32-R032)+KBS12*(R12-R012)*(THETA-THETA0)+KBS32*(R32-R032)*(THETA-THETA0)", &
"Functional Form (MM3): 1/2*K*(THETA-THETA0)**2*(1-0.014*(THETA-THETA0)+5.6E-5*(THETA-THETA0)**2"// &
" -7.0E-7*(THETA-THETA0)**3+9.0E-10*(THETA-THETA0)**4)+KBS12*(R12-R012)*(THETA-THETA0)+"// &
" KBS32*(R32-R032)*(THETA-THETA0)", &
"Functional Form (LEGENDRE): sum_{i=0}^N c_i*P_i(COS(THETA)) "), &
enum_i_vals=(/do_ff_harmonic, &
do_ff_charmm, &
do_ff_amber, &
do_ff_g87, &
do_ff_g96, &
do_ff_cubic, &
do_ff_mixed_bend_stretch, &
do_ff_mm3, &
do_ff_legendre/), &
default_i_val=do_ff_charmm)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="K", &
description="Defines the force constant of the potential", &
usage="K {real}", type_of_var=real_t, &
n_var=1, unit_str="hartree*rad^-2")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CB", &
description="Defines the the cubic force constant of the bend", &
usage="CB {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="rad^-1")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="R012", &
description="Mixed bend stretch parameter", &
usage="R012 {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="bohr")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="R032", &
description="Mixed bend stretch parameter", &
usage="R032 {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="bohr")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KBS12", &
description="Mixed bend stretch parameter", &
usage="KBS12 {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="hartree*bohr^-1*rad^-1")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KBS32", &
description="Mixed bend stretch parameter", &
usage="KBS32 {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="hartree*bohr^-1*rad^-1")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="KSS", &
description="Mixed bend stretch parameter", &
usage="KSS {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="hartree*bohr^-2")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="THETA0", &
description="Defines the equilibrium angle.", &
usage="THETA0 {real}", type_of_var=real_t, &
n_var=1, unit_str='rad')
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="LEGENDRE", &
description="Specifies the coefficients for the legendre"// &
" expansion of the bending potential."// &
" 'THETA0' and 'K' are not used, but need to be specified."// &
" Use an arbitrary value.", usage="LEGENDRE {REAL} {REAL} ...", &
default_r_val=0.0d0, type_of_var=real_t, &
n_var=-1, unit_str="hartree")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Create the Urey-Bradley section
CALL create_BOND_section(subsection, "UB")
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_BEND_section
! **************************************************************************************************
!> \brief This section specifies the bond of the MM atoms
!> \param section the section to create
!> \param label ...
!> \author teo
! **************************************************************************************************
SUBROUTINE create_BOND_section(section, label)
TYPE(section_type), POINTER :: section
CHARACTER(LEN=*), INTENT(IN) :: label
CHARACTER(LEN=default_string_length) :: tag
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
NULLIFY (keyword)
IF (TRIM(label) == "UB") THEN
tag = " Urey-Bradley "
CALL section_create(section, __LOCATION__, name=TRIM(label), &
description="Specifies the Urey-Bradley potential between the external atoms"// &
" defining the angle", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
ELSE
tag = " Bond "
CALL section_create(section, __LOCATION__, name=TRIM(label), &
description="Specifies the bond potential", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
description="Defines the atomic kinds involved in the bond.", &
usage="ATOMS {KIND1} {KIND2}", type_of_var=char_t, &
n_var=2)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END IF
CALL keyword_create(keyword, __LOCATION__, name="KIND", &
description="Define the kind of"//TRIM(tag)//"potential.", &
usage="KIND HARMONIC", &
enum_c_vals=s2a("HARMONIC", "CHARMM", "AMBER", "G87", "G96", "QUARTIC", &
"MORSE", "CUBIC", "FUES"), &
enum_desc=s2a("Functional Form (HARMONIC|G87): 1/2*K*(R-R0)^2", &
"Functional Form (CHARMM|AMBER): K*(R-R0)^2", &
"Functional Form (CHARMM|AMBER): K*(R-R0)^2", &
"Functional Form (HARMONIC|G87): 1/2*K*(R-R0)^2", &
"Functional Form (G96): 1/4*K*(R^2-R0^2)^2", &
"Functional Form (QUARTIC): (1/2*K1+[1/3*K2+1/4*K3*|R-R0|]*|R-R0|)(R-R0)^2", &
"Functional Form (MORSE): K1*[(1-exp(-K2*(R-R0)))^2-1])", &
"Functional Form (CUBIC): K*(R-R0)^2*(1+cs*(R-R0)+7/12*(cs^2*(R-R0)^2))", &
"Functional Form (FUES): 1/2*K*R0^2*(1+R0/R*(R0/R-2))"), &
enum_i_vals=(/do_ff_harmonic, &
do_ff_charmm, &
do_ff_amber, &
do_ff_g87, &
do_ff_g96, &
do_ff_quartic, &
do_ff_morse, &
do_ff_cubic, &
do_ff_fues/), &
default_i_val=do_ff_charmm)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="K", &
description="Defines the force constant of the potential. "// &
"For MORSE potentials 2 numbers are expected. "// &
"For QUARTIC potentials 3 numbers are expected.", &
usage="K {real}", type_of_var=real_t, &
n_var=-1, unit_str="internal_cp2k")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CS", &
description="Defines the cubic stretch term.", &
usage="CS {real}", default_r_val=0.0_dp, type_of_var=real_t, &
n_var=1, unit_str="bohr^-1")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="R0", &
description="Defines the equilibrium distance.", &
usage="R0 {real}", type_of_var=real_t, &
n_var=1, unit_str="bohr")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_BOND_section
! **************************************************************************************************
!> \brief This section specifies the charge of the MM atoms
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_charges_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="charges", &
description="Allow to specify an array of classical charges, thus avoiding the"// &
" packing and permitting the usage of different charges for same atomic types.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
description="Value of the charge for the individual atom. Order MUST reflect"// &
" the one specified for the geometry.", repeats=.TRUE., usage="{Real}", &
type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_charges_section
! **************************************************************************************************
!> \brief This section specifies the charge of the MM atoms
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_charge_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="charge", &
description="This section specifies the charge of the MM atoms", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOM", &
description="Defines the atomic kind of the charge.", &
usage="ATOM {KIND1}", type_of_var=char_t, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CHARGE", &
description="Defines the charge of the MM atom in electron charge unit.", &
usage="CHARGE {real}", type_of_var=real_t, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_charge_section
! **************************************************************************************************
!> \brief This section specifies the isotropic polarizability of the MM atoms
!> \param section the section to create
!> \author Marcel Baer
! **************************************************************************************************
SUBROUTINE create_quadrupole_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create( &
section, __LOCATION__, name="QUADRUPOLE", &
description="This section specifies that we will perform an SCF quadrupole calculation of the MM atoms. "// &
"Needs KEYWORD POL_SCF in POISSON secton", &
n_keywords=1, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOM", &
description="Defines the atomic kind of the SCF quadrupole.", &
usage="ATOM {KIND1}", type_of_var=char_t, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CPOL", &
description="Defines the isotropic polarizability of the MM atom.", &
usage="CPOL {real}", type_of_var=real_t, &
n_var=1, unit_str='internal_cp2k')
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_quadrupole_section
! **************************************************************************************************
!> \brief This section specifies the isotropic polarizability of the MM atoms
!> \param section the section to create
!> \author Marcel Baer
! **************************************************************************************************
SUBROUTINE create_dipole_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="DIPOLE", &
description="This section specifies that we will perform an SCF dipole calculation of the MM atoms. "// &
"Needs KEYWORD POL_SCF in POISSON secton", &
n_keywords=1, n_subsections=1, repeats=.TRUE.)
NULLIFY (subsection, keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOM", &
description="Defines the atomic kind of the SCF dipole.", &
usage="ATOM {KIND1}", type_of_var=char_t, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="APOL", &
description="Defines the isotropic polarizability of the MM atom.", &
usage="APOL {real}", type_of_var=real_t, &
n_var=1, unit_str='angstrom^3')
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL create_DAMPING_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_dipole_section
! **************************************************************************************************
!> \brief This section specifies the idamping parameters for polarizable atoms
!> \param section the section to create
!> \author Rodolphe Vuilleumier
! **************************************************************************************************
SUBROUTINE create_damping_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="DAMPING", &
description="This section specifies optional electric field damping for the polarizable atoms. ", &
n_keywords=4, n_subsections=0, repeats=.TRUE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOM", &
description="Defines the atomic kind for this damping function.", &
usage="ATOM {KIND1}", type_of_var=char_t, &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
description="Defines the damping type.", &
usage="TYPE {string}", type_of_var=char_t, &
n_var=1, default_c_val="TANG-TOENNIES")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ORDER", &