westcom.f90 6.89 KB
Newer Older
Marco Govoni's avatar
Marco Govoni committed
1
!
2
! Copyright (C) 2015-2017 M. Govoni 
Marco Govoni's avatar
Marco Govoni committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! 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: 
! Marco Govoni
!
!-----------------------------------------------------------------------
MODULE scratch_area
  !-----------------------------------------------------------------------
  !
  USE kinds, ONLY :  DP
Marco Govoni's avatar
Marco Govoni committed
18
  USE fft_types, ONLY : fft_type_descriptor
Marco Govoni's avatar
Marco Govoni committed
19
20
21
  !
  SAVE
  !
22
  ! COULOMB
23
  INTEGER              :: npwq,npwqx,npwq_g
Marco Govoni's avatar
Marco Govoni committed
24
25
26
27
28
29
30
31
32
33
34
35
36
  CHARACTER(LEN=6)     :: fftdriver
  INTEGER,ALLOCATABLE  :: iks_l2g(:)
  !
  ! DBS
  REAL(DP),ALLOCATABLE    :: ev(:)
  REAL(DP),ALLOCATABLE    :: ev_distr(:)
  COMPLEX(DP),ALLOCATABLE :: dng(:,:)
  COMPLEX(DP),ALLOCATABLE :: dvg(:,:)
  LOGICAL,ALLOCATABLE     :: conv(:)
  !
  ! BANDS
  INTEGER,ALLOCATABLE :: nbnd_occ(:) 
  !
37
  ! Q-POINTS
Marco Govoni's avatar
Marco Govoni committed
38
39
40
  INTEGER, ALLOCATABLE :: ngq(:)            ! equivalent of ngk(:) --> ex. ngq(iq) = LOCAL number of PW for (q+G) (global in iq)
  INTEGER, ALLOCATABLE :: igq_q(:,:)        ! equivalent of igk_k(:,:) --> ex. igq_q(ig,iq) = map for FFT (global in iq ) 
  INTEGER, ALLOCATABLE :: ngq_g(:)          ! equivalent of ngk_g(:) --> ex. ngk_g(iq) = TOTAL number of PW for (q+G) (global in iq)  
41
  ! INTEGER, ALLOCATABLE :: igq_l2g(:,:)      ! equivalent of igk_l2g(:,:) --> ex. iqq_l2g(ig,iq) => correspondence between the local (q+G) index and the global G index 
42
  ! INTEGER, ALLOCATABLE :: igq_l2g_kdip(:,:) ! equivalent of igk_l2g_kdip(:,:) --> ex. iqq_l2g_kdip(ig,iq) => correspondence between the global order of (q+G) and the local index for (q+G).
43
  !
Marco Govoni's avatar
Marco Govoni committed
44
45
46
47
48
  ! EPSILON
  REAL(DP),ALLOCATABLE    :: d_epsm1_ifr(:,:,:)
  COMPLEX(DP),ALLOCATABLE :: z_epsm1_ifr(:,:,:)
  COMPLEX(DP),ALLOCATABLE :: z_epsm1_rfr(:,:,:)
  !
49
  ! EPSILON with q-points
Marco Govoni's avatar
Marco Govoni committed
50
51
  COMPLEX(DP), ALLOCATABLE :: z_epsm1_ifr_q(:,:,:,:) ! EPSILON + iq  (global in iq) 
  COMPLEX(DP), ALLOCATABLE :: z_epsm1_rfr_q(:,:,:,:) ! EPSILON + iq  (global in iq) 
52
  !
Marco Govoni's avatar
Marco Govoni committed
53
54
55
56
57
58
59
60
61
62
63
  ! CORRELATION
  REAL(DP),ALLOCATABLE    :: d_head_ifr(:)
  COMPLEX(DP),ALLOCATABLE :: z_head_ifr(:)
  REAL(DP),ALLOCATABLE    :: d_body1_ifr(:,:,:,:)
  COMPLEX(DP),ALLOCATABLE :: z_body1_ifr(:,:,:,:)
  REAL(DP),ALLOCATABLE    :: d_body2_ifr(:,:,:,:,:)
  COMPLEX(DP),ALLOCATABLE :: z_body2_ifr(:,:,:,:,:)
  REAL(DP),ALLOCATABLE    :: d_diago(:,:,:,:)
  COMPLEX(DP),ALLOCATABLE :: z_head_rfr(:)
  COMPLEX(DP),ALLOCATABLE :: z_body_rfr(:,:,:,:) 
  !
