class_bz_grid.f90 16.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
!
! Copyright (C) 2015-2017 M. Govoni 
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
! This file is part of WEST.
!
! Contributors to this file: 
! Matteo Gerosa
!
!-----------------------------------------------------------------------
MODULE class_bz_grid
!-----------------------------------------------------------------------
   !
   USE kinds,            ONLY : DP
   !
   IMPLICIT NONE
   !
   PRIVATE
   !
   TYPE, PUBLIC :: bz_grid
      !
25
      INTEGER :: ngrid(3) = (/ 1, 1, 1 /)       ! number of points in each direction
Marco Govoni's avatar
Marco Govoni committed
26
      INTEGER :: np = 1                         ! total number of points = ngrid(1) * ngrid(2) * ngrid(3) **** NOOOOOO ****** 
27
28
29
30
31
32
33
34
35
      INTEGER :: ns = 1                         ! total number of spin = nspin
      INTEGER :: nps = 1                        ! total number of points and spins = np * ns
      INTEGER,ALLOCATABLE :: ip(:)              ! given ips --> ip   
      INTEGER,ALLOCATABLE :: is(:)              ! given ips --> is   
      REAL(DP), ALLOCATABLE :: p_cryst(:,:)     ! coordinates of point p in crystal                [ 1:np  ] 
      REAL(DP), ALLOCATABLE :: p_cart(:,:)      ! coordinates of point p in cart ( tpiba units )   [ 1:np  ]
      REAL(DP), ALLOCATABLE :: weight(:)        ! weight of point p (sum of weights = nspin)       [ 1:nps ]
      LOGICAL, ALLOCATABLE :: l_pIsGamma(:)     ! .true. if point p = (0,0,0), else .false.        [ 1:np  ]
      !
36
37
      CONTAINS
      !
38
39
      PROCEDURE :: init => k_or_q_grid_init
      PROCEDURE :: find => findp
40
41
42
43
44
45
      !
   END TYPE bz_grid
   !
   CONTAINS
   !
   !
46
47
48
49
   !
   SUBROUTINE k_or_q_grid_init( this, grid_type )
      !
      ! ... grid_type = [ "K", "Q" ]
50
51
52
53
      !
      USE cell_base,        ONLY : at, bg
      USE klist,            ONLY : xk, wk, nkstot
      USE start_k,          ONLY : nk1, nk2, nk3
54
      USE pwcom,            ONLY : nspin
55
      USE control_flags,    ONLY : gamma_only
Marco Govoni's avatar
Marco Govoni committed
56
      !USE westcom,          ONLY : nq
57
      USE constants,        ONLY : eps8
Marco Govoni's avatar
Marco Govoni committed
58
      USE westcom,          ONLY : qlist
59
60
61
62
63
      !
      IMPLICIT NONE
      !
      ! I/O
      !
64
      CLASS(bz_grid), INTENT(INOUT) :: this
65
66
67
68
      CHARACTER(LEN=1), INTENT(IN) :: grid_type
      !
      ! Workspace
      !
69
70
      INTEGER :: ip, iq1, iq2, iq3, ips
      INTEGER :: i, j, k
Marco Govoni's avatar
Marco Govoni committed
71
      INTEGER :: iqlist
72
73
74
75
      !
      SELECT CASE( grid_type )
      CASE ( 'K', 'k')
         !
76
77
         ! This is a workaround to prevent ngrid(:) to be set to (/ 0, 0, 0 /) in the gamma_only case (espresso default)
         IF ( .NOT. gamma_only ) this%ngrid(1:3) = (/ nk1, nk2, nk3 /) 
78
         this%np = this%ngrid(1) * this%ngrid(2) * this%ngrid(3) 
79
80
         this%ns = nspin 
         this%nps = nkstot   !    =   np * ns  
81
         !
82
         ! generate p-vectors in cart 
83
         !
84
85
86
         ALLOCATE ( this%p_cart (3,this%np) )
         DO ip = 1, this%np
            this%p_cart(:,ip) = xk(:,ip)
