-
Notifications
You must be signed in to change notification settings - Fork 1
/
input_cp2k_properties_dft.F
2415 lines (2070 loc) · 130 KB
/
input_cp2k_properties_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
!> 01.2013 moved out of input_cp2k_dft [MI]
!> \author MI
! **************************************************************************************************
MODULE input_cp2k_properties_dft
USE bibliography, ONLY: Futera2017, &
Iannuzzi2005, &
Kondov2007, &
Luber2014, &
Putrino2000, &
Putrino2002, &
Sebastiani2001, &
Weber2009
USE cp_output_handling, ONLY: add_last_numeric, &
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 input_constants, ONLY: &
current_gauge_atom, current_gauge_r, current_gauge_r_and_step_func, &
current_orb_center_atom, current_orb_center_box, current_orb_center_common, &
current_orb_center_wannier, do_et_ddapc, do_full_density, do_no_et, do_spin_density, &
gto_cartesian, gto_spherical, int_ldos_none, int_ldos_x, int_ldos_y, int_ldos_z, oe_gllb, &
oe_lb, oe_none, oe_saop, oe_shift, ot_precond_full_all, ot_precond_full_kinetic, &
ot_precond_full_single, ot_precond_full_single_inverse, ot_precond_none, &
ot_precond_s_inverse, scan_x, scan_xy, scan_xyz, scan_xz, scan_y, scan_yz, scan_z, &
tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity, tddfpt_kernel_full, &
tddfpt_kernel_none, tddfpt_kernel_stda, use_mom_ref_coac, use_mom_ref_com, &
use_mom_ref_user, use_mom_ref_zero
USE input_cp2k_atprop, ONLY: create_atprop_section
USE input_cp2k_dft, ONLY: create_interp_section, &
create_mgrid_section
USE input_cp2k_qs, ONLY: create_ddapc_restraint_section, &
create_lrigpw_section
USE input_cp2k_kpoints, ONLY: create_kpoint_set_section
USE input_cp2k_loc, ONLY: create_localize_section
USE input_cp2k_resp, ONLY: create_resp_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, &
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_properties_dft'
PUBLIC :: create_properties_section
CONTAINS
! **************************************************************************************************
!> \brief Create the PROPERTIES section
!> \param section the section to create
!> \author teo
! **************************************************************************************************
SUBROUTINE create_properties_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="PROPERTIES", &
description="This section is used to set up the PROPERTIES calculation.", &
n_keywords=0, n_subsections=6, repeats=.FALSE.)
NULLIFY (subsection, keyword)
CALL create_linres_section(subsection, create_subsections=.TRUE.)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_et_coupling_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_resp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_atprop_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL cp_print_key_section_create(subsection, __LOCATION__, name="FIT_CHARGE", &
description="This section is used to print the density derived atomic point charges. "// &
"The fit of the charges is controlled through the DENSITY_FITTING section", &
print_level=high_print_level, filename="__STD_OUT__")
CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
description="Specifies the type of density used for the fitting", &
usage="TYPE_OF_DENSITY (FULL|SPIN)", &
enum_c_vals=s2a("FULL", "SPIN"), &
enum_i_vals=(/do_full_density, do_spin_density/), &
enum_desc=s2a("Full density", "Spin density"), &
default_i_val=do_full_density)
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_tddfpt2_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_bandstructure_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_tipscan_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_properties_section
! **************************************************************************************************
!> \brief creates the input structure used to activate
!> a linear response calculation
!> Available properties : none
!> \param section the section to create
!> \param create_subsections indicates whether or not subsections should be created
!> \param default_set_tdlr default parameters to be used if called from TDDFPT
!> \author MI
! **************************************************************************************************
SUBROUTINE create_linres_section(section, create_subsections, default_set_tdlr)
TYPE(section_type), POINTER :: section
LOGICAL, INTENT(in) :: create_subsections
LOGICAL, INTENT(IN), OPTIONAL :: default_set_tdlr
INTEGER :: def_max_iter, def_precond
REAL(KIND=DP) :: def_egap, def_eps, def_eps_filter
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
NULLIFY (keyword, print_key)
IF (PRESENT(default_set_tdlr)) THEN
def_egap = 0.02_dp
def_eps = 1.0e-10_dp
def_eps_filter = 1.0e-15_dp
def_max_iter = 100
def_precond = ot_precond_full_single_inverse
ELSE
def_egap = 0.2_dp
def_eps = 1.e-6_dp
def_eps_filter = 0.0_dp
def_max_iter = 50
def_precond = ot_precond_none
END IF
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="linres", &
description="The linear response is used to calculate one of the "// &
"following properties: nmr, epr, raman, ... ", &
n_keywords=5, n_subsections=2, repeats=.FALSE., &
citations=(/Putrino2000/))
CALL keyword_create(keyword, __LOCATION__, name="EPS", &
description="target accuracy for the convergence of the conjugate gradient.", &
usage="EPS 1.e-6", default_r_val=def_eps)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
description="Filter threshold for response density matrix.", &
usage="EPS 1.e-8", default_r_val=def_eps_filter)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
description="Maximum number of conjugate gradient iteration to be performed for one optimization.", &
usage="MAX_ITER 200", default_i_val=def_max_iter)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RESTART_EVERY", &
description="Restart the conjugate gradient after the specified number of iterations.", &
usage="RESTART_EVERY 200", default_i_val=50)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create( &
keyword, __LOCATION__, name="PRECONDITIONER", &
description="Type of preconditioner to be used with all minimization schemes. "// &
"They differ in effectiveness, cost of construction, cost of application. "// &
"Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
usage="PRECONDITIONER FULL_ALL", &
default_i_val=def_precond, &
enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
"NONE"), &
enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
"requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
"This preconditioner is recommended for almost all systems, except very large systems where "// &
"make_preconditioner would dominate the total computational cost.", &
"Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
"but cheaper to construct, "// &
"might be somewhat less robust. Recommended for large systems.", &
"Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
"Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
"use for very large systems.", &
"Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
"skip preconditioning"), &
enum_i_vals=(/ot_precond_full_all, ot_precond_full_single_inverse, ot_precond_full_single, &
ot_precond_full_kinetic, ot_precond_s_inverse, ot_precond_none/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ENERGY_GAP", &
description="Energy gap estimate [a.u.] for preconditioning", &
usage="ENERGY_GAP 0.1", &
default_r_val=def_egap)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="EVERY_N_STEP", &
description="Perform a linear response calculation every N-th step for MD run", &
usage="EVERY_N_STEP 50", default_i_val=1)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
description="Restart the response calculation if the restart file exists", &
usage="RESTART", &
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="WFN_RESTART_FILE_NAME", &
variants=(/"RESTART_FILE_NAME"/), &
description="Root of the file names where to read the response functions from "// &
"which to restart the calculation of the linear response", &
usage="WFN_RESTART_FILE_NAME <FILENAME>", &
type_of_var=lchar_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
IF (create_subsections) THEN
NULLIFY (subsection)
CALL create_localize_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_current_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_nmr_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_spin_spin_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_epr_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_polarizability_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_dcdr_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL create_vcd_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="printing of information during the linear response calculation", &
repeats=.FALSE.)
CALL cp_print_key_section_create( &
print_key, __LOCATION__, "program_run_info", &
description="Controls the printing of basic iteration information during the LINRES calculation", &
print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
description="Controls the dumping of restart file of the response wavefunction. "// &
"For each set of response functions, i.e. for each perturbation, "// &
"one different restart file is dumped. These restart files should be "// &
"employed only to restart the same type of LINRES calculation, "// &
"i.e. with the same perturbation.", &
print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("ITER"), &
add_last=add_last_numeric, each_iter_values=(/3/), filename="")
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END IF
END SUBROUTINE create_linres_section
! **************************************************************************************************
!> \brief creates the input structure used to activate
!> calculation of position perturbation DFPT
!> \param section ...
!> \author Sandra Luber, Edward Ditler
! **************************************************************************************************
SUBROUTINE create_dcdr_section(section)
TYPE(section_type), POINTER :: section
LOGICAL :: failure
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
failure = .FALSE.
NULLIFY (keyword, print_key, subsection)
CPASSERT(.NOT. ASSOCIATED(section))
IF (.NOT. failure) THEN
CALL section_create(section, __LOCATION__, name="DCDR", &
description="Compute analytical gradients the dipole moments.", &
n_keywords=50, n_subsections=1, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
description="controls the activation of the APT calculation", &
usage="&DCDR 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="LIST_OF_ATOMS", &
description="Specifies a list of atoms.", &
usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
variants=(/"DO_GAUGE"/), &
description="Use the distributed origin (DO) gauge?", &
usage="DISTRIBUTED_ORIGIN 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="ORBITAL_CENTER", &
description="The orbital center.", &
usage="ORBITAL_CENTER WANNIER", &
default_i_val=current_orb_center_wannier, &
enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
enum_desc=s2a("Use the Wannier centers.", &
"Use a common center (works only for an isolate molecule).", &
"Use the atoms as center.", &
"Boxing."), &
enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
current_orb_center_atom, current_orb_center_box/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
description="Gauge origin of the velocity gauge factor.", &
enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
enum_desc=s2a("Use Center of Mass", &
"Use Center of Atomic Charges", &
"Use User-defined Point", &
"Use Origin of Coordinate System"), &
enum_i_vals=(/use_mom_ref_com, &
use_mom_ref_coac, &
use_mom_ref_user, &
use_mom_ref_zero/), &
default_i_val=use_mom_ref_zero)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
description="User-defined reference point of the velocity gauge factor.", &
usage="REFERENCE_POINT x y z", &
repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="Z_MATRIX_METHOD", &
description="Use Z_matrix method to solve the response equation", &
usage="Z_MATRIX_METHOD T", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="print results of the magnetic dipole moment calculation", &
repeats=.FALSE.)
CALL cp_print_key_section_create(print_key, __LOCATION__, "APT", &
description="Controls the printing of the electric dipole gradient", &
print_level=low_print_level, add_last=add_last_numeric, filename="")
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
NULLIFY (subsection)
CALL create_interp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END IF
END SUBROUTINE create_dcdr_section
! **************************************************************************************************
!> \brief creates the input structure used to activate
!> calculation of VCD spectra using DFPT
!> \param section ...
!> \author Sandra Luber, Tomas Zimmermann, Edward Ditler
! **************************************************************************************************
SUBROUTINE create_vcd_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
NULLIFY (keyword, print_key, subsection)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="VCD", &
description="Carry out a VCD calculation.", &
n_keywords=50, n_subsections=1, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
description="controls the activation of the APT/AAT calculation", &
usage="&VCD 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="LIST_OF_ATOMS", &
description="Specifies a list of atoms.", &
usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
n_var=-1, type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
variants=(/"DO_GAUGE"/), &
description="Use the distributed origin (DO) gauge?", &
usage="DISTRIBUTED_ORIGIN 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="ORIGIN_DEPENDENT_MFP", &
description="Use the origin dependent MFP operator.", &
usage="ORIGIN_DEPENDENT_MFP 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="ORBITAL_CENTER", &
description="The orbital center.", &
usage="ORBITAL_CENTER WANNIER", &
default_i_val=current_orb_center_wannier, &
enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
enum_desc=s2a("Use the Wannier centers.", &
"Use a common center (works only for an isolate molecule).", &
"Use the atoms as center.", &
"Boxing."), &
enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
current_orb_center_atom, current_orb_center_box/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! The origin of the magnetic dipole operator (r - MAGNETIC_ORIGIN) x momentum
CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN", &
description="Gauge origin of the magnetic dipole operator.", &
enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
enum_desc=s2a("Use Center of Mass", &
"Use Center of Atomic Charges", &
"Use User-defined Point", &
"Use Origin of Coordinate System"), &
enum_i_vals=(/use_mom_ref_com, &
use_mom_ref_coac, &
use_mom_ref_user, &
use_mom_ref_zero/), &
default_i_val=use_mom_ref_zero)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN_REFERENCE", &
description="User-defined reference point of the magnetic dipole operator.", &
usage="REFERENCE_POINT x y z", &
repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
! The origin of the coordinate system
CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN", &
description="Gauge origin of the velocity gauge factor/spatial origin.", &
enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
enum_desc=s2a("Use Center of Mass", &
"Use Center of Atomic Charges", &
"Use User-defined Point", &
"Use Origin of Coordinate System"), &
enum_i_vals=(/use_mom_ref_com, &
use_mom_ref_coac, &
use_mom_ref_user, &
use_mom_ref_zero/), &
default_i_val=use_mom_ref_zero)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN_REFERENCE", &
description="User-defined reference point of the velocity gauge factor/spatial origin.", &
usage="REFERENCE_POINT x y z", &
repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="print results of the magnetic dipole moment calculation", &
repeats=.FALSE.)
CALL cp_print_key_section_create(print_key, __LOCATION__, "VCD", &
description="Controls the printing of the APTs and AATs", &
print_level=low_print_level, add_last=add_last_numeric, filename="")
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
NULLIFY (subsection)
CALL create_interp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_vcd_section
! **************************************************************************************************
!> \brief creates the input structure used to activate
!> calculation of induced current DFPT
!> Available properties : none
!> \param section the section to create
!> \author MI/VW
! **************************************************************************************************
SUBROUTINE create_current_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
NULLIFY (keyword, print_key, subsection)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="current", &
description="The induced current density is calculated by DFPT.", &
n_keywords=4, n_subsections=1, repeats=.FALSE., &
citations=(/Sebastiani2001, Weber2009/))
CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
description="controls the activation of the induced current calculation", &
usage="&CURRENT 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="GAUGE", &
description="The gauge used to compute the induced current within GAPW.", &
usage="GAUGE R", &
default_i_val=current_gauge_r_and_step_func, &
enum_c_vals=s2a("R", "R_AND_STEP_FUNCTION", "ATOM"), &
enum_desc=s2a("Position gauge (doesnt work well).", &
"Position and step function for the soft and the local parts, respectively.", &
"Atoms."), &
enum_i_vals=(/current_gauge_r, current_gauge_r_and_step_func, current_gauge_atom/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ATOM_RADIUS", &
description="Build the gauge=atom using only the atoms within this radius.", &
usage="GAUGE_ATOM_RADIUS 10.0", &
type_of_var=real_t, &
default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
unit_str="angstrom")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="USE_OLD_GAUGE_ATOM", &
description="Use the old way to compute the gauge.", &
usage="USE_OLD_GAUGE_ATOM 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="ORBITAL_CENTER", &
description="The orbital center.", &
usage="ORBITAL_CENTER WANNIER", &
default_i_val=current_orb_center_wannier, &
enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
enum_desc=s2a("Use the Wannier centers.", &
"Use a common center (works only for an isolate molecule).", &
"Use the atoms as center.", &
"Boxing."), &
enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
current_orb_center_atom, current_orb_center_box/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="COMMON_CENTER", &
description="The common center ", usage="COMMON_CENTER 0.0 1.0 0.0", &
n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/), type_of_var=real_t, &
unit_str="angstrom")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="NBOX", &
description="How many boxes along each directions ", usage="NBOX 6 6 5", &
n_var=3, default_i_vals=(/4, 4, 4/), type_of_var=integer_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CHI_PBC", &
description="Calculate the succeptibility correction to the shift with PBC", &
usage="CHI_PBC 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="FORCE_NO_FULL", &
description="Avoid the calculation of the state dependent perturbation term, "// &
"even if the orbital centers are set at Wannier centers or at Atom centers", &
usage="FORCE_NO_FULL 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="SELECTED_STATES_ON_ATOM_LIST", &
description="Indexes of the atoms for selecting"// &
" the states to be used for the response calculations.", &
usage="SELECTED_STATES_ON_ATOM_LIST 1 2 10", &
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="SELECTED_STATES_ATOM_RADIUS", &
description="Select all the states included in the given radius around each atoms "// &
"in SELECTED_STATES_ON_ATOM_LIST.", &
usage="SELECTED_STATES_ATOM_RADIUS 2.0", &
type_of_var=real_t, &
default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
unit_str="angstrom")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RESTART_CURRENT", &
description="Restart the induced current density calculation"// &
" from a previous run (not working yet).", &
usage="RESTART_CURRENT", default_l_val=.FALSE., &
lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="print results of induced current density calculation", &
repeats=.FALSE.)
CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_CUBES", &
description="Controls the printing of the induced current density (not working yet).", &
print_level=high_print_level, add_last=add_last_numeric, filename="")
CALL keyword_create(keyword, __LOCATION__, name="stride", &
description="The stride (X,Y,Z) used to write the cube file "// &
"(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
" 1 number valid for all components (not working yet).", &
usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
description="append the cube files when they already exist", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
description="Controls the printing of the response functions (not working yet).", &
print_level=high_print_level, add_last=add_last_numeric, filename="")
CALL keyword_create(keyword, __LOCATION__, name="stride", &
description="The stride (X,Y,Z) used to write the cube file "// &
"(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
" 1 number valid for all components (not working yet).", &
usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
variants=(/"CUBES_LU"/), &
description="The lower and upper index of the states to be printed as cube (not working yet).", &
usage="CUBES_LU_BOUNDS integer integer", &
n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
description="Indexes of the states to be printed as cube files "// &
"This keyword can be repeated several times "// &
"(useful if you have to specify many indexes) (not working yet).", &
usage="CUBES_LIST 1 2", &
n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
description="append the cube files when they already exist", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
NULLIFY (subsection)
CALL create_interp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_current_section
! **************************************************************************************************
!> \brief creates the input structure used to activate
!> calculation of NMR chemical shift using
!> the induced current obtained from DFPT
!> Available properties : none
!> \param section the section to create
!> \author MI/VW
! **************************************************************************************************
SUBROUTINE create_nmr_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
NULLIFY (keyword, print_key, subsection)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="nmr", &
description="The chemical shift is calculated by DFPT.", &
n_keywords=5, n_subsections=1, repeats=.FALSE., &
citations=(/Weber2009/))
CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
description="controls the activation of the nmr calculation", &
usage="&NMR 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="INTERPOLATE_SHIFT", &
description="Calculate the soft part of the chemical shift by interpolation ", &
usage="INTERPOLATE_SHIFT 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="NICS", &
description="Calculate the chemical shift in a set of points"// &
" given from an external file", usage="NICS", &
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="NICS_FILE_NAME", &
description="Name of the file with the NICS points coordinates", &
usage="NICS_FILE_NAME nics_file", &
default_lc_val="nics_file")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="RESTART_NMR", &
description="Restart the NMR calculation from a previous run (NOT WORKING YET)", &
usage="RESTART_NMR", 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="SHIFT_GAPW_RADIUS", &
description="While computing the local part of the shift (GAPW), "// &
"the integration is restricted to nuclei that are within this radius.", &
usage="SHIFT_GAPW_RADIUS 20.0", &
type_of_var=real_t, &
default_r_val=cp_unit_to_cp2k(value=60.0_dp, unit_str="angstrom"), &
unit_str="angstrom")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="print results of nmr calculation", &
repeats=.FALSE.)
CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
description="Controls the printing of the response functions ", &
print_level=high_print_level, add_last=add_last_numeric, filename="")
CALL keyword_create(keyword, __LOCATION__, name="stride", &
description="The stride (X,Y,Z) used to write the cube file "// &
"(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
" 1 number valid for all components.", &
usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
variants=(/"CUBES_LU"/), &
description="The lower and upper index of the states to be printed as cube", &
usage="CUBES_LU_BOUNDS integer integer", &
n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
description="Indexes of the states to be printed as cube files "// &
"This keyword can be repeated several times "// &
"(useful if you have to specify many indexes).", &
usage="CUBES_LIST 1 2", &
n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
description="append the cube files when they already exist", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "CHI_TENSOR", &
description="Controls the printing of susceptibility", &
print_level=high_print_level, add_last=add_last_numeric, filename="")
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "SHIELDING_TENSOR", &
description="Controls the printing of the chemical shift", &
print_level=low_print_level, add_last=add_last_numeric, filename="")
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LU_BOUNDS", &
variants=(/"ATOMS_LU"/), &
description="The lower and upper atomic index for which the tensor is printed", &
usage="ATOMS_LU_BOUNDS integer integer", &
n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
description="list of atoms for which the shift is printed into a file ", &
usage="LIST_ATOMS 1 2", n_var=-1, &
type_of_var=integer_t, repeats=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(subsection, print_key)
CALL section_release(print_key)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
NULLIFY (subsection)
CALL create_interp_section(subsection)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
END SUBROUTINE create_nmr_section
! **************************************************************************************************
!> \brief creates the input structure used to activate
!> calculation of NMR spin-spin coupling (implementation not operating)
!> Available properties : none
!> \param section the section to create
!> \author VW
! **************************************************************************************************
SUBROUTINE create_spin_spin_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key, subsection
NULLIFY (keyword, print_key, subsection)
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="spinspin", &
description="Compute indirect spin-spin coupling constants.", &
n_keywords=5, n_subsections=1, repeats=.FALSE.)
CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
description="controls the activation of the nmr calculation", &
usage="&SPINSPIN 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="RESTART_SPINSPIN", &
description="Restart the spin-spin calculation from a previous run (NOT WORKING YET)", &
usage="RESTART_SPINSPIN", 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="ISSC_ON_ATOM_LIST", &
description="Atoms for which the issc is computed.", &
usage="ISSC_ON_ATOM_LIST 1 2 10", &
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="DO_FC", &
description="Compute the Fermi contact contribution", &
usage="DO_FC F", &
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_SD", &
description="Compute the spin-dipolar contribution", &
usage="DO_SD F", &
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_PSO", &
description="Compute the paramagnetic spin-orbit contribution", &
usage="DO_PSO F", &
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_DSO", &
description="Compute the diamagnetic spin-orbit contribution (NOT YET IMPLEMENTED)", &
usage="DO_DSO F", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
NULLIFY (subsection)
CALL section_create(subsection, __LOCATION__, name="PRINT", &
description="print results of the indirect spin-spin calculation", &
repeats=.FALSE.)
CALL cp_print_key_section_create(print_key, __LOCATION__, "K_MATRIX", &
description="Controls the printing of the indirect spin-spin matrix", &
print_level=low_print_level, add_last=add_last_numeric, filename="")
CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
description="list of atoms for which the indirect spin-spin is printed into a file ", &
usage="LIST_ATOMS 1 2", n_var=-1, &
type_of_var=integer_t, repeats=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(subsection, print_key)