File: initialize_ph.f90

package info (click to toggle)
espresso 6.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 311,068 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,503; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (104 lines) | stat: -rw-r--r-- 2,524 bytes parent folder | download | duplicates (3)
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
!
! Copyright (C) 2009 Quantum ESPRESSO group
! 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 .
!
!-----------------------------------------------------------------------
SUBROUTINE initialize_ph()
  !-----------------------------------------------------------------------
  !
  ! This is a driver to the phonon initialization routines.
  !
  USE klist,  ONLY : nks, nkstot
  !
  USE qpoint, ONLY : nksq, nksqtot, ikks, ikqs
  USE qpoint_aux, ONLY : ikmks, ikmkmqs
  USE control_lr, ONLY : lgamma
  USE noncollin_module, ONLY : noncolin
  USE spin_orb,   ONLY : domag
  !
  IMPLICIT NONE
  INTEGER :: ik
  !
  ! ... nksq is the number of k-points, NOT including k+q points
  !
  IF ( lgamma ) THEN
     !
     IF (noncolin.AND.domag) THEN
        nksq = nks/2
        nksqtot = nkstot/2
        ALLOCATE(ikks(nksq), ikqs(nksq))
        ALLOCATE(ikmks(nksq), ikmkmqs(nksq))
        DO ik=1,nksq
           ikks(ik) = 2*ik-1
           ikqs(ik) = 2*ik-1
           ikmks(ik) = 2*ik
           ikmkmqs(ik) = 2*ik
        ENDDO
     ELSE
        nksq = nks
        nksqtot = nkstot
        ALLOCATE(ikks(nksq), ikqs(nksq))
        DO ik=1,nksq
           ikks(ik) = ik
           ikqs(ik) = ik
        ENDDO
     END IF
     !
  ELSE
     !
     IF (noncolin.AND.domag) THEN
        nksq = nks / 4
        nksqtot = nkstot / 4
        ALLOCATE(ikks(nksq), ikqs(nksq))
        ALLOCATE(ikmks(nksq), ikmkmqs(nksq))
        DO ik=1,nksq
           ikks(ik) = 4 * ik - 3
           ikqs(ik) = 4 * ik - 2
           ikmks(ik) = 4 * ik - 1
           ikmkmqs(ik) = 4 * ik 
        ENDDO
     ELSE
        nksq = nks / 2
        nksqtot = nkstot / 2
        ALLOCATE(ikks(nksq), ikqs(nksq))
        DO ik=1,nksq
           ikks(ik) = 2 * ik - 1
           ikqs(ik) = 2 * ik
        ENDDO
     END IF
     !
  END IF
  !
  !  Allocate the phonon variables
  !
  CALL allocate_phq()
  !
  !  Set the main control variable of the phonon code
  !
  CALL phq_setup()
  !
  !  Recover the status if available
  !
  CALL phq_recover()
  !
  !  Output summary of the main variables of the phonon code
  !
  CALL phq_summary()
  !
  !  Open the files of the phonon code
  !
  CALL openfilq()
  !
  !  Initialize all quantities which do not depend on the
  !  linear response to the perturbation
  !
  CALL phq_init()
  !
  CALL print_clock( 'PHONON' )
  !
  RETURN

END SUBROUTINE initialize_ph