-
Notifications
You must be signed in to change notification settings - Fork 1
/
input_cp2k_dft.F
2298 lines (2013 loc) · 127 KB
/
input_cp2k_dft.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 function that build the dft section of the input
!> \par History
!> 10.2005 moved out of input_cp2k [fawzi]
!> \author fawzi
! **************************************************************************************************
MODULE input_cp2k_dft
USE basis_set_types, ONLY: basis_sort_default,&
basis_sort_zet
USE bibliography, ONLY: &
Andermatt2016, Andreussi2012, Avezac2005, Bengtsson1999, Blochl1995, Brelaz1979, &
Fattebert2002, Guidon2010, Iannuzzi2005, Iannuzzi2006, Kunert2003, Merlot2014, Perdew1981, &
VandeVondele2005b, Yin2017
USE cp_output_handling, ONLY: add_last_numeric,&
cp_print_key_section_create,&
high_print_level,&
low_print_level,&
medium_print_level,&
silent_print_level
USE cp_spline_utils, ONLY: pw_interp,&
spline3_nopbc_interp,&
spline3_pbc_interp
USE cp_units, ONLY: cp_unit_to_cp2k
USE input_constants, ONLY: &
admm1_type, admm2_type, admmp_type, admmq_type, admms_type, do_admm_aux_exch_func_bee, &
do_admm_aux_exch_func_bee_libxc, do_admm_aux_exch_func_default, &
do_admm_aux_exch_func_default_libxc, do_admm_aux_exch_func_none, &
do_admm_aux_exch_func_opt, do_admm_aux_exch_func_opt_libxc, do_admm_aux_exch_func_pbex, &
do_admm_aux_exch_func_pbex_libxc, do_admm_aux_exch_func_sx_libxc, &
do_admm_basis_projection, do_admm_blocked_projection, do_admm_blocking_purify_full, &
do_admm_charge_constrained_projection, do_admm_exch_scaling_merlot, &
do_admm_exch_scaling_none, do_admm_purify_cauchy, do_admm_purify_cauchy_subspace, &
do_admm_purify_mcweeny, do_admm_purify_mo_diag, do_admm_purify_mo_no_diag, &
do_admm_purify_none, do_admm_purify_none_dm, do_arnoldi, do_bch, do_cn, do_em, do_etrs, &
do_exact, do_pade, do_taylor, ehrenfest, gaussian, kg_color_dsatur, kg_color_greedy, &
kg_tnadd_atomic, kg_tnadd_embed, kg_tnadd_embed_ri, kg_tnadd_none, no_admm_type, &
no_excitations, numerical, oe_gllb, oe_lb, oe_none, oe_saop, oe_sic, plus_u_lowdin, &
plus_u_mulliken, plus_u_mulliken_charges, real_time_propagation, rel_dkh, rel_none, &
rel_pot_erfc, rel_pot_full, rel_sczora_mp, rel_trans_atom, rel_trans_full, &
rel_trans_molecule, rel_zora, rel_zora_full, rel_zora_mp, rtp_bse_ham_g0w0, &
rtp_bse_ham_ks, rtp_method_bse, rtp_method_tddft, sccs_andreussi, sccs_derivative_cd3, &
sccs_derivative_cd5, sccs_derivative_cd7, sccs_derivative_fft, sccs_fattebert_gygi, &
sic_ad, sic_eo, sic_list_all, sic_list_unpaired, sic_mauri_spz, sic_mauri_us, sic_none, &
slater, tddfpt_davidson, tddfpt_excitations, tddfpt_lanczos, tddfpt_singlet, &
tddfpt_triplet, use_mom_ref_coac, use_mom_ref_com, use_mom_ref_user, use_mom_ref_zero, &
use_restart_wfn, use_rt_restart, use_scf_wfn, weight_type_mass, weight_type_unit
USE input_cp2k_almo, ONLY: create_almo_scf_section
USE input_cp2k_as, ONLY: create_active_space_section
USE input_cp2k_ec, ONLY: create_ec_section
USE input_cp2k_exstate, ONLY: create_exstate_section
USE input_cp2k_external, ONLY: create_ext_den_section,&
create_ext_pot_section,&
create_ext_vxc_section
USE input_cp2k_field, ONLY: create_efield_section,&
create_per_efield_section
USE input_cp2k_harris, ONLY: create_harris_section
USE input_cp2k_kpoints, ONLY: create_kpoints_section
USE input_cp2k_loc, ONLY: create_localize_section
USE input_cp2k_ls, ONLY: create_ls_scf_section
USE input_cp2k_poisson, ONLY: create_poisson_section
USE input_cp2k_print_dft, ONLY: create_print_dft_section
USE input_cp2k_projection_rtp, ONLY: create_projection_rtp_section
USE input_cp2k_qs, ONLY: create_lrigpw_section,&
create_qs_section
USE input_cp2k_rsgrid, ONLY: create_rsgrid_section
USE input_cp2k_scf, ONLY: create_scf_section
USE input_cp2k_smeagol, ONLY: create_dft_smeagol_section
USE input_cp2k_transport, ONLY: create_transport_section
USE input_cp2k_xas, ONLY: create_xas_section,&
create_xas_tdp_section
USE input_cp2k_xc, ONLY: create_xc_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: dp
USE pw_spline_utils, ONLY: no_precond,&
precond_spl3_1,&
precond_spl3_2,&
precond_spl3_3,&
precond_spl3_aint,&
precond_spl3_aint2
USE string_utilities, ONLY: s2a
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_dft'
PUBLIC :: create_dft_section
PUBLIC :: create_bsse_section
PUBLIC :: create_interp_section
PUBLIC :: create_mgrid_section
CONTAINS
! **************************************************************************************************
!> \brief creates the dft section
!> \param section the section to be created
!> \author fawzi
! **************************************************************************************************
SUBROUTINE create_dft_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="DFT", &
description="Parameter needed by LCAO DFT programs", &
n_keywords=3, n_subsections=4, repeats=.FALSE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="BASIS_SET_FILE_NAME", &
description="Name of the basis set file, may include a path", &
usage="BASIS_SET_FILE_NAME <FILENAME>", &
type_of_var=lchar_t, repeats=.TRUE., &
default_lc_val="BASIS_SET", n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_FILE_NAME", &
description="Name of the pseudo potential file, may include a path", &
usage="POTENTIAL_FILE_NAME <FILENAME>", &
default_lc_val="POTENTIAL")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
variants=(/"RESTART_FILE_NAME"/), &
description="Name of the wavefunction restart file, may include a path."// &
" If no file is specified, the default is to open the file as generated by the wfn restart print key.", &
usage="WFN_RESTART_FILE_NAME <FILENAME>", &
type_of_var=lchar_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="UKS", &
variants=s2a("UNRESTRICTED_KOHN_SHAM", &
"LSD", &
"SPIN_POLARIZED"), &
description="Requests a spin-polarized calculation using alpha "// &
"and beta orbitals, i.e. no spin restriction is applied", &
usage="LSD", &
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="ROKS", &
variants=(/"RESTRICTED_OPEN_KOHN_SHAM"/), &
description="Requests a restricted open Kohn-Sham calculation", &
usage="ROKS", &
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="MULTIPLICITY", &
variants=(/"MULTIP"/), &
description="Two times the total spin plus one. "// &
"Specify 3 for a triplet, 4 for a quartet, "// &
"and so on. Default is 1 (singlet) for an "// &
"even number and 2 (doublet) for an odd number "// &
"of electrons.", &
usage="MULTIPLICITY 3", &
default_i_val=0) ! this default value is just a flag to get the above
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CHARGE", &
description="The total charge of the system", &
usage="CHARGE -1", &
default_i_val=0)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EXCITATIONS", &
description="If excitations should be calculated", &
usage="EXCITATIONS", &
enum_c_vals=s2a("NONE", "TDLR", "TDDFPT"), &
enum_i_vals=(/no_excitations, tddfpt_excitations, &
tddfpt_excitations/), &
default_i_val=no_excitations)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="PLUS_U_METHOD", &
description="Method employed for the calculation of the DFT+U contribution", &
repeats=.FALSE., &
enum_c_vals=s2a("LOWDIN", "MULLIKEN", "MULLIKEN_CHARGES"), &
enum_i_vals=(/plus_u_lowdin, plus_u_mulliken, plus_u_mulliken_charges/), &
enum_desc=s2a("Method based on Lowdin population analysis "// &
"(computationally expensive, since the diagonalization of the "// &
"overlap matrix is required, but possibly more robust than Mulliken)", &
"Method based on Mulliken population analysis using the net AO and "// &
"overlap populations (computationally cheap method)", &
"Method based on Mulliken gross orbital populations (GOP)"), &
n_var=1, &
default_i_val=plus_u_mulliken, &
usage="METHOD Lowdin")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="RELAX_MULTIPLICITY", &
variants=(/"RELAX_MULTIP"/), &
description="Tolerance in Hartrees. Do not enforce the occupation "// &
"of alpha and beta MOs due to the initially "// &
"defined multiplicity, but rather follow the Aufbau principle. "// &
"A value greater than zero activates this option. "// &
"Larger tolerance values increase the probability for a spin flip. "// &
"This option is only valid for unrestricted (i.e. spin polarised) "// &
"Kohn-Sham (UKS) calculations.", &
usage="RELAX_MULTIPLICITY 0.00001", &
repeats=.FALSE., &
default_r_val=0.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SUBCELLS", &
description="Read the grid size for subcell generation in the construction of "// &
"neighbor lists.", usage="SUBCELLS 1.5", &
n_var=1, default_r_val=2.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="AUTO_BASIS", &
description="Specify size of automatically generated auxiliary (RI) basis sets: "// &
"Options={small,medium,large,huge}", &
usage="AUTO_BASIS {basis_type} {basis_size}", &
type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=(/"X", "X"/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="SURFACE_DIPOLE_CORRECTION", &
variants=s2a("SURFACE_DIPOLE", &
"SURF_DIP"), &
description="For slab calculations with asymmetric geometries, activate the correction of "// &
"the electrostatic potential with "// &
"by compensating for the surface dipole. Implemented only for slabs with normal "// &
"parallel to one Cartesian axis. The normal direction is given by the keyword SURF_DIP_DIR", &
usage="SURF_DIP", &
default_l_val=.FALSE., &
lone_keyword_l_val=.TRUE., &
citations=(/Bengtsson1999/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="SURF_DIP_DIR", &
description="Cartesian axis parallel to surface normal.", &
enum_c_vals=s2a("X", "Y", "Z"), &
enum_i_vals=(/1, 2, 3/), &
enum_desc=s2a("Along x", "Along y", "Along z"), &
n_var=1, &
default_i_val=3, &
usage="SURF_DIP_DIR Z")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="SURF_DIP_POS", &
description="This keyword assigns an user defined position in Angstroms "// &
"in the direction normal to the surface (given by SURF_DIP_DIR). "// &
"The default value is -1.0_dp which appplies the correction at a position "// &
"that has minimum electron density on the grid.", &
usage="SURF_DIP_POS -1.0_dp", &
default_r_val=-1.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="SURF_DIP_SWITCH", &
description="WARNING: Experimental feature under development that will help the "// &
"user to switch parameters to facilitate SCF convergence. In its current form the "// &
"surface dipole correction is switched off if the calculation does not converge in "// &
"(0.5*MAX_SCF + 1) outer_scf steps. "// &
"The default value is .FALSE.", &
usage="SURF_DIP_SWITCH .TRUE.", &
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="CORE_CORR_DIP", &
description="If the total CORE_CORRECTION is non-zero and surface dipole "// &
"correction is switched on, presence of this keyword will adjust electron "// &
"density via MO occupation to reflect the total CORE_CORRECTION. "// &
"The default value is .FALSE.", &
usage="CORE_CORR_DIP .TRUE.", &
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="SORT_BASIS", &
description="Sort basis sets according to a certain criterion. ", &
enum_c_vals=s2a("DEFAULT", "EXP"), &
enum_i_vals=(/basis_sort_default, basis_sort_zet/), &
enum_desc=s2a("don't sort", "sort w.r.t. exponent"), &
default_i_val=basis_sort_default, &
usage="SORT_BASIS EXP")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL create_scf_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_ls_scf_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_almo_scf_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_kg_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_harris_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_ec_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_exstate_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_admm_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_qs_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_tddfpt_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_mgrid_section(subsection, create_subsections=.TRUE.)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_xc_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_relativistic_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_sic_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_low_spin_roks_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_efield_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_ext_pot_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_transport_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
! ZMP sections to include the external density or v_xc potential
CALL create_ext_den_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_ext_vxc_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_kpoints_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_implicit_solv_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_density_fitting_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_xas_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_xas_tdp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_localize_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_rtp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_print_dft_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_sccs_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_active_space_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_dft_smeagol_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_dft_section
! **************************************************************************************************
!> \brief Implicit Solvation Model
!> \param section ...
!> \author tlaino
! **************************************************************************************************
SUBROUTINE create_implicit_solv_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
NULLIFY (keyword, subsection, print_key)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="SCRF", &
description="Adds an implicit solvation model to the DFT calculation."// &
" Know also as Self Consistent Reaction Field.", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="EPS_OUT", &
description="Value of the dielectric constant outside the sphere", &
usage="EPS_OUT <REAL>", &
default_r_val=1.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="LMAX", &
description="Maximum value of L used in the multipole expansion", &
usage="LMAX <INTEGER>", &
default_i_val=3)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL create_sphere_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
description="Controls the printing basic info about the method", &
print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
END SUBROUTINE create_implicit_solv_section
! **************************************************************************************************
!> \brief Create Sphere cavity
!> \param section ...
!> \author tlaino
! **************************************************************************************************
SUBROUTINE create_sphere_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
NULLIFY (keyword, subsection)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="SPHERE", &
description="Treats the implicit solvent environment like a sphere", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="RADIUS", &
description="Value of the spherical cavity in the dielectric medium", &
usage="RADIUS <REAL>", &
unit_str="angstrom", &
type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL create_center_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_sphere_section
! **************************************************************************************************
!> \brief ...
!> \param section ...
!> \author tlaino
! **************************************************************************************************
SUBROUTINE create_center_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
NULLIFY (keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="CENTER", &
description="Defines the center of the sphere.", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="XYZ", &
description="Coordinates of the center of the sphere", &
usage="XYZ <REAL> <REAL> <REAL>", &
unit_str="angstrom", &
type_of_var=real_t, n_var=3)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOM_LIST", &
description="Defines a list of atoms to define the center of the sphere", &
usage="ATOM_LIST <INTEGER> .. <INTEGER>", &
type_of_var=integer_t, n_var=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="WEIGHT_TYPE", &
description="Defines the weight used to define the center of the sphere"// &
" (if ATOM_LIST is provided)", &
usage="WEIGHT (UNIT|MASS)", &
enum_c_vals=(/"UNIT", "MASS"/), &
enum_i_vals=(/weight_type_unit, weight_type_mass/), &
default_i_val=weight_type_unit)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="FIXED", &
description="Specify if the center of the sphere should be fixed or"// &
" allowed to move", &
usage="FIXED <LOGICAL>", &
default_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_center_section
! **************************************************************************************************
!> \brief ...
!> \param section ...
! **************************************************************************************************
SUBROUTINE create_admm_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
NULLIFY (keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="AUXILIARY_DENSITY_MATRIX_METHOD", &
description="Parameters needed for the ADMM method.", &
n_keywords=1, n_subsections=1, repeats=.FALSE., &
citations=(/Guidon2010/))
CALL keyword_create( &
keyword, __LOCATION__, &
name="ADMM_TYPE", &
description="Type of ADMM (sort name) as refered in literature. "// &
"This sets values for METHOD, ADMM_PURIFICATION_METHOD, and EXCH_SCALING_MODEL", &
enum_c_vals=s2a("NONE", "ADMM1", "ADMM2", "ADMMS", "ADMMP", "ADMMQ"), &
enum_desc=s2a("No short name is used, use specific definitions (default)", &
"ADMM1 method from Guidon2010", &
"ADMM2 method from Guidon2010", &
"ADMMS method from Merlot2014", &
"ADMMP method from Merlot2014", &
"ADMMQ method from Merlot2014"), &
enum_i_vals=(/no_admm_type, admm1_type, admm2_type, admms_type, admmp_type, admmq_type/), &
default_i_val=no_admm_type, &
citations=(/Guidon2010, Merlot2014/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, &
name="ADMM_PURIFICATION_METHOD", &
description="Method that shall be used for wavefunction fitting. Use MO_DIAG for MD.", &
enum_c_vals=s2a("NONE", "CAUCHY", "CAUCHY_SUBSPACE", "MO_DIAG", "MO_NO_DIAG", "MCWEENY", "NONE_DM"), &
enum_i_vals=(/do_admm_purify_none, do_admm_purify_cauchy, do_admm_purify_cauchy_subspace, &
do_admm_purify_mo_diag, do_admm_purify_mo_no_diag, &
do_admm_purify_mcweeny, do_admm_purify_none_dm/), &
enum_desc=s2a("Do not apply any purification", &
"Perform purification via general Cauchy representation", &
"Perform purification via Cauchy representation in occupied subspace", &
"Calculate MO derivatives via Cauchy representation by diagonalization", &
"Calculate MO derivatives via Cauchy representation by inversion", &
"Perform original McWeeny purification via matrix multiplications", &
"Do not apply any purification, works directly with density matrix"), &
default_i_val=do_admm_purify_mo_diag)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, &
name="METHOD", &
description="Method that shall be used for wavefunction fitting. Use BASIS_PROJECTION for MD.", &
enum_c_vals=s2a("BASIS_PROJECTION", "BLOCKED_PROJECTION_PURIFY_FULL", "BLOCKED_PROJECTION", &
"CHARGE_CONSTRAINED_PROJECTION"), &
enum_i_vals=(/do_admm_basis_projection, do_admm_blocking_purify_full, do_admm_blocked_projection, &
do_admm_charge_constrained_projection/), &
enum_desc=s2a("Construct auxiliary density matrix from auxiliary basis.", &
"Construct auxiliary density from a blocked Fock matrix,"// &
" but use the original matrix for purification.", &
"Construct auxiliary density from a blocked Fock matrix.", &
"Construct auxiliary density from auxiliary basis enforcing charge constrain."), &
default_i_val=do_admm_basis_projection)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, &
name="EXCH_SCALING_MODEL", &
description="Scaling of the exchange correction calculated by the auxiliary density matrix.", &
enum_c_vals=s2a("NONE", "MERLOT"), &
enum_i_vals=(/do_admm_exch_scaling_none, do_admm_exch_scaling_merlot/), &
enum_desc=s2a("No scaling is enabled, refers to methods ADMM1, ADMM2 or ADMMQ.", &
"Exchange scaling according to Merlot (2014)"), &
default_i_val=do_admm_exch_scaling_none)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, &
name="EXCH_CORRECTION_FUNC", &
description="Exchange functional which is used for the ADMM correction. "// &
"LibXC implementations require linking with LibXC", &
enum_c_vals=s2a("DEFAULT", "PBEX", "NONE", "OPTX", "BECKE88X", &
"PBEX_LIBXC", "BECKE88X_LIBXC", "OPTX_LIBXC", "DEFAULT_LIBXC", "LDA_X_LIBXC"), &
enum_i_vals=(/do_admm_aux_exch_func_default, do_admm_aux_exch_func_pbex, &
do_admm_aux_exch_func_none, do_admm_aux_exch_func_opt, do_admm_aux_exch_func_bee, &
do_admm_aux_exch_func_pbex_libxc, do_admm_aux_exch_func_bee_libxc, &
do_admm_aux_exch_func_opt_libxc, do_admm_aux_exch_func_default_libxc, &
do_admm_aux_exch_func_sx_libxc/), &
enum_desc=s2a("Use PBE-based corrections according to the chosen interaction operator.", &
"Use PBEX functional for exchange correction.", &
"No correction: X(D)-x(d)-> 0.", &
"Use OPTX functional for exchange correction.", &
"Use Becke88X functional for exchange correction.", &
"Use PBEX functional (LibXC implementation) for exchange correction.", &
"Use Becke88X functional (LibXC implementation) for exchange correction.", &
"Use OPTX functional (LibXC implementation) for exchange correction.", &
"Use PBE-based corrections (LibXC where possible) to the chosen interaction operator.", &
"Use Slater X functional (LibXC where possible) for exchange correction."), &
default_i_val=do_admm_aux_exch_func_default)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="optx_a1", &
description="OPTX a1 coefficient", &
default_r_val=1.05151_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="optx_a2", &
description="OPTX a2 coefficient", &
default_r_val=1.43169_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="optx_gamma", &
description="OPTX gamma coefficient", &
default_r_val=0.006_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="BLOCK_LIST", &
description="Specifies a list of atoms.", &
usage="LIST {integer} {integer} .. {integer}", &
n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
description="Define accuracy of DBCSR operations", &
usage="EPS_FILTER", default_r_val=0.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_admm_section
! **************************************************************************************************
!> \brief ...
!> \param section ...
! **************************************************************************************************
SUBROUTINE create_density_fitting_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key
NULLIFY (keyword, print_key)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="DENSITY_FITTING", &
description="Setup parameters for density fitting (Bloechl charges or density derived "// &
"atomic point charges (DDAPC) charges)", &
n_keywords=7, n_subsections=0, repeats=.FALSE., &
citations=(/Blochl1995/))
CALL keyword_create(keyword, __LOCATION__, name="NUM_GAUSS", &
description="Specifies the numbers of gaussian used to fit the QM density for each atomic site.", &
usage="NUM_GAUSS {integer}", &
n_var=1, type_of_var=integer_t, default_i_val=3)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PFACTOR", &
description="Specifies the progression factor for the gaussian exponent for each atomic site.", &
usage="PFACTOR {real}", &
n_var=1, type_of_var=real_t, default_r_val=1.5_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="MIN_RADIUS", &
description="Specifies the smallest radius of the gaussian used in the fit. All other radius are"// &
" obtained with the progression factor.", &
usage="MIN_RADIUS {real}", &
unit_str="angstrom", n_var=1, type_of_var=real_t, default_r_val=0.5_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RADII", &
description="Specifies all the radius of the gaussian used in the fit for each atomic site. The use"// &
" of this keyword disables all other keywords of this section.", &
usage="RADII {real} {real} .. {real}", &
unit_str="angstrom", n_var=-1, type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GCUT", &
description="Cutoff for charge fit in G-space.", &
usage="GCUT {real}", &
n_var=1, type_of_var=real_t, default_r_val=SQRT(6.0_dp))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
description="Controls the printing of basic information during the run", &
print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="CONDITION_NUMBER", &
description="Prints information regarding the condition numbers of the A matrix (to be inverted)", &
usage="ANALYTICAL_GTERM <LOGICAL>", &
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_density_fitting_section
! **************************************************************************************************
!> \brief creates the input section for the tddfpt part
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_tddfpt_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="tddfpt", &
description="Old TDDFPT code. Use new version in CP2K_INPUT / FORCE_EVAL / PROPERTIES / TDDFPT", &
n_keywords=5, n_subsections=1, repeats=.FALSE., &
citations=(/Iannuzzi2005/))
NULLIFY (subsection, keyword)
! Integer
CALL keyword_create(keyword, __LOCATION__, name="MAX_KV", &
variants=s2a("MAX_VECTORS"), &
description=" maximal number of Krylov space vectors", &
usage="MAX_KV someInteger>0", &
n_var=1, type_of_var=integer_t, &
default_i_val=60)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RESTARTS", &
variants=s2a("N_RESTARTS"), &
description=" maximal number subspace search restarts", &
usage="RESTARTS someInteger>0", &
n_var=1, type_of_var=integer_t, &
default_i_val=5)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NEV", &
variants=s2a("N_EV", "EV"), &
description=" number of excitations to calculate", &
usage="NEV someInteger>0", &
n_var=1, type_of_var=integer_t, &
default_i_val=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NLUMO", &
description=" number of additional unoccupied orbitals ", &
usage="NLUMO 10", &
n_var=1, type_of_var=integer_t, &
default_i_val=5)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NREORTHO", &
variants=s2a("N_REORTHO", "REORTHO", "REORTHOGONALITAZIONS"), &
description=" number of reorthogonalization steps", &
usage="NREORTHO someInteger>0", &
n_var=1, type_of_var=integer_t, &
default_i_val=2)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Logical
CALL keyword_create(keyword, __LOCATION__, name="KERNEL", &
variants=s2a("DO_KERNEL"), &
description="compute the kernel (debug purpose only)", &
usage="KERNEL logical_value", &
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="LSD_SINGLETS", &
description="compute singlets using lsd vxc kernel", &
usage="LSD_SINGLETS logical_value", &
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="INVERT_S", &
variants=s2a("INVERT_OVERLAP"), &
description="use the inverse of the overlap matrix", &
usage="INVERT_S logical_value", &
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="PRECONDITIONER", &
variants=s2a("PRECOND"), &
description="use the preconditioner (only for Davidson)", &
usage="PRECONDITIONER logical_value", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Character
CALL keyword_create(keyword, __LOCATION__, name="RES_ETYPE", &
variants=s2a("RESTRICTED_EXCITATIONS_TYPE", "RES_E_TYPE"), &
description="(singlets/triplets) for restricted calculation", &
usage="RES_ETYPE T", &
enum_c_vals=s2a("S", "SINGLET", "SINGLETS", "T", "TRIPLET", "TRIPLETS"), &
enum_i_vals=(/tddfpt_singlet, tddfpt_singlet, tddfpt_singlet, &
tddfpt_triplet, tddfpt_triplet, tddfpt_triplet/), &
default_i_val=tddfpt_singlet)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DIAG_METHOD", &
variants=s2a("DIAGONALIZATION_METHOD", "METHOD"), &
description="Diagonalization method used in tddfpt", &
usage="DIAG_METHOD DAVIDSON", &
enum_c_vals=s2a("DAVIDSON", "LANCZOS"), &
enum_i_vals=(/tddfpt_davidson, tddfpt_lanczos/), &
default_i_val=tddfpt_davidson)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="OE_CORR", &
variants=s2a("ORBITAL_EIGENVALUES_CORRECTION"), &
description="Which type of orbital eigenvalue correction to use "// &
"(to yield better HOMO-LUMO energies)", &
usage="OE_CORR SAOP", &
enum_c_vals=s2a("NONE", "LB", "LB_ALPHA", "LB94", "GLLB", "GLB", "SAOP", "SIC"), &
enum_i_vals=(/oe_none, oe_lb, oe_lb, oe_lb, oe_gllb, oe_gllb, oe_saop, oe_sic/), &
default_i_val=oe_none)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! Real
CALL keyword_create(keyword, __LOCATION__, name="CONVERGENCE", &
variants=s2a("CONV"), &
description="The convergence of the eigenvalues", &
usage="CONVERGENCE 1.0E-6 ", &
n_var=1, type_of_var=real_t, &
default_r_val=1.0e-5_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL create_xc_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_sic_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_tddfpt_section
! **************************************************************************************************
!> \brief creates the input section for the relativistic part
!> \param section the section to create
!> \author jens
! **************************************************************************************************
SUBROUTINE create_relativistic_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="relativistic", &
description="parameters needed and setup for relativistic calculations", &
n_keywords=5, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="method", &
description="type of relativistic correction used", &
usage="method (NONE|DKH|ZORA)", default_i_val=rel_none, &
enum_c_vals=s2a("NONE", "DKH", "ZORA"), &
enum_i_vals=(/rel_none, rel_dkh, rel_zora/), &
enum_desc=s2a("Use no relativistic correction", &
"Use Douglas-Kroll-Hess method", &
"Use ZORA method"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DKH_order", &
description="The order of the DKH transformation ", &
usage="DKH_order 2", default_i_val=2)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ZORA_type", &
description="Type of ZORA method to be used", &
usage="ZORA_type scMP", default_i_val=rel_zora_full, &
enum_c_vals=s2a("FULL", "MP", "scMP"), &
enum_desc=s2a("Full ZORA method (not implemented)", &
"ZORA with atomic model potential", &
"Scaled ZORA with atomic model potential"), &
enum_i_vals=(/rel_zora_full, rel_zora_mp, rel_sczora_mp/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="transformation", &
description="Type of DKH transformation", &
usage="transformation (FULL|MOLECULE|ATOM)", default_i_val=rel_trans_atom, &
enum_c_vals=s2a("FULL", "MOLECULE", "ATOM"), &
enum_i_vals=(/rel_trans_full, rel_trans_molecule, rel_trans_atom/), &
enum_desc=s2a("Use full matrix transformation", &
"Use transformation blocked by molecule", &
"Use atomic blocks"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)