87
88
         ENDDO
         !
89
90
91
92
93
94
95
96
         ! generate p-vectors in cryst  
         !
         ALLOCATE ( this%p_cryst  (3,this%np) )
         this%p_cryst(:,:) = this%p_cart(:,:) 
         CALL cryst_to_cart( this%nps, this%p_cryst, at, -1 )
         !
         ! set weights 
         !
97
         ALLOCATE ( this%weight (this%nps) )
98
99
         DO ips = 1, this%nps
           this%weight(ips) = wk(ips)
100
101
102
103
         ENDDO
         !
      CASE ( 'Q', 'q')
         !
Marco Govoni's avatar
Marco Govoni committed
104
105
106
107
108
         !this%ngrid(1:3) = nq(1:3) 
         IF ( .NOT. gamma_only ) this%ngrid(1:3) = (/ nk1, nk2, nk3 /)
         !this%ngrid(1:3) = nq(1:3) 
         !this%np = this%ngrid(1) * this%ngrid(2) * this%ngrid(3)
         this%np = SIZE(qlist) 
109
110
         this%ns = 1
         this%nps = this%np 
111
         !
112
         ! generate p-vectors in cryst 
113
         !
114
         ALLOCATE ( this%p_cryst  (3,this%np) )
Marco Govoni's avatar
Marco Govoni committed
115
         iqlist = 0 
116
         ip = 0
Marco Govoni's avatar
Marco Govoni committed
117
118
119
         DO iq1 = 1, this%ngrid(1)
            DO iq2 = 1, this%ngrid(2)
               DO iq3 = 1, this%ngrid(3)
120
                  ip = ip + 1
Marco Govoni's avatar
Marco Govoni committed
121
122
123
124
125
126
                  IF ( ANY(qlist(:)) == ip ) THEN 
                     iqlist = iqlist + 1 
                     this%p_cryst(1,iqlist) = DBLE( iq1 - 1 ) / DBLE( this%ngrid(1) ) 
                     this%p_cryst(2,iqlist) = DBLE( iq2 - 1 ) / DBLE( this%ngrid(2) )
                     this%p_cryst(3,iqlist) = DBLE( iq3 - 1 ) / DBLE( this%ngrid(3) )
                  ENDIF
127
128
129
130
               ENDDO
            ENDDO
         ENDDO
         !
131
         ! generate p-vectors in cart
132
         !
133
134
         ALLOCATE ( this%p_cart (3,this%np) )
         this%p_cart(:,:) = this%p_cryst(:,:)
Marco Govoni's avatar
Marco Govoni committed
135
         CALL cryst_to_cart( this%np, this%p_cart, bg, +1 )
136
         !
137
138
         ! set weights 
         !
Marco Govoni's avatar
Marco Govoni committed
139
         ALLOCATE ( this%weight (this%np)   )
140
141
         !
         this%weight = 1._DP / DBLE(this%np)
142
         !
143
      END SELECT
144
      !
145
146
      ALLOCATE ( this%ip( this%nps ) ) 
      ALLOCATE ( this%is( this%nps ) ) 
147
      !
148
      ! generate map ips --> ip and is
149
      !
150
151
      this%ip = 0 
      this%is = 0 
152
153
154
155
156
157
      k = 0 
      DO i = 1, this%ns
         DO j = 1, this%np
            k = k+1 
            this%ip(k) = j
            this%is(k) = i
158
         ENDDO
159
      ENDDO
160
      !
161
      ALLOCATE( this%l_pIsGamma(this%np) )
162
      this%l_pIsGamma(:)=.FALSE.
163
      DO ip = 1, this%np
164
165
         this%l_pIsGamma(ip) = ( ALL( ABS ( this%p_cryst(:,ip) ) .LT. eps8 ) )
      ENDDO
166
167
168
169
      !
   END SUBROUTINE
   !
   !
170
171
172
   !FUNCTION findp(this,p,unit_type) RESULT(ip)
   SUBROUTINE findp( this, p, is, unit_type, ip, g0 )
      ! 