64
  ! CORRELATION with q-points
Marco Govoni's avatar
Marco Govoni committed
65
66
67
68
  COMPLEX(DP), ALLOCATABLE :: z_body1_ifr_q(:,:,:,:,:)   ! CORRELATION + iq  (global in iq)
  COMPLEX(DP), ALLOCATABLE :: z_body2_ifr_q(:,:,:,:,:,:) ! CORRELATION + iq  (global in iq)
  REAL(DP),    ALLOCATABLE :: d_diago_q(:,:,:,:,:)       ! CORRELATION + iq  (global in iq)
  COMPLEX(DP), ALLOCATABLE :: z_body_rfr_q (:,:,:,:,:)   ! CORRELATION + iq  (global in iq)
69
  !
Marco Govoni's avatar
Marco Govoni committed
70
71
72
  ! I/O 
  !INTEGER :: io_comm ! communicator for head of images (me_bgrp==0)
  !
Marco Govoni's avatar
Marco Govoni committed
73
74
  TYPE ( fft_type_descriptor ) :: dfft_io
  !
Marco Govoni's avatar
Marco Govoni committed
75
76
77
78
79
80
81
82
83
END MODULE
!
!
MODULE westin
  !
  USE kinds, ONLY :  DP
  !
  SAVE
  !
84
85
86
87
  CHARACTER(LEN=512) :: outdir             ! main directory 
  CHARACTER(LEN=512) :: west_prefix
  CHARACTER(LEN=512) :: qe_prefix
  CHARACTER(LEN=512) :: savedir            ! outdir/west_prefix.code.save
Marco Govoni's avatar
Marco Govoni committed
88
  CHARACTER(LEN=512) :: main_input_file    ! input file
Marco Govoni's avatar
Marco Govoni committed
89
  CHARACTER(LEN=512) :: logfile ! savedir/logfile.json 
90
  !
Marco Govoni's avatar
Marco Govoni committed
91
92
93
94
95
96
97
98
99
100
101
END MODULE  
!
!
MODULE wstat_center
  !
  USE kinds, ONLY :  DP
  !
  SAVE
  !
  ! INPUT FOR wstat_control
  !
102
  CHARACTER(LEN=2) :: wstat_calculation 
Marco Govoni's avatar
Marco Govoni committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  INTEGER :: n_pdep_basis
  INTEGER :: n_pdep_times
  INTEGER :: n_pdep_eigen
  INTEGER :: n_pdep_maxiter
  INTEGER :: n_dfpt_maxiter
  INTEGER :: n_steps_write_restart
  INTEGER :: n_pdep_restart_from_itr
  INTEGER :: n_pdep_read_from_file
  REAL(DP) :: trev_pdep
  REAL(DP) :: trev_pdep_rel
  REAL(DP) :: tr2_dfpt
  LOGICAL :: l_deflate
  LOGICAL :: l_kinetic_only
  LOGICAL :: l_minimize_exx_if_active
  LOGICAL :: l_use_ecutrho
Marco Govoni's avatar
Marco Govoni committed
118
119
  !INTEGER :: nq(3)  
  INTEGER, ALLOCATABLE :: qlist(:)
Marco Govoni's avatar
Marco Govoni committed
120
121
122
123
  !
  ! Common workspace
  !
  COMPLEX(DP) :: alphapv_dfpt
124
125
  CHARACTER(LEN=512) :: wstat_save_dir
  CHARACTER(LEN=512) :: wstat_restart_dir
Marco Govoni's avatar
Marco Govoni committed
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
  LOGICAL :: l_is_wstat_converged
  !
END MODULE 
!
!
MODULE wfreq_center
  !
  USE kinds, ONLY : DP
  !
  SAVE
  !
  ! INPUT FOR wfreq_control
  !
  CHARACTER(LEN=8) :: wfreq_calculation
  INTEGER :: n_lanczos
  INTEGER :: n_pdep_eigen_to_use
  INTEGER :: n_imfreq
  INTEGER :: n_refreq
  INTEGER :: qp_bandrange(2)
  REAL(DP) :: ecut_imfreq
  REAL(DP) :: ecut_refreq
  REAL(DP) :: wfreq_eta
  INTEGER :: n_secant_maxiter
  REAL(DP) :: trev_secant
  LOGICAL :: l_enable_lanczos
  LOGICAL :: l_enable_gwetot
