-
Notifications
You must be signed in to change notification settings - Fork 3
/
patch.diff
3762 lines (3754 loc) · 194 KB
/
patch.diff
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
diff --git a/LR_Modules/dfpt_tetra_mod.f90 b/LR_Modules/dfpt_tetra_mod.f90
index d341ff695..ec1dfd4b5 100644
--- a/LR_Modules/dfpt_tetra_mod.f90
+++ b/LR_Modules/dfpt_tetra_mod.f90
@@ -18,7 +18,10 @@ MODULE dfpt_tetra_mod
!
PRIVATE
PUBLIC :: dfpt_tetra_beta, dfpt_tetra_ttheta, dfpt_tetra_delta, &
- dfpt_tetra_main, dfpt_tetra_linit
+ & dfpt_tetra_main, dfpt_tetra_linit, &
+ & dfpt_tetra_lindhard_1234, dfpt_tetra_lindhard_1231, &
+ & dfpt_tetra_lindhard_1233, dfpt_tetra_lindhard_1221, &
+ & dfpt_tetra_lindhard_1222, dfpt_tetra_lindhard_1211
!
LOGICAL,SAVE :: dfpt_tetra_linit = .FALSE.
!
@@ -1525,12 +1528,13 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
call hpsort (4, e, itetra)
!
thr = MAXVAL(e(1:4)) * 1e-3_dp
- thr2 = 1e-8_dp
+ thr2 = 1e-10_dp
!
DO ii = 1, 4
IF(e(ii) < thr2) THEN
IF(ii == 3) THEN
- CALL errore("dfpt_tetra_lindhard", "Nesting occurs.", 0)
+ write(*,*) e(1:4)
+ CALL errore("dfpt_tetra_lindhard", "Nesting occurs.", 1)
END IF
le(ii) = 0.0_dp
e(ii) = 0.0_dp
@@ -1562,7 +1566,7 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "4=3=2", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : 4=3=2", 1)
END IF
!
END IF
@@ -1578,7 +1582,7 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "4=3 2=1", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : 4=3, 2=1", 1)
END IF
!
ELSE
@@ -1593,7 +1597,7 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "4=3", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : 4=3", 1)
END IF
!
END IF
@@ -1610,7 +1614,7 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "3=2=1", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : 3=2=1", 1)
END IF
!
ELSE
@@ -1625,7 +1629,7 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "3=2", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : 3=2", 1)
END IF
!
END IF
@@ -1641,12 +1645,12 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "2=1", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : 2=1", 1)
END IF
!
ELSE
!
- ! DIFferent each other.
+ ! Different each other.
!
w(itetra(4)) = dfpt_tetra_lindhard_1234(e(4),e(1),e(2),e(3),le(4),le(1),le(2),le(3))
w(itetra(3)) = dfpt_tetra_lindhard_1234(e(3),e(1),e(2),e(4),le(3),le(1),le(2),le(4))
@@ -1656,7 +1660,7 @@ SUBROUTINE dfpt_tetra_lindhard(ei,ej,w)
IF(ANY(w(itetra(1:4)) < 0.0_dp)) THEN
WRITE(*,'(100e15.5)') e(1:4)
WRITE(*,'(100e15.5)') w(itetra(1:4))
- CALL errore("dfpt_tetra_lindhard", "Something wrong.", 0)
+ CALL errore("dfpt_tetra_lindhard", "Case : Different each other", 1)
END IF
!
END IF
diff --git a/LR_Modules/setup_nscf.f90 b/LR_Modules/setup_nscf.f90
index 56e255e4d..bd062795d 100644
--- a/LR_Modules/setup_nscf.f90
+++ b/LR_Modules/setup_nscf.f90
@@ -52,6 +52,7 @@ SUBROUTINE setup_nscf ( newgrid, xq, elph_mat )
LOGICAL, INTENT (IN) :: newgrid
LOGICAL, INTENT (IN) :: elph_mat ! used to be passed through a module.
!
+ INTEGER :: t_rev_dummy(48)
REAL (DP), ALLOCATABLE :: rtau (:,:,:)
INTEGER :: t_rev_eff(48), ik
LOGICAL :: magnetic_sym, sym(48)
@@ -148,8 +149,14 @@ SUBROUTINE setup_nscf ( newgrid, xq, elph_mat )
!
IF ( ltetra .AND. (tetra_type /= 0) ) THEN
IF (ALLOCATED(tetra)) DEALLOCATE(tetra)
- CALL opt_tetra_init(nsymq, s, time_reversal .AND. minus_q, t_rev, at, bg,&
- npk, k1, k2, k3, nk1, nk2, nk3, nkstot, xk, kunit)
+ IF(elph_mat) THEN
+ t_rev_dummy(1:48) = 0
+ CALL opt_tetra_init(1, s, .FALSE., t_rev_dummy, at, bg,&
+ npk, k1, k2, k3, nk1, nk2, nk3, nkstot, xk, kunit)
+ ELSE
+ CALL opt_tetra_init(nsymq, s, time_reversal .AND. minus_q, t_rev, at, bg,&
+ npk, k1, k2, k3, nk1, nk2, nk3, nkstot, xk, kunit)
+ END IF
END IF
!
IF ( lsda ) THEN
diff --git a/PHonon/PH/alpha2f.f90 b/PHonon/PH/alpha2f.f90
index d77691e32..24405d5f5 100644
--- a/PHonon/PH/alpha2f.f90
+++ b/PHonon/PH/alpha2f.f90
@@ -22,6 +22,10 @@ MODULE alpha2f_vals
!
INTEGER :: nfreq
!
+ REAL(DP),SAVE :: &
+ & freq_min, &
+ & freq_min_ratio
+ !
REAL(DP),ALLOCATABLE,SAVE :: &
& omg(:,:), & ! (nmodes,nqs) Phonon frequencies on irreducible q
& lam(:,:), & ! (nmodes,nqs) El-Ph coupling on irreducible q
@@ -148,11 +152,10 @@ SUBROUTINE read_lam()
!
USE kinds, ONLY : DP
USE disp, ONLY : nqs, x_q
- USE cell_base, ONLY : at
USE modes, ONLY : nmodes
USE output, ONLY : fildyn
!
- USE alpha2f_vals, ONLY : omg, lam
+ USE alpha2f_vals, ONLY : omg, lam, freq_min, freq_min_ratio
!
IMPLICIT NONE
!
@@ -187,18 +190,20 @@ SUBROUTINE read_lam()
!
DO im = 1, nmodes
READ(fi,'(a19,f8.4)') ctmp, lam(im,iq)
- IF (omg(im,iq) > 0.0_dp) THEN
- omg(im,iq) = SQRT(omg(im,iq))
- ELSE
- omg(im,iq) = 1.0_dp
- lam(im,iq) = 0.0_dp
- END IF
END DO
!
CLOSE(fi)
!
END DO
!
+ ! w^2 (input) -> w
+ !
+ omg(1:nmodes,1:nqs) = sign(SQRT(ABS(omg(1:nmodes,1:nqs))), omg(1:nmodes,1:nqs))
+ !
+ IF(freq_min_ratio > 0.0) THEN
+ freq_min = freq_min_ratio * MAXVAL(omg(1:nmodes,1:nqs))
+ END IF
+ !
END SUBROUTINE read_lam
!
!-------------------------------------------------------------------
@@ -210,7 +215,7 @@ SUBROUTINE compute_a2F()
USE kinds, ONLY : DP
USE ions_base, ONLY : nat
USE modes, ONLY : nmodes
- USE ktetra, ONLY : ntetra, tetra, opt_tetra_init, opt_tetra_partialdos
+ USE ktetra, ONLY : ntetra, opt_tetra_init, opt_tetra_partialdos
USE wvfct, ONLY : et, nbnd
USE io_global, ONLY : stdout
USE cell_base, ONLY : at, bg
@@ -307,15 +312,15 @@ SUBROUTINE compute_lambda()
USE modes, ONLY : nmodes
USE constants, ONLY : RY_TO_THZ, K_BOLTZMANN_RY
USE ktetra, ONLY : ntetra, wlsm, tetra
- USE disp, ONLY : nqs
+ USE disp, ONLY : nqs, x_q
USE io_global, ONLY : stdout
USE io_files, ONLY : prefix
!
- USE alpha2f_vals, ONLY : omg, lam
+ USE alpha2f_vals, ONLY : omg, lam, freq_min
!
IMPLICIT NONE
!
- INTEGER :: ii, itetra, iq, fo
+ INTEGER :: ii, itetra, iq, fo, imode
REAL(DP) :: omglog, lambda, wq(nqs)
!
INTEGER, EXTERNAL :: find_free_unit
@@ -331,8 +336,15 @@ SUBROUTINE compute_lambda()
lambda = 0.0_dp
omglog = 0.0_dp
DO iq = 1, nqs
- lambda = lambda + wq(iq) * SUM(lam(1:nmodes, iq))
- omglog = omglog + wq(iq) * SUM(LOG(omg(1:nmodes,iq)) * lam(1:nmodes,iq))
+ DO imode = 1, nmodes
+ IF(omg(imode, iq) > freq_min) THEN
+ lambda = lambda + wq(iq) * lam(imode, iq)
+ omglog = omglog + wq(iq) * LOG(omg(imode,iq)) * lam(imode,iq)
+ ELSE
+ WRITE(stdout,'(a,i0,a,i0,a,3f10.5,a,e15.5)') &
+ & "IGNORE iq=", iq, ", imode=", imode, ", x_q=", x_q(1:3,iq), ", omega[THz]=", omg(imode,iq)*RY_TO_THZ
+ END IF
+ END DO
END DO
omglog = omglog / lambda
omglog = EXP(omglog)
@@ -377,20 +389,23 @@ PROGRAM alpha2f
! This routine reads lambda*.dat and compute a^2F, phonon DOS, lambda,
! & omega_ln
!
+ USE kinds, ONLY : DP
USE mp_global, ONLY : mp_startup, mp_global_end
USE environment, ONLY : environment_start, environment_end
USE elph_tetra_mod, ONLY : in_alpha2f
USE io_global, ONLY : qestdin, ionode
+ USE modes, ONLY : nmodes
+ USE ions_base, ONLY : nat
+ USE constants, ONLY : RY_TO_THZ
!
- USE alpha2f_vals, ONLY : nfreq
+ USE alpha2f_vals, ONLY : nfreq, freq_min, freq_min_ratio
USE alpha2f_routines, ONLY : read_lam, compute_a2f, compute_lambda, read_polarization
!
implicit none
!
CHARACTER (LEN=256) :: auxdyn
- INTEGER :: ios
!
- NAMELIST /INPUTA2F/ nfreq
+ NAMELIST /INPUTA2F/ nfreq, freq_min, freq_min_ratio
!
#if defined(__MPI)
CALL mp_startup()
@@ -399,8 +414,13 @@ PROGRAM alpha2f
in_alpha2f = .TRUE.
!
CALL phq_readin()
+ nmodes = 3 * nat
!
+ nfreq = 100
+ freq_min = 0.0_dp
+ freq_min_ratio = -1.0
IF(ionode) READ( qestdin, INPUTA2F )
+ freq_min = freq_min / RY_TO_THZ
!
CALL check_initial_status(auxdyn)
!
diff --git a/PHonon/PH/do_q2r.f90 b/PHonon/PH/do_q2r.f90
index 68e72a2c4..d411a5428 100644
--- a/PHonon/PH/do_q2r.f90
+++ b/PHonon/PH/do_q2r.f90
@@ -25,6 +25,8 @@ SUBROUTINE do_q2r(fildyn_, flfrc, prefix, zasr, la2F, loto_2d)
USE environment, ONLY : environment_start, environment_end
USE rigid, ONLY : rgd_blk
USE el_phon, ONLY : el_ph_nsigma
+ USE constants, ONLY : pi
+ USE elph_tetra_mod, ONLY : lshift_q
!
IMPLICIT NONE
!
@@ -48,6 +50,8 @@ SUBROUTINE do_q2r(fildyn_, flfrc, prefix, zasr, la2F, loto_2d)
INTEGER :: na, nt
!
INTEGER :: gid, ibrav, ierr, nspin_mag, ios
+ REAL(DP) :: qshift_phase
+ COMPLEX(DP) :: qshift_coef(3)
!
INTEGER, ALLOCATABLE :: nc(:,:,:)
COMPLEX(DP), ALLOCATABLE :: phid(:,:,:,:,:)
@@ -189,13 +193,20 @@ SUBROUTINE do_q2r(fildyn_, flfrc, prefix, zasr, la2F, loto_2d)
DO icar=1,3
xq = xq + at(icar,ipol) * q(icar,nq) * nr(ipol)
END DO
+ IF(lshift_q) xq = xq - 0.5_dp
lq = lq .AND. (ABS(NINT(xq) - xq) .LT. eps)
iq = NINT(xq)
!
m(ipol)= MOD(iq,nr(ipol)) + 1
IF (m(ipol) .LT. 1) m(ipol) = m(ipol) + nr(ipol)
END DO
- IF (.NOT.lq) CALL errore('init','q not allowed',1)
+ IF (.NOT.lq) THEN
+ IF(lshift_q) THEN
+ CYCLE
+ ELSE
+ CALL errore('init','q not allowed',1)
+ END IF
+ END IF
IF(nc(m(1),m(2),m(3)).EQ.0) THEN
nc(m(1),m(2),m(3))=1
@@ -238,6 +249,58 @@ SUBROUTINE do_q2r(fildyn_, flfrc, prefix, zasr, la2F, loto_2d)
END DO
END DO
!
+ ! Phase for shifted q-grid
+ !
+ ! C(R) = sum_q exp(2*pi*i*(q+0.5)*R/N) C(q+0.5)
+ ! = exp(pi*i*R/N) sum_q exp(2*pi*i*q*R/N) C(q+0.5)
+ !
+ ! C(R-N) = exp(pi*i*(R-N)/N) sum_q exp(2 pi i q (R-N) / N) C(q+0.5)
+ ! = - exp(pi*i*R/N) sum_q exp(2*pi*i*q*R/N) C(q+0.5)
+ !
+ ! C(N/2) = -C(-N/2) = 0
+ !
+ IF(lshift_q) THEN
+ DO m3 = 0, nr3 - 1
+ !
+ qshift_phase = pi * REAL(m3,DP) / REAL(nr3,DP)
+ qshift_coef(3) = CMPLX(COS(qshift_phase), SIN(qshift_phase), kind=DP)
+ !
+ IF(2*m3 > nr3) THEN
+ qshift_coef(3) = - qshift_coef(3)
+ ELSE IF(2*m3 == nr3) THEN
+ qshift_coef(3) = 0.0_dp
+ END IF
+ !
+ DO m2 = 0, nr2 - 1
+ !
+ qshift_phase = pi * REAL(m2,DP) / REAL(nr2,DP)
+ qshift_coef(2) = CMPLX(COS(qshift_phase), SIN(qshift_phase), kind=DP)
+ !
+ IF (2*m2 > nr2) THEN
+ qshift_coef(2) = - qshift_coef(2)
+ ELSE IF (2*m2 == nr2) THEN
+ qshift_coef(2) = 0.0_dp
+ END IF
+ !
+ DO m1 = 0, nr1 - 1
+ !
+ qshift_phase = pi * REAL(m1,DP) / REAL(nr1,DP)
+ qshift_coef(1) = CMPLX(COS(qshift_phase), SIN(qshift_phase), kind=DP)
+ !
+ IF (2*m1 > nr1) THEN
+ qshift_coef(1) = -qshift_coef(1)
+ ELSE IF (2*m1 == nr1) THEN
+ qshift_coef(1) = 0.0_dp
+ END IF
+ !
+ phid( 1+m1+nr1*m2+nr1*nr2*m3,:,:,:,:) &
+ & = phid(1+m1+nr1*m2+nr1*nr2*m3,:,:,:,:) * PRODUCT(qshift_coef(1:3))
+ !
+ END DO
+ END DO
+ END DO
+ END IF ! (lshift_q)
+ !
! Real space force constants written to file (analytical part)
!
IF (xmldyn) THEN
@@ -320,6 +383,8 @@ SUBROUTINE gammaq2r( nqtot, nat, nr1, nr2, nr3, at )
USE mp, ONLY : mp_bcast
USE mp_world, ONLY : world_comm
USE el_phon, ONLY : el_ph_nsigma
+ USE constants, ONLY : pi
+ USE elph_tetra_mod, ONLY : lshift_q
!
IMPLICIT NONE
INTEGER, INTENT(IN) :: nqtot, nat, nr1, nr2, nr3
@@ -339,6 +404,8 @@ SUBROUTINE gammaq2r( nqtot, nat, nr1, nr2, nr3, at )
CHARACTER(LEN=6) :: int_to_char
LOGICAL :: exst
INTEGER :: ios
+ REAL(DP) :: qshift_phase
+ COMPLEX(DP) :: qshift_coef(3)
!
ALLOCATE (gaminp(3,3,nat,nat,48), gamout(nr1*nr2*nr3,3,3,nat,nat) )
@@ -388,13 +455,20 @@ SUBROUTINE gammaq2r( nqtot, nat, nr1, nr2, nr3, at )
do icar=1,3
xq = xq + at(icar,ipol) * q(icar,nq) * nr(ipol)
end do
+ IF(lshift_q) xq = xq - 0.5_dp
lq = lq .AND. (ABS(NINT(xq) - xq) < eps)
iq = NINT(xq)
!
m(ipol)= mod(iq,nr(ipol)) + 1
if (m(ipol) < 1) m(ipol) = m(ipol) + nr(ipol)
end do !ipol
- IF (.NOT.lq) CALL errore('gammaq2r','q not allowed',1)
+ IF (.NOT.lq) THEN
+ IF(lshift_q) THEN
+ CYCLE
+ ELSE
+ IF (.NOT.lq) CALL errore('gammaq2r','q not allowed',1)
+ END IF
+ END IF
!
if(nc(m(1),m(2),m(3)) == 0) then
nc(m(1),m(2),m(3)) = 1
@@ -425,6 +499,58 @@ SUBROUTINE gammaq2r( nqtot, nat, nr1, nr2, nr3, at )
end do
gamout = gamout / DBLE (nr1*nr2*nr3)
!
+ ! Phase for shifted q-grid
+ !
+ ! C(R) = sum_q exp(2*pi*i*(q+0.5)*R/N) C(q+0.5)
+ ! = exp(pi*i*R/N) sum_q exp(2*pi*i*q*R/N) C(q+0.5)
+ !
+ ! C(R-N) = exp(pi*i*(R-N)/N) sum_q exp(2 pi i q (R-N) / N) C(q+0.5)
+ ! = - exp(pi*i*R/N) sum_q exp(2*pi*i*q*R/N) C(q+0.5)
+ !
+ ! C(-N/2) = -C(N/2) = 0
+ !
+ IF(lshift_q) THEN
+ DO m3 = 0, nr3 - 1
+ !
+ qshift_phase = pi * REAL(m3,DP) / REAL(nr3,DP)
+ qshift_coef(3) = CMPLX(COS(qshift_phase), SIN(qshift_phase), kind=DP)
+ !
+ IF(2*m3 > nr3) THEN
+ qshift_coef(3) = -qshift_coef(3)
+ ELSE IF(2*m3 == nr3) THEN
+ qshift_coef(3) = 0.0_dp
+ END IF
+ !
+ DO m2 = 0, nr2 - 1
+ !
+ qshift_phase = pi * REAL(m2,DP) / REAL(nr2,DP)
+ qshift_coef(2) = CMPLX(COS(qshift_phase), SIN(qshift_phase), kind=DP)
+ !
+ IF(2*m2 > nr2) THEN
+ qshift_coef(2) = -qshift_coef(2)
+ ELSE IF(2*m2 == nr2) THEN
+ qshift_coef(2) = 0.0_dp
+ END IF
+ !
+ DO m1 = 0, nr1 - 1
+ !
+ qshift_phase = pi * REAL(m1,DP) / REAL(nr1,DP)
+ qshift_coef(1) = CMPLX(COS(qshift_phase), SIN(qshift_phase), kind=DP)
+ !
+ IF(2*m1 > nr1) THEN
+ qshift_coef(1) = -qshift_coef(1)
+ ELSE IF(2*m1 == nr1) THEN
+ qshift_coef(1) = 0.0_dp
+ END IF
+ !
+ gamout( 1+m1+nr1*m2+nr1*nr2*m3,:,:,:,:) &
+ & = gamout(1+m1+nr1*m2+nr1*nr2*m3,:,:,:,:) * PRODUCT(qshift_coef(1:3))
+ !
+ END DO
+ END DO
+ END DO
+ END IF ! (lshift_q)
+ !
IF (ionode) close(filea2F)
!
filea2F = 60 + isig
diff --git a/PHonon/PH/elph_scdft_mod.f90 b/PHonon/PH/elph_scdft_mod.f90
index 513befc8e..0e1864c7e 100644
--- a/PHonon/PH/elph_scdft_mod.f90
+++ b/PHonon/PH/elph_scdft_mod.f90
@@ -27,42 +27,25 @@ SUBROUTINE elph_scdft()
! expand that to whole BZ.
!
USE kinds, ONLY : dp
- USE parameters, ONLY : npk
- USE mp, ONLY : mp_sum
- USE mp_images, ONLY : nproc_image, intra_image_comm, me_image
- USE mp_pools, ONLY : npool, inter_pool_comm, my_pool_id, &
- & nproc_pool, intra_pool_comm, me_pool
+ USE mp_pools, ONLY : npool, inter_pool_comm, my_pool_id
+ USE mp_images, ONLY : me_image
USE io_global, ONLY : stdout
- USE cell_base, ONLY : at, bg
+ USE cell_base, ONLY : at
USE ions_base, ONLY : nat
- USE symm_base, ONLY : s, irt
- USE klist, ONLY: nks, nkstot, xk
- USE noncollin_module, ONLY: nspin_lsda
USE start_k, ONLY: nk1, nk2, nk3
- USE wvfct, ONLY: nbnd, et
USE qpoint, ONLY : xq, nksq
USE dynmat, ONLY : dyn, w2
USE el_phon, ONLY : el_ph_mat, elph_nbnd_min, elph_nbnd_max
- USE control_lr, ONLY : lgamma
USE control_ph, ONLY : current_iq
USE modes, ONLY : u
- USE lr_symm_base, ONLY : minus_q, nsymq, rtau
- !
- INTEGER :: ik, ik2, ikk, ikq, ib, jb, ii, jj, isym, nu, jsym, elph_unit, &
- & nn, nn2, nks_real, ikv2(3), nsymqbz, nksq2, nrcv, ipe
- INTEGER :: &
- & nbnd_fs, & ! = elph_nbnd_max - elph_nbnd_min + 1
- & nkBZ ! = nk1 * nk2 * nk3
- !
- REAL(dp) :: kv1(3), kv2(3)
- REAL(dp) :: xk_col(3,nkstot)
- COMPLEX(dp) :: epmat(3 * nat, 3 * nat)
- !
- INTEGER,ALLOCATABLE :: symq(:,:,:), eqBZ(:), sBZ(:), indx(:), cnt(:), dsp(:)
- REAL(dp),ALLOCATABLE :: gg_col(:,:), gg(:,:,:,:)
+ USE noncollin_module, ONLY : nspin_lsda
+ USE io_files, ONLY : prefix, tmp_dir
!
- CHARACTER(100) :: chiq, elphname
+ INTEGER :: ik, ib, jb, ii, elph_unit, nrcv
+ INTEGER :: nbnd_fs
!
+ COMPLEX(dp),ALLOCATABLE :: gep_col(:,:,:), gep(:,:,:,:)
+ CHARACTER(100) :: elphname
INTEGER, EXTERNAL :: find_free_unit
!
WRITE(stdout,*) "[elph_scdft] write elph.dat with symmetries (only on Fermi surfaces)"
@@ -73,173 +56,49 @@ SUBROUTINE elph_scdft()
WRITE(stdout,*) "[elph_scdft] Highest band which contains FS : ", elph_nbnd_max
WRITE(stdout,*) "[elph_scdft] # of bands which contains FS : ", nbnd_fs
!
- ! Symmetries of this q
- !
- nsymqbz = nsymq
- IF(minus_q) nsymqbz = nsymq * 2
- !
- ALLOCATE(symq(3,3,nsymqbz))
- !
- symq(1:3,1:3,1:nsymq) = s(1:3,1:3,1:nsymq)
- IF(minus_q) symq(1:3,1:3,nsymq+1:nsymq+nsymq) = - s(1:3,1:3,1:nsymq)
- !
- WRITE(stdout,*) "[elph_scdft] # of symmetries of this q : ", nsymqbz
- !
- ! Find which k-points of a uniform grid are in the IBZ
- !
- CALL elph_scdft_cnt_and_dsp(inter_pool_comm,npool,my_pool_id,nks,cnt,dsp)
- !
- xk_col(1:3,1:nkstot) = 0_dp
- xk_col(1:3,dsp(my_pool_id) + 1: dsp(my_pool_id) + nks) = xk(1:3,1:nks)
- CALL mp_sum(xk_col, inter_pool_comm)
- !
- nkBZ = nk1 * nk2 * nk3
- nks_real = nkstot / nspin_lsda
- ALLOCATE(eqBZ(nkBZ), sBZ(nkBZ), indx(nkBZ))
- !
- IF(lgamma)THEN
- CALL lint (nsymq, s, minus_q, at, bg, npk, 0, 0, 0, &
- & nk1, nk2, nk3, nks_real, xk_col, 1, nkBZ, eqBZ, sBZ)
- ELSE
- CALL lint (nsymq, s, minus_q, at, bg, npk, 0, 0, 0, &
- & nk1, nk2, nk3, nks_real, xk_col, 2, nkBZ, eqBZ, sBZ)
- END IF
+ ! Compute g in each pool
!
- ! Querry of El-Ph matrix
+ ALLOCATE(gep(3*nat, elph_nbnd_min:elph_nbnd_max, elph_nbnd_min:elph_nbnd_max, nksq))
!
- nksq2 = nksq / nproc_pool
- IF(me_pool < MOD(nksq, nproc_pool)) nksq2 = nksq2 + 1
- !
- CALL elph_scdft_cnt_and_dsp(intra_pool_comm,nproc_pool,me_pool,nksq2,cnt,dsp)
+ gep(1:3 * nat, elph_nbnd_min:elph_nbnd_max, elph_nbnd_min:elph_nbnd_max, 1:nksq) = 0.0_dp
!
- indx(1:nkBZ) = 0
- nksq2 = 0
- DO ik = dsp(me_pool) + 1, dsp(me_pool) + cnt(me_pool)
+ DO ik = 1, nksq
!
- IF(lgamma) THEN
- ikk = ik
- ELSE
- ikk = 2 * ik - 1
- END IF
- !
- kv1(1:3) = MATMUL(xk(1:3,ikk), at(1:3, 1:3))
- !
- DO isym = 1, nsymqbz
- !
- kv2(1:3) = MATMUL(REAL(symq(1:3,1:3,isym), dp), kv1(1:3)) * REAL((/nk1, nk2, nk3/), dp)
- ikv2(1:3) = NINT(kv2(1:3))
- !
- IF(ANY(ABS(kv2(1:3) - REAL(ikv2(1:3), dp)) > 1e-5_dp)) CYCLE
- !
- ikv2(1:3) = MODULO(ikv2(1:3), (/nk1, nk2, nk3/))
- nn2 = 1 + ikv2(1) + nk1 * ikv2(2) + nk1 * nk2 * ikv2(3)
- !
- IF(indx(nn2) /= 0) CYCLE
- !
- nksq2 = nksq2 + 1
- indx(nn2) = nksq2
- !
- END DO
- !
- END DO
- !
- ! Collect El-Ph matrix -> PE0
- !
- ALLOCATE(gg(3 * nat, nbnd_fs, nbnd_fs, nksq2))
- !
- gg(1:3 * nat, 1:nbnd_fs, 1:nbnd_fs, 1:nksq2) = 0_dp
- !
- nksq2 = 0
- indx(1:nkBZ) = 0
- DO ik = dsp(me_pool) + 1, dsp(me_pool) + cnt(me_pool)
- !
- IF(lgamma) THEN
- ikk = ik
- ELSE
- ikk = 2 * ik - 1
- END IF
- !
- kv1(1:3) = MATMUL(xk(1:3,ikk), at(1:3, 1:3))
- !
- DO isym = 1, nsymqbz
- !
- kv2(1:3) = MATMUL(REAL(symq(1:3,1:3,isym), dp), kv1(1:3)) * REAL((/nk1, nk2, nk3/), dp)
- ikv2(1:3) = NINT(kv2(1:3))
- !
- IF(ANY(ABS(kv2(1:3) - REAL(ikv2(1:3), dp)) > 1e-5_dp)) CYCLE
- !
- ikv2(1:3) = MODULO(ikv2(1:3), (/nk1, nk2, nk3/))
- nn = ikv2(3) + ikv2(2) * nk3 + ikv2(1) * nk2 * nk3 + 1
- nn2 = ikv2(1) + ikv2(2) * nk1 + ikv2(3) * nk2 * nk1 + 1
- !
- IF(indx(nn2) /= 0) CYCLE
- !
- jsym = sBZ(nn)
- nksq2 = nksq2 + 1
- indx(nn2) = nksq2
- !
- DO ib = 1, nbnd_fs
- DO jb = 1, nbnd_fs
- !
- DO ii = 1, 3 * nat
- DO jj = 1, 3 * nat
- epmat(ii,jj) = CONJG(el_ph_mat(elph_nbnd_min - 1 + jb,elph_nbnd_min - 1 + ib,ik,ii)) &
- & * el_ph_mat(elph_nbnd_min - 1 + jb,elph_nbnd_min - 1 + ib,ik,jj)
- END DO
- END DO
- !
- CALL symm(epmat, u, xq, s, jsym, rtau, irt, at, bg, nat)
- !
- epmat(1:3 * nat,1:3 * nat) = MATMUL(epmat(1:3 * nat,1:3 * nat), dyn(1:3 * nat,1:3 * nat))
- !
- DO nu = 1, 3 * nat
- !
- gg(nu,jb,ib,nksq2) = REAL(DOT_PRODUCT(dyn(1:3 * nat, nu), epmat(1:3 * nat, nu)), dp)
- !
- END DO ! nu
- !
- END DO ! jb
- END DO ! ib
- !
- END DO ! isym
+ DO ib = elph_nbnd_min, elph_nbnd_max
+ DO jb = elph_nbnd_min, elph_nbnd_max
+ !
+ DO ii = 1, 3*nat
+ gep(ii,jb,ib,ik) = DOT_PRODUCT(u(ii,1:3*nat), el_ph_mat(jb,ib,ik,1:3*nat))
+ END DO
+ gep(1:3*nat,jb,ib,ik) = MATMUL(gep(1:3*nat,jb,ib,ik), dyn(1:3 * nat,1:3 * nat))
+ !
+ END DO ! jb
+ END DO ! ib
!
END DO ! ik
!
- DO nu = 1, 3 * nat
- IF(w2(nu) <= 0_dp) THEN
- gg(nu, 1:nbnd_fs, 1:nbnd_fs, 1:nksq2) = 0_dp
+ DO ii = 1, 3 * nat
+ IF(w2(ii) <= 0_dp) THEN
+ gep(ii, elph_nbnd_min:elph_nbnd_max, elph_nbnd_min:elph_nbnd_max, 1:nksq) = 0_dp
ELSE
- gg(nu, 1:nbnd_fs, 1:nbnd_fs, 1:nksq2) = gg(nu,1:nbnd_fs,1:nbnd_fs,1:nksq2) &
- & / SQRT(w2(nu)) * 0.5_dp
+ gep( ii, elph_nbnd_min:elph_nbnd_max, elph_nbnd_min:elph_nbnd_max,1:nksq) &
+ & = gep(ii, elph_nbnd_min:elph_nbnd_max, elph_nbnd_min:elph_nbnd_max,1:nksq) &
+ & / SQRT(SQRT(w2(ii)) * 2.0_dp)
END IF
END DO
!
- ! indices of k; ik is at indx(ik)
- !
- CALL elph_scdft_cnt_and_dsp(intra_image_comm,nproc_image,me_image,nksq2,cnt,dsp)
- !
- DO ik = 1, nkBZ
- IF(indx(ik) /= 0) indx(ik) = indx(ik) + dsp(me_image)
- END DO
- !
- CALL mp_sum(indx, intra_image_comm)
- !
! Gather El-Ph matrix inter pool
!
- IF(me_image == 0) THEN
- nrcv = 3 * nat * nbnd_fs * nbnd_fs * nkBZ
- ALLOCATE(gg_col(3 * nat * nbnd_fs * nbnd_fs, nkBZ))
+ IF(my_pool_id == 0) THEN
+ nrcv = 3 * nat * nbnd_fs * nbnd_fs * nk1*nk2*nk3 * nspin_lsda
+ ALLOCATE(gep_col(3*nat*nbnd_fs*nbnd_fs, nk1*nk2*nk3, nspin_lsda))
ELSE
nrcv = 1
- ALLOCATE(gg_col(1,1))
+ ALLOCATE(gep_col(1,1,1))
END IF
!
- CALL elph_scdft_gather_r(gg,3 * nat * nbnd_fs * nbnd_fs * nksq2,gg_col,nrcv, &
- & me_image, nproc_image, intra_image_comm)
- !
- CALL mp_sum(nksq2, intra_image_comm)
- !
- WRITE(stdout,*) "Verify SUM(nksq2), nkBZ : ", nksq2, nkBZ
+ CALL elph_scdft_gather(gep, 3*nat*nbnd_fs*nbnd_fs*nksq, gep_col, nrcv, &
+ & my_pool_id, npool, inter_pool_comm)
!
! Write el-ph to file elph.dat
!
@@ -247,8 +106,7 @@ SUBROUTINE elph_scdft()
!
elph_unit = find_free_unit()
!
- WRITE(chiq,*) current_iq
- WRITE(elphname,'(a,a,a)') "elph", TRIM(ADJUSTL(chiq)), ".dat"
+ WRITE(elphname,'(3a,i0)') TRIM(tmp_dir), TRIM(prefix), ".elph", current_iq
!
OPEN(elph_unit,file = TRIM(elphname))
!
@@ -258,73 +116,38 @@ SUBROUTINE elph_scdft()
!
!# of band
!
- WRITE(elph_unit,*) nbnd_fs, elph_nbnd_min
+ WRITE(elph_unit,*) elph_nbnd_min, elph_nbnd_max
!
! q-vector(Crystal cordinate)
!
WRITE(elph_unit,*) MATMUL(xq(1:3), at(1:3, 1:3))
!
- !# of mode
+ ! # of mode
!
WRITE(elph_unit,*) 3 * nat
!
! Frequences[Ryd]
!
DO ii = 1, 3 * nat
- WRITE(elph_unit,*) SQRT(ABS(w2(ii)))
+ WRITE(elph_unit,*) SIGN(SQRT(ABS(w2(ii))), w2(ii))
END DO
WRITE(elph_unit,*) ""
!
! Electron-Phonon matrix
!
- DO ik = 1, nkBZ
- WRITE(elph_unit,'(3e25.15)') gg_col(1:3 * nat * nbnd_fs * nbnd_fs, indx(ik))
- END DO
+ WRITE(elph_unit,'(6e25.15)') &
+ & gep_col(1:3*nat*nbnd_fs*nbnd_fs, 1:nk1*nk2*nk3, 1:nspin_lsda)
!
CLOSE(elph_unit)
!
END IF ! IF(ionode)
!
- DEALLOCATE(sBZ, eqBZ, gg, gg_col)
- !
- DEALLOCATE(symq, cnt, dsp)
- !
- CALL elph_scdft_dmuxc()
+ DEALLOCATE(gep, gep_col)
!
END SUBROUTINE elph_scdft
!
-!----------------------------------------------------------
-SUBROUTINE elph_scdft_cnt_and_dsp(comm,npe,mype,nn,cnt,dsp)
- !--------------------------------------------------------
- !
- ! This routine compute coutnt and disples for MPI
- ! Communicater : comm
- !
- USE mp, ONLY : mp_sum
- !
- INTEGER,INTENT(IN) :: npe, mype, comm, nn
- INTEGER,INTENT(OUT),ALLOCATABLE :: cnt(:), dsp(:)
- !
- INTEGER :: ipe
- !
- IF(ALLOCATED(cnt)) DEALLOCATE(cnt)
- IF(ALLOCATED(dsp)) DEALLOCATE(dsp)
- !
- ALLOCATE(cnt(0:npe-1), dsp(0:npe-1))
- !
- cnt(0:npe - 1) = 0
- cnt(mype) = nn
- CALL mp_sum(cnt, comm)
- !
- dsp(0) = 0
- DO ipe = 1, npe - 1
- dsp(ipe) = dsp(ipe - 1) + cnt(ipe - 1)
- END DO
- !
-END SUBROUTINE elph_scdft_cnt_and_dsp
-!
!------------------------------------------------------------------------
-SUBROUTINE elph_scdft_gather_r(snd,nsnd,rcv,nrcv,mype,npe,comm)
+SUBROUTINE elph_scdft_gather(snd,nsnd,rcv,nrcv,mype,npe,comm)
!----------------------------------------------------------------------
!
! This routine gathers a real matrix to PE 0.
@@ -333,8 +156,8 @@ SUBROUTINE elph_scdft_gather_r(snd,nsnd,rcv,nrcv,mype,npe,comm)
USE mp, ONLY : mp_sum, mp_gather
!
INTEGER,INTENT(IN) :: nsnd, nrcv, mype, npe, comm
- REAL(dp),INTENT(IN) :: snd(nsnd)
- REAL(dp),INTENT(OUT) :: rcv(nrcv)
+ COMPLEX(dp),INTENT(IN) :: snd(nsnd)
+ COMPLEX(dp),INTENT(OUT) :: rcv(nrcv)
!
INTEGER :: cnt(0:npe - 1), dsp(0:npe - 1), ipe
!
@@ -350,113 +173,6 @@ SUBROUTINE elph_scdft_gather_r(snd,nsnd,rcv,nrcv,mype,npe,comm)
!
CALL mp_gather(snd(1:nsnd), rcv(1:nrcv), cnt, dsp, 0, comm)
!
-END SUBROUTINE elph_scdft_gather_r
-!
-!--------------------------------------------------------
-SUBROUTINE elph_scdft_dmuxc()
- !------------------------------------------------------
- !
- ! This routine output the f_{XC} for LDA in G space to a file.
- !
- USE mp, ONLY : mp_sum, mp_max, mp_min
- USE kinds, ONLY : dp
- USE gvect, ONLY : mill
- USE wvfct, ONLY : npwx
- USE klist, ONLY : ngk, igk_k
- USE fft_base, ONLY : dffts
- USE mp_images, ONLY : me_image
- USE mp_pools, ONLY : intra_pool_comm
- USE eqv, ONLY : dmuxc
- !
- INTEGER :: gmin(3), gmax(3), ig, dmxc_unit
- COMPLEX(dp) :: dmxc1(dffts%nnr), dmxc2(npwx)
- COMPLEX(dp),ALLOCATABLE :: dmxc3(:,:,:)
- !
- INTEGER, EXTERNAL :: find_free_unit
- !
- ! Define whole G-grid
- !
- gmin(1:3) = 100
- gmax(1:3) = - 100
- DO ig = 1, ngk(1)
- gmax(1:3) = max(gmax(1:3), mill(1:3, igk_k(ig,1)))
- gmin(1:3) = min(gmin(1:3), mill(1:3, igk_K(ig,1)))
- END DO
- !
- ! FW_FFT dmuxc_r -> dmuxc_G
- !
- dmxc1(1:dffts%nnr) = cmplx(dmuxc(1:dffts%nnr,1,1), 0_dp)
- CALL elph_scdft_fft(dmxc2(1:npwx), dmxc1(1:dffts%nnr), ngk(1), igk_k(:,1), -1)
- !
- CALL mp_max(gmax, intra_pool_comm)
- CALL mp_min(gmin, intra_pool_comm)
- !
- ALLOCATE(dmxc3(gmin(1):gmax(1), gmin(2):gmax(2), gmin(3):gmax(3)))
- !
- dmxc3(gmin(1):gmax(1),gmin(2):gmax(2),gmin(3):gmax(3)) = cmplx(0_dp,0_dp)
- DO ig = 1, ngk(1)
- dmxc3(mill(1,igk_k(ig,1)), mill(2,igk_k(ig,1)), mill(3,igk_k(ig,1))) = dmxc2(ig)
- END DO
- !
- CALL mp_sum(dmxc3, intra_pool_comm)
- !
- IF(me_image == 0) THEN
- !
- dmxc_unit = find_free_unit()
- !
- OPEN(dmxc_unit, file = "dmuxc.dat")
- !
- WRITE(dmxc_unit,*) gmin(1:3)
- WRITE(dmxc_unit,*) gmax(1:3)
- !
- WRITE(dmxc_unit,*) ""
- WRITE(dmxc_unit,'(2e25.15)') dmxc3(gmin(1):gmax(1),gmin(2):gmax(2),gmin(3):gmax(3))
- !
- CLOSE(dmxc_unit)
- !
- END IF
- !
- DEALLOCATE(dmxc3)
- !
-END SUBROUTINE elph_scdft_dmuxc
-!
-!--------------------------------------------------------------------
-SUBROUTINE elph_scdft_fft(evc_g, evc_r, npw, igk, isw)
- !------------------------------------------------------------------
- !
- ! This routine perform inverse-FFT for f_{XC}
- !
- USE kinds, ONLY : dp
- USE wvfct, ONLY : npwx
- USE fft_base, ONLY: dffts
- USE fft_interfaces, ONLY: fwfft, invfft
- !
- INTEGER,INTENT(IN) :: isw
- INTEGER,INTENT(IN) :: npw, igk(npw)
- COMPLEX(dp),INTENT(INOUT) :: evc_g(npwx), evc_r(dffts%nnr)
- !
- INTEGER :: ig
- !
- IF (isw.eq.1) THEN
- !
- evc_r = (0_dp, 0_dp)
- !
- DO ig = 1, npw
- evc_r(dffts%nl(igk(ig))) = evc_g(ig)
- END DO
- !
- CALL invfft ('Wave', evc_r(1:dffts%nnr), dffts)
- !
- ELSE IF(isw.eq.-1) THEN
- !
- CALL fwfft ('Wave', evc_r(1:dffts%nnr), dffts)
- !
- DO ig = 1, npw
- evc_g(ig) = evc_r(dffts%nl(igk(ig)))
- END DO
- !
- END IF
- !
-END SUBROUTINE elph_scdft_fft
+END SUBROUTINE elph_scdft_gather
!
END MODULE elph_scdft_mod
diff --git a/PHonon/PH/elph_tetra_mod.f90 b/PHonon/PH/elph_tetra_mod.f90
index a9ccdf637..8974a6830 100644
--- a/PHonon/PH/elph_tetra_mod.f90
+++ b/PHonon/PH/elph_tetra_mod.f90
@@ -21,7 +21,7 @@ MODULE elph_tetra_mod
INTEGER,SAVE :: elph_tetra = 0 ! switch to output electron-phonon matrix
!
PUBLIC elph_tetra, lshift_q, in_alpha2f, &
- & elph_tetra_lambda, elph_tetra_gamma
+ & elph_tetra_lambda, elph_tetra_gamma, elph_tetra_delta1
!
CONTAINS
!
diff --git a/PHonon/PH/make.depend b/PHonon/PH/make.depend
index fc60607b7..aff747668 100644
--- a/PHonon/PH/make.depend
+++ b/PHonon/PH/make.depend
@@ -518,6 +518,7 @@ do_phonon.o : elph_tetra_mod.o
do_phonon.o : phcom.o
do_phonon.o : yambo.o
do_q2r.o : ../../FFTXlib/fft_scalar.o
+do_q2r.o : ../../Modules/constants.o
do_q2r.o : ../../Modules/environment.o
do_q2r.o : ../../Modules/io_files.o
do_q2r.o : ../../Modules/io_global.o
@@ -526,6 +527,7 @@ do_q2r.o : ../../Modules/mp_global.o
do_q2r.o : ../../Modules/mp_images.o
do_q2r.o : ../../Modules/mp_world.o
do_q2r.o : ../../UtilXlib/mp.o
+do_q2r.o : elph_tetra_mod.o
do_q2r.o : elph.o
do_q2r.o : io_dyn_mat.o
do_q2r.o : io_dyn_mat_old.o
@@ -920,21 +922,15 @@ el_ph_collect.o : ../../Modules/mp_pools.o
el_ph_collect.o : ../../PW/src/pwcom.o
el_ph_collect.o : ../../UtilXlib/mp.o
elph.o : ../../Modules/kind.o
-elph_scdft_mod.o : ../../FFTXlib/fft_interfaces.o
elph_scdft_mod.o : ../../LR_Modules/lrcom.o
elph_scdft_mod.o : ../../Modules/cell_base.o
-elph_scdft_mod.o : ../../Modules/fft_base.o
elph_scdft_mod.o : ../../Modules/io_global.o
elph_scdft_mod.o : ../../Modules/ions_base.o
elph_scdft_mod.o : ../../Modules/kind.o
elph_scdft_mod.o : ../../Modules/mp_images.o
elph_scdft_mod.o : ../../Modules/mp_pools.o
elph_scdft_mod.o : ../../Modules/noncol.o
-elph_scdft_mod.o : ../../Modules/parameters.o
-elph_scdft_mod.o : ../../Modules/recvec.o
-elph_scdft_mod.o : ../../PW/src/pwcom.o
elph_scdft_mod.o : ../../PW/src/start_k.o
-elph_scdft_mod.o : ../../PW/src/symm_base.o
elph_scdft_mod.o : ../../UtilXlib/mp.o