173
174
      ! ... ip is the index of p (unit_type = [ "cryst", "cart"])
      ! ... if on exit ip == 0 --> p is not commensurate with this grid
175
      ! ... g0 relates p to an equivalent vector inside the 1BZ
176
177
      !
      USE constants, ONLY : eps8 
178
      USE cell_base, ONLY : at, bg
179
180
181
      !
      IMPLICIT NONE
      !
182
      ! I/O 
183
      !
184
185
186
187
188
189
      CLASS(bz_grid), INTENT(IN) :: this 
      REAL(DP), INTENT(IN) :: p(3)
      INTEGER, INTENT(IN) :: is
      CHARACTER(LEN=*), INTENT(IN) :: unit_type
      INTEGER, INTENT(OUT) :: ip
      REAL(DP), INTENT(OUT) :: g0(3)
190
191
      !
      ! Workspace
192
193
      ! 
      INTEGER :: i
194
      REAL(DP) :: deltap(3)
195
196
197
198
      !
      SELECT CASE(unit_type) 
      CASE("cryst","cart")
      CASE DEFAULT
199
         CALL errore( "types_bz_grid", "unit_type not supported, supported only cryst or cart", 1 )  
200
201
      END SELECT 
      !
202
      ! The search must be performed in crystalline coordinates
203
      !
204
      IF ( unit_type == "cart" ) CALL cryst_to_cart( 1, p, at, -1 )
205
      !
206
207
      ip = 0
      DO i = 1, this%np
208
209
         deltap(:) = p(:) - this%p_cryst(:,i) - NINT( p(:) - this%p_cryst(:,i) )
         IF ( ALL ( ABS ( deltap ) .LT. eps8 ) ) THEN
210
211
212
213
214
            ip = i + (is-1) * this%np
            g0(:) = p(:) - this%p_cryst(:,ip)
            EXIT
         ENDIF
      ENDDO
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
      ! Tranform g0 back to cartesian coordinates if needed
      !
      IF ( unit_type == "cart" ) CALL cryst_to_cart( 1, g0, bg, 1 ) 
      !      
      !ip = 0 
      !SELECT CASE( unit_type ) 
      !CASE("cryst")
      !   DO i = 1, this%np
      !      IF( ( ALL( ABS ( p(:) - this%p_cryst(:,i) ) .LT. eps8 ) ) ) THEN 
      !         ip = i 
      !         EXIT
      !      ENDIF
      !   ENDDO
      !CASE("cart")
      !   DO i = 1, this%np
      !      IF( ( ALL( ABS ( p(:) - this%p_cart(:,i) ) .LT. eps8 ) ) ) THEN  
      !         ip = i 
      !         EXIT
      !      ENDIF
      !   ENDDO
      !CASE DEFAULT
      !   CALL errore( "class_bz_grid", "unit_type not supported, supported only cryst or cart", 1 )  
      !END SELECT
      !
   !END FUNCTION
