-
Notifications
You must be signed in to change notification settings - Fork 1
/
input_cp2k_atom.F
1218 lines (1056 loc) · 65.5 KB
/
input_cp2k_atom.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 builds the input structure for the ATOM module
!> \author jgh
! **************************************************************************************************
MODULE input_cp2k_atom
USE cp_output_handling, ONLY: cp_print_key_section_create,&
debug_print_level,&
high_print_level,&
medium_print_level,&
silent_print_level
USE input_constants, ONLY: &
atom_basis_run, atom_energy_run, atom_no_run, atom_pseudo_run, barrier_conf, &
contracted_gto, do_analytic, do_dkh0_atom, do_dkh1_atom, do_dkh2_atom, do_dkh3_atom, &
do_gapw_gcs, do_gapw_gct, do_gapw_log, do_nonrel_atom, do_numeric, do_rhf_atom, &
do_rks_atom, do_rohf_atom, do_sczoramp_atom, do_semi_analytic, do_uhf_atom, do_uks_atom, &
do_zoramp_atom, ecp_pseudo, gaussian, geometrical_gto, gth_pseudo, no_conf, no_pseudo, &
numerical, poly_conf, sgp_pseudo, slater, upf_pseudo
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,&
logical_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 = .TRUE.
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_atom'
PUBLIC :: create_atom_section
! **************************************************************************************************
CONTAINS
! **************************************************************************************************
!> \brief Creates the input section for the atom code
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_atom_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="ATOM", &
description="Section handling input for atomic calculations.", &
n_keywords=1, n_subsections=1, repeats=.FALSE.)
NULLIFY (keyword, subsection)
CALL keyword_create(keyword, __LOCATION__, name="ATOMIC_NUMBER", &
description="Specify the atomic number", &
default_i_val=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ELEMENT", &
description="Specify the element to be calculated", &
usage="ELEMENT char", n_var=1, type_of_var=char_t, &
default_c_val="H")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RUN_TYPE", &
description="Type of run that you want to perform "// &
"[ENERGY,BASIS_OPTIMIZATION,PSEUDOPOTENTIAL_OPTIMIZATION,,...] ", &
usage="RUN_TYPE (NONE|ENERGY|BASIS_OPTIMIZATION|PSEUDOPOTENTIAL_OPTIMIZATION)", &
default_i_val=atom_energy_run, &
enum_c_vals=s2a("NONE", "ENERGY", "BASIS_OPTIMIZATION", "PSEUDOPOTENTIAL_OPTIMIZATION"), &
enum_i_vals=(/atom_no_run, atom_energy_run, atom_basis_run, atom_pseudo_run/), &
enum_desc=s2a("Perform no run", &
"Perform energy optimization", &
"Perform basis optimization", &
"Perform pseudopotential optimization"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COULOMB_INTEGRALS", &
description="Method to calculate Coulomb integrals", &
usage="COULOMB_INTEGRALS (ANALYTIC|SEMI_ANALYTIC|NUMERIC)", &
default_i_val=do_numeric, &
enum_c_vals=(/"ANALYTIC ", &
"SEMI_ANALYTIC ", &
"NUMERIC "/), &
enum_i_vals=(/do_analytic, do_semi_analytic, do_numeric/), &
enum_desc=s2a("Use analytical method", &
"Use semi-analytical method", &
"Use numerical method"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EXCHANGE_INTEGRALS", &
description="Method to calculate Exchange integrals", &
usage="EXCHANGE_INTEGRALS (ANALYTIC|SEMI_ANALYTIC|NUMERIC)", &
default_i_val=do_numeric, &
enum_c_vals=(/"ANALYTIC ", &
"SEMI_ANALYTIC ", &
"NUMERIC "/), &
enum_i_vals=(/do_analytic, do_semi_analytic, do_numeric/), &
enum_desc=s2a("Use analytical method. Not available for longrange Hartree-Fock", &
"Use semi-analytical method", &
"Use numerical method"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CORE", &
description="Specifies the core electrons for a pseudopotential", &
usage="CORE 1s2 ... or CORE [Ne] or CORE none for 0 electron cores", repeats=.FALSE., &
n_var=-1, type_of_var=char_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ELECTRON_CONFIGURATION", &
description="Specifies the electron configuration. "// &
"Optional the multiplicity (m) and a core state [XX] can be declared", &
usage="ELECTRON_CONFIGURATION (1) [Ne] 3s2 ... ", 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="MAX_ANGULAR_MOMENTUM", &
description="Specifies the largest angular momentum calculated [0-3]", &
usage="MAX_ANGULAR_MOMENTUM 3", repeats=.FALSE., &
default_i_val=3)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CALCULATE_STATES", &
description="Specifies the number of states calculated per l value", &
usage="CALCULATE_STATES 5 5 5 3 ", repeats=.FALSE., &
default_i_val=0, n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="USE_GAUSS_HERMITE", &
description="Whether a Gauss-Hermite grid is to be used for the numerical integration of "// &
"longrange exchange integrals", &
usage="USE_GAUSS_HERMITE TRUE", repeats=.FALSE., &
default_l_val=.FALSE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GRID_POINTS_GH", &
description="Number of grid points for Gauss-Hermite grid", &
usage="GRID_POINTS_GH 100", repeats=.FALSE., &
default_i_val=100)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL create_atom_print_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_atom_aebasis_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_atom_ppbasis_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_atom_method_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_optimization_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_potential_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_powell_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_atom_section
! **************************************************************************************************
!> \brief Create the print atom section
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_atom_print_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="print", &
description="Section of possible print options specific of the ATOM code.", &
n_keywords=0, n_subsections=1, repeats=.FALSE.)
NULLIFY (print_key, keyword)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_BANNER", &
description="Controls the printing of the banner of the ATOM program", &
print_level=silent_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "METHOD_INFO", &
description="Controls the printing of method information", &
print_level=medium_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "BASIS_SET", &
description="Controls the printing of the basis sets", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "POTENTIAL", &
description="Controls the printing of the potentials", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create( &
print_key, __LOCATION__, "FIT_DENSITY", &
description="Fit the total electronic density to a linear combination of Gaussian functions", &
print_level=high_print_level, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="NUM_GTO", &
description="Number of Gaussian type functions for density fit", &
usage="NUM_GTO integer ", type_of_var=integer_t, &
default_i_val=40)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "FIT_KGPOT", &
description="Fit an approximation to the non-additive"// &
" kinetic energy potential used in KG", &
print_level=high_print_level, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="NUM_GAUSSIAN", &
description="Number of Gaussian terms for the fit", &
usage="NUM_GAUSSIAN integer ", type_of_var=integer_t, &
default_i_val=1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NUM_POLYNOM", &
description="Number of terms in the polynomial expansion", &
usage="NUM_POLYNOM integer ", type_of_var=integer_t, &
default_i_val=4)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_BASIS", &
description="Calculate a response basis set contraction scheme", &
print_level=high_print_level, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="DELTA_CHARGE", &
description="Variation of charge used in finite difference calculation", &
usage="DELTA_CHARGE real ", type_of_var=real_t, &
default_r_val=0.05_dp)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DERIVATIVES", &
description="Number of wavefunction derivatives to calculate", &
usage="DERIVATIVES integer ", type_of_var=integer_t, &
default_i_val=2)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "GEOMETRICAL_RESPONSE_BASIS", &
description="Calculate a response basis set based on a set of geometrical exponents", &
print_level=high_print_level, filename="__STD_OUT__")
!
CALL keyword_create(keyword, __LOCATION__, name="DELTA_CHARGE", &
description="Variation of charge used in finite difference calculation", &
usage="DELTA_CHARGE real ", type_of_var=real_t, &
default_r_val=0.05_dp)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
!
CALL keyword_create(keyword, __LOCATION__, name="DERIVATIVES", &
description="Number of wavefunction derivatives to calculate", &
usage="DERIVATIVES integer ", type_of_var=integer_t, &
default_i_val=3)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
!
CALL keyword_create(keyword, __LOCATION__, name="QUADRATURE", &
description="Algorithm to construct the atomic radial grids", &
usage="QUADRATURE (GC_SIMPLE|GC_TRANSFORMED|GC_LOG)", &
enum_c_vals=s2a("GC_SIMPLE", "GC_TRANSFORMED", "GC_LOG"), &
enum_i_vals=(/do_gapw_gcs, do_gapw_gct, do_gapw_log/), &
enum_desc=s2a("Gauss-Chebyshev quadrature", &
"Transformed Gauss-Chebyshev quadrature", &
"Logarithmic transformed Gauss-Chebyshev quadrature"), &
default_i_val=do_gapw_log)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
!
CALL keyword_create(keyword, __LOCATION__, name="GRID_POINTS", &
description="Number of radial grid points", &
usage="GRID_POINTS integer", &
default_i_val=400)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
!
CALL keyword_create(keyword, __LOCATION__, name="NUM_GTO_CORE", &
description="Number of Gaussian type functions for s, p, d, ... "// &
"for the main body of the basis", &
usage="NUM_GTO 6 ", n_var=1, type_of_var=integer_t, &
default_i_val=-1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NUM_GTO_EXTENDED", &
description="Number of Gaussian type functions for s, p, d, ... "// &
"for the extension set", &
usage="NUM_GTO 4 ", n_var=1, type_of_var=integer_t, &
default_i_val=-1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NUM_GTO_POLARIZATION", &
description="Number of Gaussian type functions for the polarization set", &
usage="NUM_GTO 4 ", n_var=1, type_of_var=integer_t, &
default_i_val=-1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EXTENSION_BASIS", &
description="Number of basis functions for s, p, d, ... "// &
"for the extension set", &
usage="EXTENSION_BASIS 4 3 2 1 ", n_var=-1, type_of_var=integer_t, &
default_i_val=-1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GEOMETRICAL_FACTOR", &
description="Geometrical basis: factor C in a*C^k (initial value for optimization)", &
usage="GEOMETRICAL_FACTOR real", &
default_r_val=2.3_dp)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GEO_START_VALUE", &
description="Geometrical basis: starting value a in a*C^k (initial value for optimization)", &
usage="GEO_START_VALUE real", &
default_r_val=0.06_dp)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CONFINEMENT", &
description="Onset value of barrier confinement potential [Bohr]", &
usage="CONFINEMENT real", &
default_r_val=8.00_dp)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NAME_BODY", &
description="Specifies the body of the basis set name ", &
usage="NAME_BODY <char>", &
type_of_var=char_t, default_c_val="GRB", n_var=-1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
!
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "SCF_INFO", &
description="Controls the printing of SCF information", &
print_level=medium_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "ORBITALS", &
description="Controls the printing of the optimized orbitals information", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "ANALYZE_BASIS", &
description="Calculates some basis set analysis data", &
print_level=high_print_level, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="OVERLAP_CONDITION_NUMBER", &
description="Condition number of the basis set overlap matrix calculated for a cubic crystal", &
usage="OVERLAP_CONDITION_NUMBER <logical>", type_of_var=logical_t, default_l_val=.FALSE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COMPLETENESS", &
description="Calculate a completeness estimate for the basis set.", &
usage="COMPLETENESS <logical>", type_of_var=logical_t, default_l_val=.FALSE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "FIT_PSEUDO", &
description="Controls the printing of FIT PSEUDO task", &
print_level=medium_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "FIT_BASIS", &
description="Controls the printing of FIT BASIS task", &
print_level=medium_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "UPF_FILE", &
description="Write GTH pseudopotential in UPF format", &
print_level=high_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section
CALL cp_print_key_section_create(print_key, __LOCATION__, "SEPARABLE_GAUSSIAN_PSEUDO", &
description="Creates a representation of the pseudopotential in separable "// &
"form using Gaussian functions.", &
print_level=debug_print_level, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
! Print key section: ADMM Analysis
CALL cp_print_key_section_create(print_key, __LOCATION__, "ADMM", &
description="Analysis of ADMM approximation to exact exchange", &
print_level=high_print_level, filename="__STD_OUT__")
NULLIFY (subsection)
CALL section_create(subsection, __LOCATION__, name="ADMM_BASIS", &
description="Section of basis set information for ADMM calculations.", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
CALL atom_basis_section(subsection)
CALL section_add_subsection(print_key, subsection)
CALL section_release(subsection)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
END SUBROUTINE create_atom_print_section
! **************************************************************************************************
!> \brief Create the all-electron basis section
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_atom_aebasis_section(section)
TYPE(section_type), POINTER :: section
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="AE_BASIS", &
description="Section of basis set information for all-electron calculations.", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
CALL atom_basis_section(section)
END SUBROUTINE create_atom_aebasis_section
! **************************************************************************************************
!> \brief Create the pseudopotential basis section
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_atom_ppbasis_section(section)
TYPE(section_type), POINTER :: section
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="PP_BASIS", &
description="Section of basis set information for pseudopotential calculations.", &
n_keywords=0, n_subsections=0, repeats=.FALSE.)
CALL atom_basis_section(section)
END SUBROUTINE create_atom_ppbasis_section
! **************************************************************************************************
!> \brief Keywords in the atom basis section
!> \param section the section to fill
!> \author jgh
! **************************************************************************************************
SUBROUTINE atom_basis_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
CPASSERT(ASSOCIATED(section))
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="BASIS_TYPE", &
description="Basis set type", &
usage="BASIS_TYPE (GAUSSIAN|GEOMETRICAL_GTO|CONTRACTED_GTO|SLATER|NUMERICAL)", &
default_i_val=gaussian, &
enum_c_vals=(/"GAUSSIAN ", &
"GEOMETRICAL_GTO ", &
"CONTRACTED_GTO ", &
"SLATER ", &
"NUMERICAL "/), &
enum_i_vals=(/gaussian, geometrical_gto, contracted_gto, slater, numerical/), &
enum_desc=s2a("Gaussian type orbitals", &
"Geometrical Gaussian type orbitals", &
"Contracted Gaussian type orbitals", &
"Slater-type orbitals", &
"Numerical basis type"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NUM_GTO", &
description="Number of Gaussian type functions for s, p, d, ...", &
usage="NUM_GTO 5 5 5 ", 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="NUM_SLATER", &
description="Number of Slater type functions for s, p, d, ...", &
usage="NUM_SLATER 5 5 5 ", 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="START_INDEX", &
description="Starting index for Geometrical Basis sets", &
usage="START_INDEX 0 2 5 4 ", n_var=-1, type_of_var=integer_t, &
default_i_val=0)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="S_EXPONENTS", &
description="Exponents for s functions", &
usage="S_EXPONENTS 1.0 2.0 ... ", n_var=-1, type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="P_EXPONENTS", &
description="Exponents for p functions", &
usage="P_EXPONENTS 1.0 2.0 ... ", n_var=-1, type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="D_EXPONENTS", &
description="Exponents for d functions", &
usage="D_EXPONENTS 1.0 2.0 ... ", n_var=-1, type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="F_EXPONENTS", &
description="Exponents for f functions", &
usage="F_EXPONENTS 1.0 2.0 ... ", n_var=-1, type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="S_QUANTUM_NUMBERS", &
description="Main quantum numbers for s functions", &
usage="S_QUANTUM_NUMBERS 1 2 ... ", n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="P_QUANTUM_NUMBERS", &
description="Main quantum numbers for p functions", &
usage="P_QUANTUM_NUMBERS 2 3 ... ", n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="D_QUANTUM_NUMBERS", &
description="Main quantum numbers for d functions", &
usage="D_QUANTUM_NUMBERS 3 4 ... ", n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="F_QUANTUM_NUMBERS", &
description="Main quantum numbers for f functions", &
usage="F_QUANTUM_NUMBERS 4 5 ... ", n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GEOMETRICAL_FACTOR", &
description="Geometrical basis: factor C in a*C^k", &
usage="GEOMETRICAL_FACTOR real", &
default_r_val=2.6_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GEO_START_VALUE", &
description="Geometrical basis: starting value a in a*C^k", &
usage="GEO_START_VALUE real", &
default_r_val=0.016_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(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>", &
default_lc_val="BASIS_SET")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="BASIS_SET", &
variants=s2a("ORBITAL_BASIS_SET", "ORB_BASIS"), &
description="The contracted Gaussian basis set", &
usage="BASIS_SET DZVP", default_c_val=" ", &
n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="QUADRATURE", &
description="Algorithm to construct the atomic radial grids", &
usage="QUADRATURE (GC_SIMPLE|GC_TRANSFORMED|GC_LOG)", &
enum_c_vals=s2a("GC_SIMPLE", "GC_TRANSFORMED", "GC_LOG"), &
enum_i_vals=(/do_gapw_gcs, do_gapw_gct, do_gapw_log/), &
enum_desc=s2a("Gauss-Chebyshev quadrature", &
"Transformed Gauss-Chebyshev quadrature", &
"Logarithmic transformed Gauss-Chebyshev quadrature"), &
default_i_val=do_gapw_log)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GRID_POINTS", &
description="Number of radial grid points", &
usage="GRID_POINTS integer", &
default_i_val=400)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EPS_EIGENVALUE", &
description="Cutoff of overlap matrix eigenvalues included into basis", &
usage="EPS_EIGENVALUE real", &
default_r_val=1.e-12_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL create_basis_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE atom_basis_section
! **************************************************************************************************
!> \brief Create the method section for Atom calculations
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_atom_method_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
NULLIFY (subsection, keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="METHOD", &
description="Section of information on method to use.", &
n_keywords=0, n_subsections=2, repeats=.TRUE.)
CALL keyword_create(keyword, __LOCATION__, name="METHOD_TYPE", &
description="Type of electronic structure method to be used", &
usage="METHOD_TYPE (KOHN-SHAM|RKS|UKS|HARTREE-FOCK|RHF|UHF|ROHF)", &
default_i_val=do_rks_atom, &
enum_c_vals=(/"KOHN-SHAM ", &
"RKS ", &
"UKS ", &
"HARTREE-FOCK ", &
"RHF ", &
"UHF ", &
"ROHF "/), &
enum_i_vals=(/do_rks_atom, do_rks_atom, do_uks_atom, do_rhf_atom, &
do_rhf_atom, do_uhf_atom, do_rohf_atom/), &
enum_desc=s2a("Kohn-Sham electronic structure method", &
"Restricted Kohn-Sham electronic structure method", &
"Unrestricted Kohn-Sham electronic structure method", &
"Hartree-Fock electronic structure method", &
"Restricted Hartree-Fock electronic structure method", &
"Unrestricted Hartree-Fock electronic structure method", &
"Restricted open-shell Hartree-Fock electronic structure method"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RELATIVISTIC", &
description="Type of scalar relativistic method to be used", &
usage="RELATIVISTIC (OFF|ZORA(MP)|scZORA(MP)|DKH(0)|DKH(1)|DKH(2)|DKH(3))", &
default_i_val=do_nonrel_atom, &
enum_c_vals=(/"OFF ", &
"ZORA(MP) ", &
"scZORA(MP) ", &
"DKH(0) ", &
"DKH(1) ", &
"DKH(2) ", &
"DKH(3) "/), &
enum_i_vals=(/do_nonrel_atom, do_zoramp_atom, do_sczoramp_atom, do_dkh0_atom, &
do_dkh1_atom, do_dkh2_atom, do_dkh3_atom/), &
enum_desc=s2a("Use no scalar relativistic method", &
"Use ZORA method with atomic model potential", &
"Use scaled ZORA method with atomic model potential", &
"Use Douglas-Kroll-Hess Hamiltonian of order 0", &
"Use Douglas-Kroll-Hess Hamiltonian of order 1", &
"Use Douglas-Kroll-Hess Hamiltonian of order 2", &
"Use Douglas-Kroll-Hess Hamiltonian of order 3"))
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)
! ZMP creating zubsection for the zmp calculations
CALL create_zmp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_external_vxc(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_atom_method_section
! **************************************************************************************************
!> \brief Create the ZMP subsection for Atom calculations
!>
!> \param section ...
!> \author D. Varsano [[email protected]]
! **************************************************************************************************
SUBROUTINE create_zmp_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
NULLIFY (subsection, keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="ZMP", &
description="Section used to specify ZMP Potentials.", &
n_keywords=3, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="FILE_DENSITY", &
description="Specifies the filename containing the target density ", &
usage="FILE_DENSITY <FILENAME>", &
type_of_var=char_t, default_c_val="RHO_O.dat", n_var=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GRID_TOL", &
description="Tolerance in the equivalence of read-grid in ZMP method", &
usage="GRID_TOL <REAL>", default_r_val=1.E-12_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
description="Parameter used for the constraint in ZMP method", &
usage="LAMBDA <REAL>", default_r_val=10.0_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DM", &
description="read external density from density matrix", &
usage="DM <LOGICAL>", type_of_var=logical_t, default_l_val=.FALSE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL create_zmp_restart_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_zmp_section
! **************************************************************************************************
!> \brief Create the ZMP restart subsection for Atom calculations
!>
!> \param section ...
!> \author D. Varsano [[email protected]]
! **************************************************************************************************
SUBROUTINE create_zmp_restart_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
NULLIFY (keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="RESTART", &
description="Section used to specify the restart option in the ZMP "// &
"procedure, and the file that must be read.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="FILE_RESTART", &
description="Specifies the filename containing the restart file density ", &
usage="FILE_RESTART <FILENAME>", &
type_of_var=char_t, default_c_val="RESTART.wfn", n_var=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_zmp_restart_section
! **************************************************************************************************
!> \brief Subroutine to create the external v_xc potential
!>
!> \param section ...
!> \author D. Varsano [[email protected]]
! **************************************************************************************************
SUBROUTINE create_external_vxc(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
NULLIFY (keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="EXTERNAL_VXC", &
description="Section used to specify exernal VXC Potentials.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="FILE_VXC", &
description="Specifies the filename containing the external vxc ", &
usage="FILE_VXC <FILENAME>", &
type_of_var=char_t, default_c_val="VXC.dat", n_var=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GRID_TOL", &
description="Tolerance in the equivalence of read-grid in ZMP method", &
usage="GRID_TOL <REAL>", default_r_val=1.E-12_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_external_vxc
! **************************************************************************************************
!> \brief Create the optimization section for Atom calculations
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_optimization_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
NULLIFY (keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="OPTIMIZATION", &
description="Section of information on optimization thresholds and algorithms.", &
n_keywords=0, n_subsections=1, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
description="Maximum number of iterations for optimization", &
usage="MAX_ITER 50", default_i_val=200)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EPS_SCF", &
description="Convergence criterion for SCF", &
usage="EPS_SCF 1.e-10", default_r_val=1.e-6_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DAMPING", &
description="Damping parameter for extrapolation method", &
usage="DAMPING 0.4", default_r_val=0.4_dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EPS_DIIS", &
description="Starting DIIS method at convergence to EPS_DIIS", &
usage="EPS_DIIS 0.01", default_r_val=10000._dp)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="N_DIIS", &
description="Maximum number of DIIS vectors", &
usage="N_DIIS 6", default_i_val=5)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_optimization_section
! **************************************************************************************************
!> \brief Create the potential section for Atom calculations
!> \param section the section to create
!> \author jgh
! **************************************************************************************************
SUBROUTINE create_potential_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
NULLIFY (keyword)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="POTENTIAL", &
description="Section of information on potential.", &
n_keywords=0, n_subsections=1, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="CONFINEMENT_TYPE", &
description="Define functional form of confinement potential.", &
usage="CONFINEMENT_TYPE (NONE|POLYNOM|BARRIER)", &
default_i_val=poly_conf, &
enum_c_vals=(/"NONE ", &
"POLYNOM ", &
"BARRIER "/), &
enum_i_vals=(/no_conf, poly_conf, barrier_conf/), &
enum_desc=s2a("Do not use confinement potential", &
"Use polynomial confinement potential: a*(R/b)^c", &
"Use a smooth barrier potential: a*F[R-c)/b]"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CONFINEMENT", &
description="Definition of parameters for confinement potential (a,b,c)", &
usage="CONFINEMENT prefactor range exponent (POLYNOM) "// &
"CONFINEMENT prefactor range r_onset (BARRIER)", &
default_r_vals=(/0._dp, 0._dp, 0._dp/), &
repeats=.FALSE., n_var=-1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PSEUDO_TYPE", &
description="Pseudopotential type", &
usage="PSEUDO_TYPE (NONE|GTH|UPF|ECP)", &
default_i_val=no_pseudo, &
enum_c_vals=(/"NONE ", &
"GTH ", &
"UPF ", &
"SGP ", &
"ECP "/), &
enum_i_vals=(/no_pseudo, gth_pseudo, upf_pseudo, sgp_pseudo, ecp_pseudo/), &
enum_desc=s2a("Do not use pseudopotentials", &
"Use Goedecker-Teter-Hutter pseudopotentials", &
"Use UPF norm-conserving pseudopotentials", &
"Use SGP norm-conserving pseudopotentials", &
"Use ECP semi-local pseudopotentials"))
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="POTENTIAL_NAME", &
variants=(/"POT_NAME"/), &
description="The name of the pseudopotential for the defined kind.", &
usage="POTENTIAL_NAME <PSEUDO-POTENTIAL-NAME>", default_c_val=" ", n_var=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL create_gthpotential_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
NULLIFY (subsection)
CALL create_ecp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_potential_section
! **************************************************************************************************
!> \brief Creates the >H_POTENTIAL section
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_gthpotential_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CALL section_create(section, __LOCATION__, name="GTH_POTENTIAL", &
description="Section used to specify Potentials.", &
n_keywords=1, n_subsections=0, repeats=.FALSE.)
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
description="CP2K Pseudo Potential Standard Format (GTH, ALL or KG)", &
repeats=.TRUE., type_of_var=lchar_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_gthpotential_section
! **************************************************************************************************