Marco Govoni's avatar
Marco Govoni committed
152
  CHARACTER(LEN=1) :: macropol_calculation
Marco Govoni's avatar
Marco Govoni committed
153
154
155
156
157
158
159
  REAL(DP) :: exx_etot
  REAL(DP) :: o_restart_time
  REAL(DP) :: ecut_spectralf(2)
  INTEGER :: n_spectralf
  !
  ! Common workspace
  !
160
161
  CHARACTER(LEN=512) :: wfreq_save_dir
  CHARACTER(LEN=512) :: wfreq_restart_dir
Marco Govoni's avatar
Marco Govoni committed
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
  LOGICAL,PARAMETER :: l_skip_nl_part_of_hcomr=.FALSE.
  LOGICAL :: l_macropol
  !
  ! re freq 
  !
  REAL(DP),ALLOCATABLE :: refreq_list(:)
  !
  ! im freq
  !
  REAL(DP),ALLOCATABLE :: imfreq_list(:)
  REAL(DP),ALLOCATABLE :: imfreq_list_integrate(:,:)
  REAL(DP),PARAMETER :: frequency_list_power = 2._DP
  !
  ! gw_etot 
  !
  REAL(DP) :: dft_etot
  REAL(DP) :: dft_exc
  REAL(DP) :: gw_ecorr
  REAL(DP) :: gw_exx
  REAL(DP) :: gw_exc
  !
  ! output
  !
  REAL(DP),ALLOCATABLE    :: sigma_exx       (:,:)
  REAL(DP),ALLOCATABLE    :: sigma_vxcl      (:,:)
  REAL(DP),ALLOCATABLE    :: sigma_vxcnl     (:,:)
  REAL(DP),ALLOCATABLE    :: sigma_hf        (:,:)
  REAL(DP),ALLOCATABLE    :: sigma_z         (:,:)
  REAL(DP),ALLOCATABLE    :: sigma_eqplin    (:,:)
  REAL(DP),ALLOCATABLE    :: sigma_eqpsec    (:,:)
  COMPLEX(DP),ALLOCATABLE :: sigma_sc_eks    (:,:)
  COMPLEX(DP),ALLOCATABLE :: sigma_sc_eqplin (:,:)
  COMPLEX(DP),ALLOCATABLE :: sigma_sc_eqpsec (:,:)
Govoni's avatar
Govoni committed
195
  REAL(DP),ALLOCATABLE     :: sigma_diff      (:,:)
Marco Govoni's avatar
Marco Govoni committed
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
  COMPLEX(DP),ALLOCATABLE :: sigma_spectralf (:,:,:)
  REAL(DP),ALLOCATABLE    :: sigma_freq      (:)
  !
END MODULE
!
!
MODULE westpp_center
  !
  USE kinds, ONLY : DP
  !
  SAVE
  !
  ! INPUT FOR wfreq_control
  !
  CHARACTER(LEN=8) :: westpp_calculation
  CHARACTER(LEN=7) :: westpp_format
  INTEGER :: westpp_n_pdep_eigen_to_use
  INTEGER :: westpp_range(2)
  LOGICAL :: westpp_sign
  REAL(DP) :: westpp_r0(3)
  INTEGER :: westpp_nr
  REAL(DP) :: westpp_rmax
  REAL(DP) :: westpp_epsinfty
  !
  ! Common workspace
  !
222
  CHARACTER(LEN=512) :: westpp_save_dir
Marco Govoni's avatar
Marco Govoni committed
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
  !
END MODULE
!
!
MODULE wan_center
  !
  USE kinds, ONLY : DP
  !
  SAVE
  !
  REAL(DP),ALLOCATABLE :: wanc(:,:)
  REAL(DP),ALLOCATABLE :: wanu(:,:)
  INTEGER :: wantot
  !
END MODULE
!
!
MODULE io_unit_numbers
  !
  SAVE
  !
  INTEGER,PARAMETER :: iuwfc=20
  INTEGER :: lrwfc 
  !
END MODULE 
!
!
MODULE westcom
  !
  USE scratch_area
  USE westin
  USE wstat_center
  USE wfreq_center
  USE westpp_center
  USE wan_center
  USE io_unit_numbers
  !
END MODULE