241
   END SUBROUTINE
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
   !
   !
   !SUBROUTINE addp( this, pin1, pin2, pout, g0, unit_type )
   !   !
   !   ! ... out : pout and g0 
   !   ! ... pout = pin1 + pin2 - g0   ( g0 makes sure that pout is in 1BZ ) 
   !   ! ... unit_type determines the units of pin1, pin2 and pout, g0  
   !   !
   !   USE cell_base,        ONLY : at, bg
   !   USE constants,        ONLY : eps8
   !   !
   !   IMPLICIT NONE
   !   !
   !   ! I/O
   !   !
   !   CLASS(bz_grid), INTENT(IN) :: this
   !   REAL(DP), INTENT(IN) :: pin1(3), pin2(3) 
   !   REAL(DP), INTENT(OUT) :: pout(3)
   !   REAL(DP), INTENT(OUT) :: g0(3)
   !   CHARACTER(LEN=*),INTENT(IN) :: unit_type
   !   !
   !   ! Workspace
   !   !
   !   REAL(DP) :: ptemp(3)  
   !   !
   !   SELECT CASE(unit_type) 
   !   CASE("cryst","cart")
   !   CASE DEFAULT
   !      CALL errore( "types_bz_grid", "unit_type not supported, supported only cryst or cart", 1 )  
   !   END SELECT 
   !   !   
   !   ptemp = pin1 + pin2
   !   IF( unit_type == "cart" ) CALL cryst_to_cart( 1, ptemp, at, -1 )
   !   !
   !   ! ptemp is now in cryst  
   !   !
   !   g0 = NINT( ptemp ) ! in cryst 
   !   pout = ptemp - g0  ! in cryst 
   !   !
   !   IF( unit_type == "cart" ) THEN 
   !      CALL cryst_to_cart( 1, pout , bg, 1 )
   !      CALL cryst_to_cart( 1, g0   , bg, 1 )
   !   ENDIF  
   !   !
   !END SUBROUTINE
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
!     !
!     IF ( sig == +1 ) THEN
!        csig = '+'
!     ELSE
!        csig = '-'
!     ENDIF
!     !
!     nks = kgrid%nps
!     nqs = qgrid%nps
!     !
!     ALLOCATE( temp_xkq(3,nks), temp_wkq(nks) )
!     ALLOCATE( new_ikq(nks), temp_index_ikq(nks) )
!     !
!     temp_xkq = kgrid%xp_cryst
!     temp_wkq = kgrid%wp
!     !
!     ALLOCATE( kqgrid%index_kq(nks,nqs) )
!     ALLOCATE( kqgrid%g0(3,nks,nqs) )
!     !
!     nkqs = 0
!     new_ikq = 0
!     kqgrid%g0 = 0._DP
!     !
!     DO ik = 1, nks
!        DO iq = 1, nqs
!           !
!           xkq(:) = kgrid%xp_cryst(:,ik) + DBLE(sig) * qgrid%xp_cryst(:,iq) 
!           !
!           xk_not_found = .TRUE.
!           !
!           DO ikq = 1, nks
!              IF ( xk_not_found ) THEN
!                 dxk(:) = xkq(:)-temp_xkq(:,ikq) - NINT( xkq(:)-temp_xkq(:,ikq) )
!                 IF ( ALL( ABS( dxk ) < eps ) ) THEN
!                    xk_not_found = .FALSE.
!                    IF ( new_ikq(ikq) == 0 ) THEN
!                       nkqs = nkqs + 1
!                       temp_index_ikq(nkqs) = ikq
!                       new_ikq(ikq) = nkqs
!                    ENDIF
!                    kqgrid%index_kq(ik,iq) = new_ikq(ikq)
!                    kqgrid%g0(:,ik,iq) = xkq(:) - temp_xkq(:,ikq)
!                    CALL cryst_to_cart(1, kqgrid%g0(1,ik,iq), bg, +1)
!                 ENDIF
!              ENDIF
!           ENDDO ! ikq
!           !
!           IF ( xk_not_found ) THEN
!              WRITE(*,*) ik, iq, nkqs
!              WRITE(*,*) xkq(:)
!              WRITE(message,'(a,a,a)')'k ',TRIM( csig ),' q does not belong to k-point grid '
!              CALL errore( 'kq_grid_init', TRIM( message ), (ik-1) * nqs + iq )
!           ENDIF
!           !
!        ENDDO ! iq
!        !
!     ENDDO ! ik
!     !
!     ALLOCATE( kqgrid%xp_cryst(3,nspin*nkqs) , kqgrid%xp_cart(3,nspin*nkqs), kqgrid%wp(nspin*nkqs) )
!     !
!     DO ik = 1, nkqs
!        ikq = temp_index_ikq(ik)
!        kqgrid%xp_cryst(:,ik) = temp_xkq(:,ikq)
!        kqgrid%wp(ik) = temp_wkq(ikq)
!     ENDDO
!     !
!     kqgrid%xp_cart = kqgrid%xp_cryst
!     CALL cryst_to_cart(nkqs, kqgrid%xp_cart, bg, +1)
!     !
!     IF ( nspin == 2 ) THEN
!        !
!        DO ik = 1, nks/2
!            DO iq =1, nqs
!              kqgrid%index_kq(nks/2+ik,iq) = kqgrid%index_kq(ik,iq) + nkqs
!            ENDDO
!        ENDDO
!        !
!        DO ikq = 1, nkqs
!           kqgrid%xp_cart(:,ikq + nkqs) = kqgrid%xp_cart(:,ikq)
!           kqgrid%xp_cryst(:,ikq + nkqs) = kqgrid%xp_cryst(:,ikq)
!        ENDDO
!        !
!        nkqs = 2*nkqs
!     ENDIF
!     !
!     kqgrid%nps = nkqs
!     !
!     DEALLOCATE( new_ikq, temp_index_ikq )
!     DEALLOCATE( temp_xkq, temp_wkq )
376
377
!      !
!   END SUBROUTINE
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
   !
   !
!  SUBROUTINE q_grid_init( qgrid, kgrid, k1grid )
!     !
!     USE cell_base,        ONLY : at, bg
!     USE klist,            ONLY : xk, wk, nkstot
!     USE pwcom,            ONLY : nspin
!     USE westcom,          ONLY : nq
!     !
!     IMPLICIT NONE
!     !
!     ! I/O
!     !
!     CLASS(bz_grid), INTENT(OUT) :: qgrid
!     CLASS(bz_grid), INTENT(IN) :: kgrid, k1grid
!     !
!     ! Workspace
!     !
!     INTEGER :: ik, ikk, iq, iqq, iq1, iq2, iq3, ipol, ig
!     INTEGER :: nks, nks1, nqs, temp_nqs
!     INTEGER, ALLOCATABLE :: new_iq(:), temp_index_iq(:)
!     REAL(DP) :: xq(3)
!     REAL(DP), ALLOCATABLE :: temp_xq(:,:), temp_wq(:)
!     REAL(DP) :: dxq(3), dq1, dq2, dq3
!     LOGICAL :: xq_not_found
!     CHARACTER(LEN=256) :: message
!     CHARACTER(LEN=1) :: csig
!     REAL(DP) :: eps = 1.D-8
!     !
!     nks = kgrid%nps
!     nks1 = k1grid%nps
!     temp_nqs = nq(1)*nq(2)*nq(3)
!     !
!     ALLOCATE( temp_xq(3,temp_nqs), temp_wq(temp_nqs) )
!     ALLOCATE( new_iq(temp_nqs), temp_index_iq(temp_nqs) )
!     !
!     dq1 = 1._DP / DBLE(nq(1))
!     dq2 = 1._DP / DBLE(nq(2))
!     dq3 = 1._DP / DBLE(nq(3))
!     iq = 0
!     DO iq1 = 1, nq(1)
!        DO iq2 = 1, nq(2)
!           DO iq3 = 1, nq(3)
!              iq = iq + 1
!              temp_xq(1,iq) = DBLE( iq1 - 1 ) * dq1
!              temp_xq(2,iq) = DBLE( iq2 - 1 ) * dq2
!              temp_xq(3,iq) = DBLE( iq3 - 1 ) * dq3
!           ENDDO
!        ENDDO
!     ENDDO
!     temp_wq = 1 / DBLE(nq(1)*nq(2)*nq(3))
!     !
!     ALLOCATE( qgrid%index_q(nks,nks) )
!     ALLOCATE( qgrid%g0(3,nks,nks) )
!     !
!     nqs = 0
!     new_iq = 0
!     qgrid%g0 = 0._DP
!     !
!     DO ik = 1, nks
!        !
!        DO ikk = 1, nks1
!           !
!           xq(:) = kgrid%xp_cryst(:,ik) - k1grid%xp_cryst(:,ikk) 
!           !
!           xq_not_found = .TRUE.
!           !
!           DO iq = 1, temp_nqs
!              IF ( xq_not_found ) THEN
!                 dxq(:) = xq(:)-temp_xq(:,iq) - NINT( xq(:)-temp_xq(:,iq) )
!                 IF ( ALL( ABS( dxq ) < eps ) ) THEN
!                    xq_not_found = .FALSE.
!                    IF ( new_iq(iq) == 0 ) THEN
!                       nqs = nqs + 1
!                       temp_index_iq(nqs) = iq
!                       new_iq(iq) = nqs
!                    ENDIF
!                    qgrid%index_q(ik,ikk) = new_iq(iq)
!                    qgrid%g0(:,ik,ikk) = xq(:) - temp_xq(:,iq)
!                    CALL cryst_to_cart(1, qgrid%g0(1,ik,ikk), bg, +1)
!                 ENDIF
!              ENDIF
!           ENDDO ! iq
!           !
!           IF ( xq_not_found ) THEN
!              WRITE(*,*) ik, ikk, nqs
!              WRITE(*,*) xq(:)
!              WRITE(message,'(a)') " k - k' is not a commensurate with k-point grid "
!              CALL errore( 'q_grid_init', TRIM( message ), (ik-1) * nqs + ikk )
!           ENDIF
!           !
!        ENDDO ! ikk
!        !
!     ENDDO ! ik
!     !
!     ALLOCATE( qgrid%xp_cryst(3,nqs) , qgrid%xp_cart(3,nqs), qgrid%wp(nqs) )
!     !
!     DO iqq = 1, nqs
!        iq = temp_index_iq(iqq)
!        qgrid%xp_cryst(:,iqq) = temp_xq(:,iq)
!        qgrid%wp(iqq) = temp_wq(iq)
!     ENDDO
!     !
!     qgrid%xp_cart = qgrid%xp_cryst
!     CALL cryst_to_cart(nqs, qgrid%xp_cart, bg, +1)
!     !
!     ALLOCATE( qgrid%l_gammap(nqs) )
!     qgrid%l_gammap(:)=.FALSE.
!     DO iq = 1, nqs
!        qgrid%l_gammap(iq) = ( ALL( ABS ( qgrid%xp_cryst(:,iq) ) .LT. eps ) )
!     ENDDO
!     !
!     qgrid%nps = nqs
!     !
!     DEALLOCATE( new_iq, temp_index_iq )
!     DEALLOCATE( temp_xq, temp_wq )
!     !
!  END SUBROUTINE
!  !
!  SUBROUTINE get_phase( grid_aux, ik, ikk )
!     !
!     USE cell_base,        ONLY : bg
!     USE gvecs,            ONLY : ngms, nls
!     USE gvect,            ONLY : g
!     USE fft_base,         ONLY : dffts
!     USE fft_interfaces,   ONLY : invfft
!     !
!     IMPLICIT NONE
!     !
!     ! I/O
!     !
!     CLASS(bz_grid), INTENT(INOUT) :: grid_aux
!     INTEGER, INTENT(IN) :: ik, ikk
!     !
!     ! Workspace
!     !
!     INTEGER :: ipol, ig, ig0
!     REAL(DP) :: eps = 1.D-8
!     !
!     ig0 = 0
!     DO ig = 1, ngms
!        IF ( ALL ( ABS( g(:,ig) - grid_aux%g0(:,ik,ikk) ) < eps ) ) THEN
!           ig0 = ig
!        ENDIF
!     ENDDO
!     !
!     IF (.NOT. ALLOCATED(grid_aux%phase) ) ALLOCATE ( grid_aux%phase(dffts%nnr) )
!     grid_aux%phase = (0._DP, 0._DP)
!     IF ( ig0 > 0 ) THEN
!        grid_aux%phase( nls(ig0) ) = (1._DP, 0._DP)
!     ENDIF
!     ! phase = exp(-iG_0*r)
!     CALL invfft( 'Wave', grid_aux%phase, dffts )
!     grid_aux%phase(1:dffts%nnr) = CONJG( grid_aux%phase(1:dffts%nnr) )
!     !
!  END SUBROUTINE
534
535
   ! 
END MODULE