-
Notifications
You must be signed in to change notification settings - Fork 1
/
mp2_types.F
487 lines (433 loc) · 30.7 KB
/
mp2_types.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
!--------------------------------------------------------------------------------------------------!
! 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 Types needed for MP2 calculations
!> \par History
!> 2011.05 created [Mauro Del Ben]
!> \author MDB
! **************************************************************************************************
MODULE mp2_types
USE cp_dbcsr_api, ONLY: dbcsr_p_type,&
dbcsr_type
USE cp_eri_mme_interface, ONLY: cp_eri_mme_finalize,&
cp_eri_mme_param
USE cp_fm_types, ONLY: cp_fm_type
USE hfx_types, ONLY: hfx_release,&
hfx_type,&
pair_list_element_type
USE input_constants, ONLY: &
do_eri_mme, eri_default, gw_pade_approx, kp_weights_W_auto, mp2_method_direct, &
mp2_method_gpw, mp2_method_none, mp2_ri_optimize_basis, ri_mp2_laplace, ri_mp2_method_gpw, &
ri_rpa_g0w0_crossing_z_shot, ri_rpa_method_gpw, rpa_exchange_none, soc_none, &
wfc_mm_style_gemm
USE input_section_types, ONLY: section_vals_release,&
section_vals_type
USE kinds, ONLY: dp
USE kpoint_types, ONLY: kpoint_type
USE libint_2c_3c, ONLY: libint_potential_type
USE local_gemm_api, ONLY: local_gemm_ctxt_type
USE message_passing, ONLY: mp_request_type
USE qs_force_types, ONLY: qs_force_type
USE qs_p_env_types, ONLY: qs_p_env_type
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'mp2_types'
PUBLIC :: mp2_type, &
integ_mat_buffer_type, &
integ_mat_buffer_type_2D, &
mp2_method_none, &
mp2_method_direct, &
mp2_method_gpw, &
mp2_ri_optimize_basis, &
ri_mp2_method_gpw, &
ri_rpa_method_gpw, &
ri_mp2_laplace, &
init_TShPSC_lmax
PUBLIC :: mp2_env_create, &
mp2_env_release, &
mp2_biel_type, &
pair_list_type_mp2, &
one_dim_int_array, &
two_dim_int_array, &
one_dim_real_array, &
two_dim_real_array, &
three_dim_real_array
INTEGER, SAVE :: init_TShPSC_lmax = -1
! TYPE definitions
TYPE one_dim_int_array
INTEGER, DIMENSION(:), ALLOCATABLE :: array
END TYPE one_dim_int_array
TYPE two_dim_int_array
INTEGER, DIMENSION(:, :), ALLOCATABLE :: array
END TYPE two_dim_int_array
TYPE one_dim_real_array
REAL(KIND=dp), DIMENSION(:), ALLOCATABLE :: array
END TYPE one_dim_real_array
TYPE two_dim_real_array
REAL(KIND=dp), DIMENSION(:, :), ALLOCATABLE :: array
END TYPE two_dim_real_array
TYPE three_dim_real_array
REAL(KIND=dp), DIMENSION(:, :, :), ALLOCATABLE :: array
END TYPE three_dim_real_array
TYPE mp2_biel_type
INTEGER, DIMENSION(:, :), ALLOCATABLE :: index_table
END TYPE mp2_biel_type
TYPE mp2_laplace_type
INTEGER :: n_quadrature = -1, &
num_integ_groups = -1
END TYPE mp2_laplace_type
TYPE mp2_direct_type
LOGICAL :: big_send = .FALSE.
END TYPE
TYPE mp2_gpw_type
REAL(KIND=dp) :: eps_grid = 0.0_dp, &
eps_filter = 0.0_dp, &
eps_pgf_orb_S = 0.0_dp
INTEGER :: print_level = 0
REAL(KIND=dp) :: cutoff = 0.0_dp, &
relative_cutoff = 0.0_dp
INTEGER :: size_lattice_sum = 0
END TYPE
TYPE ri_mp2_type
INTEGER :: block_size = 0, &
number_integration_groups = 0
LOGICAL :: print_dgemm_info = .FALSE.
END TYPE ri_mp2_type
TYPE ri_rpa_type
INTEGER :: rpa_num_quad_points = -1, &
rpa_num_integ_groups = -1, &
mm_style = wfc_mm_style_gemm
TYPE(hfx_type), DIMENSION(:, :), POINTER :: x_data => NULL()
TYPE(section_vals_type), POINTER :: xc_section_primary => Null(), &
xc_section_aux => Null()
LOGICAL :: reuse_hfx = .FALSE., &
minimax_quad = .FALSE., &
do_ri_g0w0 = .FALSE., &
do_admm = .FALSE., &
do_rse = .FALSE., &
print_dgemm_info = .FALSE.
! GCC 8 has an issue with this being an ALLOCATABLE
TYPE(dbcsr_type), DIMENSION(:), POINTER :: mo_coeff_o => NULL(), &
mo_coeff_v => NULL()
INTEGER :: exchange_correction = rpa_exchange_none, &
exchange_block_size = -1
LOGICAL :: use_hfx_implementation = .FALSE.
REAL(KIND=dp) :: ener_exchange = 0.0_dp, &
rse_corr_diag = 0.0_dp, &
rse_corr = 0.0_dp, &
scale_rpa = 0.0_dp
!LOGICAL :: do_sigma = .FALSE.
INTEGER :: sigma_param = 0.0_dp
REAL(KIND=dp) :: e_sigma_corr = 0.0_dp
END TYPE ri_rpa_type
TYPE ri_rpa_im_time_type
INTEGER :: cut_memory = 0
LOGICAL :: memory_info = .FALSE., &
make_chi_pos_definite = .FALSE., &
make_overlap_mat_ao_pos_definite = .FALSE., &
trunc_coulomb_ri_x = .FALSE., &
keep_quad = .FALSE., &
do_kpoints_from_Gamma = .FALSE., &
do_extrapolate_kpoints = .FALSE.
REAL(KIND=dp) :: eps_filter = 0.0_dp, &
eps_filter_factor = 0.0_dp, &
eps_compress = 0.0_dp, &
exp_tailored_weights = 0.0_dp, &
regularization_RI = 0.0_dp, &
eps_eigval_S = 0.0_dp, &
eps_eigval_S_Gamma = 0.0_dp, &
rel_cutoff_trunc_coulomb_ri_x = 0.0_dp
REAL(KIND=dp), DIMENSION(:), POINTER :: tau_tj => NULL(), &
tau_wj => NULL(), &
tj => NULL(), &
wj => NULL()
REAL(KIND=dp), DIMENSION(:, :), POINTER :: weights_cos_tf_t_to_w => NULL(), &
weights_cos_tf_w_to_t => NULL()
REAL(KIND=dp), DIMENSION(:), ALLOCATABLE :: Eigenval_Gamma, &
wkp_V
INTEGER :: group_size_P = 0, &
group_size_3c = 0, &
kpoint_weights_W_method = kp_weights_W_auto, &
k_mesh_g_factor = 0
INTEGER, DIMENSION(:), POINTER :: kp_grid => NULL()
INTEGER, DIMENSION(3) :: kp_grid_extra = -1
LOGICAL :: do_im_time_kpoints = .FALSE.
INTEGER :: min_bsize = 0, &
min_bsize_mo = 0, &
nkp_orig = 0, &
nkp_extra = 0
TYPE(kpoint_type), POINTER :: kpoints_G => NULL(), &
kpoints_Sigma => NULL(), &
kpoints_Sigma_no_xc => NULL()
INTEGER, ALLOCATABLE, DIMENSION(:) :: starts_array_mc_RI, ends_array_mc_RI, &
starts_array_mc_block_RI, &
ends_array_mc_block_RI, &
starts_array_mc, ends_array_mc, &
starts_array_mc_block, &
ends_array_mc_block
END TYPE ri_rpa_im_time_type
TYPE ri_g0w0_type
INTEGER :: corr_mos_occ = 0, &
corr_mos_virt = 0, &
corr_mos_occ_beta = 0, &
corr_mos_virt_beta = 0, &
num_poles = 0, &
nparam_pade = 0, &
analytic_continuation = gw_pade_approx
REAL(KIND=dp) :: omega_max_fit = 0.0_dp
INTEGER :: crossing_search = ri_rpa_g0w0_crossing_z_shot
REAL(KIND=dp) :: fermi_level_offset = 0.0_dp
INTEGER :: iter_evGW = 0, &
iter_sc_GW0 = 0
REAL(KIND=dp) :: eps_iter = 0.0_dp
LOGICAL :: do_hedin_shift = .FALSE., &
do_ri_Sigma_x = .FALSE., &
do_periodic = .FALSE., &
print_self_energy = .FALSE.
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :, :) :: vec_Sigma_x_minus_vxc_gw
INTEGER, DIMENSION(:), POINTER :: kp_grid => NULL(), &
kp_grid_Sigma => NULL()
INTEGER :: num_kp_grids = 0
REAL(KIND=dp) :: eps_kpoint = 0.0_dp
LOGICAL :: do_mo_coeff_gamma = .FALSE., &
do_average_deg_levels = .FALSE.
REAL(KIND=dp) :: eps_eigenval = 0.0_dp
LOGICAL :: do_extra_kpoints = .FALSE., &
do_aux_bas_gw = .FALSE.
REAL(KIND=dp) :: frac_aux_mos = 0.0_dp
INTEGER :: num_omega_points = 0
LOGICAL :: do_ic_model = .FALSE., &
print_ic_values = .FALSE.
REAL(KIND=dp) :: eps_dist = 0.0_dp
TYPE(one_dim_real_array), DIMENSION(2) :: ic_corr_list = one_dim_real_array(NULL())
INTEGER :: print_exx = 0
LOGICAL :: do_gamma_only_sigma = .FALSE.
LOGICAL :: update_xc_energy = .FALSE., &
do_kpoints_Sigma = .FALSE., &
print_local_bandgap = .FALSE.
INTEGER :: n_kp_in_kp_line = 0, &
n_special_kp = 0, &
nkp_self_energy = 0, &
nkp_self_energy_special_kp = 0, &
nkp_self_energy_monkh_pack = 0, &
soc_type = soc_none
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: xkp_special_kp
TYPE(dbcsr_p_type), DIMENSION(:), ALLOCATABLE :: matrix_sigma_x_minus_vxc, &
matrix_ks
REAL(KIND=dp) :: broadening_print_loc_bandgap = 0.0_dp, &
energy_window_print_loc_bandgap = 0.0_dp, &
ldos_thresh_print_loc_bandgap = 0.0_dp, &
energy_spacing_print_loc_bandgap = 0.0_dp, &
regularization_minimax = 0.0_dp, &
soc_energy_window = 0.0_dp
INTEGER, DIMENSION(:), POINTER :: stride_loc_bandgap => NULL()
!GW_DOS
REAL(KIND=dp) :: dos_upper = 0.0_dp, &
dos_lower = 0.0_dp, &
dos_prec = 0.0_dp, &
dos_eta = 0.0_dp
INTEGER :: max_level_self_energy = 0, &
min_level_self_energy = 0, &
dos_min = 0, &
dos_max = 0
END TYPE ri_g0w0_type
TYPE ri_basis_opt
REAL(KIND=dp) :: DI_rel = 0.0_dp, &
DRI = 0.0_dp, &
eps_step = 0.0_dp
INTEGER :: max_num_iter = 0, &
basis_quality = 0
INTEGER, DIMENSION(:), ALLOCATABLE :: RI_nset_per_l
END TYPE ri_basis_opt
TYPE grad_util
TYPE(two_dim_real_array), DIMENSION(2) :: P_ij = two_dim_real_array(NULL()), &
P_ab = two_dim_real_array(NULL())
TYPE(three_dim_real_array), DIMENSION(2) :: Gamma_P_ia = three_dim_real_array(NULL())
REAL(KIND=dp), DIMENSION(:, :), ALLOCATABLE :: operator_half, &
PQ_half, &
Gamma_PQ, &
Gamma_PQ_2
TYPE(dbcsr_p_type), DIMENSION(:, :), ALLOCATABLE :: G_P_ia
TYPE(dbcsr_p_type), DIMENSION(:), ALLOCATABLE :: mo_coeff_o, &
mo_coeff_v
TYPE(cp_fm_type), ALLOCATABLE, DIMENSION(:) :: P_mo, W_mo, L_jb
REAL(KIND=dp) :: cphf_eps_conv = 0.0_dp, &
scale_step_size = 0.0_dp
INTEGER :: cphf_max_num_iter = 0, &
z_solver_method = 0, &
cphf_restart = 0
LOGICAL :: enforce_decrease = .FALSE., &
recalc_residual = .FALSE., &
polak_ribiere = .FALSE.
TYPE(qs_p_env_type), POINTER :: p_env => NULL()
TYPE(qs_force_type), DIMENSION(:), POINTER :: mp2_force => NULL()
REAL(KIND=dp), DIMENSION(3, 3) :: mp2_virial = 0.0_dp
REAL(dp) :: eps_canonical = 0.0_dp
LOGICAL :: free_hfx_buffer = .FALSE.
INTEGER :: dot_blksize = 0
INTEGER :: max_parallel_comm = 0
END TYPE grad_util
TYPE bse_type
INTEGER :: bse_spin_config = 0, &
bse_diag_method = 0, &
flag_tda = 0, &
num_exc_en = 0, &
num_print_exc = 0, &
num_print_exc_descr = 0, &
screening_method = 0, &
num_add_start_z_space = 0, &
fac_max_z_space = 0, &
num_new_t = 0, &
num_davidson_iter = 0, &
davidson_abort_cond = 0
REAL(KIND=dp) :: eps_res = 0.0_dp, &
eps_exc_en = 0.0_dp, &
eps_x = 0.0_dp, &
screening_factor = 0.0_dp, &
bse_cutoff_occ = 0.0_dp, &
bse_cutoff_empty = 0.0_dp, &
z_space_energy_cutoff = 0.0_dp
LOGICAL :: do_bse = .FALSE., &
bse_debug_print = .FALSE., &
print_directional_exc_descr = .FALSE., &
use_ks_energies = .FALSE.
!BSE optical spectrum
REAL(KIND=dp) :: bse_spectrum_freq_step_size = 0.0_dp, &
bse_spectrum_freq_start = 0.0_dp, &
bse_spectrum_freq_end = 0.0_dp
LOGICAL :: bse_print_spectrum = .FALSE.
REAL(KIND=dp), DIMENSION(:), POINTER :: bse_eta_spectrum_list => NULL()
!BSE NTO prints
LOGICAL :: do_nto_analysis = .FALSE., &
explicit_nto_list = .FALSE.
REAL(KIND=dp) :: eps_nto_eigval = 0.0_dp, &
eps_nto_osc_str = 0.0_dp
INTEGER :: num_print_exc_ntos = 0
INTEGER, DIMENSION(:), POINTER :: bse_nto_state_list => NULL()
INTEGER, DIMENSION(:), ALLOCATABLE :: bse_nto_state_list_final
END TYPE bse_type
TYPE mp2_type
INTEGER :: method = mp2_method_none
TYPE(mp2_laplace_type) :: ri_laplace = mp2_laplace_type()
TYPE(mp2_direct_type) :: direct_canonical = mp2_direct_type()
TYPE(libint_potential_type) :: potential_parameter = libint_potential_type()
TYPE(mp2_gpw_type) :: mp2_gpw = mp2_gpw_type()
TYPE(ri_mp2_type) :: ri_mp2 = ri_mp2_type()
TYPE(ri_rpa_type) :: ri_rpa = ri_rpa_type()
! There is a bug with some older compilers preventing requiring an explicit initialization of allocatable components
#if defined(FTN_NO_DEFAULT_INIT)
TYPE(ri_rpa_im_time_type) :: ri_rpa_im_time = ri_rpa_im_time_type(Eigenval_Gamma=NULL(), &
wkp_V=NULL(), &
starts_array_mc_RI=NULL(), &
ends_array_mc_RI=NULL(), &
starts_array_mc_block_RI=NULL(), &
ends_array_mc_block_RI=NULL(), &
starts_array_mc=NULL(), ends_array_mc=NULL(), &
starts_array_mc_block=NULL(), &
ends_array_mc_block=NULL())
TYPE(ri_g0w0_type) :: ri_g0w0 = ri_g0w0_type(vec_Sigma_x_minus_vxc_gw=NULL(), &
xkp_special_kp=NULL(), &
matrix_sigma_x_minus_vxc=NULL(), &
matrix_ks=NULL())
TYPE(ri_basis_opt) :: ri_opt_param = ri_basis_opt(RI_nset_per_l=NULL())
TYPE(grad_util) :: ri_grad = grad_util(operator_half=NULL(), &
PQ_half=NULL(), &
Gamma_PQ=NULL(), &
Gamma_PQ_2=NULL(), &
G_P_ia=NULL(), &
mo_coeff_o=NULL(), &
mo_coeff_v=NULL(), &
P_mo=NULL(), W_mo=NULL(), L_jb=NULL())
TYPE(bse_type) :: bse = bse_type(bse_nto_state_list_final=NULL())
#else
TYPE(ri_rpa_im_time_type) :: ri_rpa_im_time = ri_rpa_im_time_type()
TYPE(ri_g0w0_type) :: ri_g0w0 = ri_g0w0_type()
TYPE(ri_basis_opt) :: ri_opt_param = ri_basis_opt()
TYPE(grad_util) :: ri_grad = grad_util()
TYPE(bse_type) :: bse = bse_type()
#endif
REAL(KIND=dp) :: mp2_memory = 0.0_dp, &
scale_S = 0.0_dp, &
scale_T = 0.0_dp
INTEGER :: mp2_num_proc = 0
INTEGER :: block_size_row = 0
INTEGER :: block_size_col = 0
LOGICAL :: calc_PQ_cond_num = .FALSE.
LOGICAL :: hf_fail = .FALSE.
LOGICAL :: p_screen = .FALSE.
LOGICAL :: not_last_hfx = .FALSE.
LOGICAL :: do_im_time = .FALSE.
INTEGER :: eri_method = eri_default
TYPE(cp_eri_mme_param), POINTER :: eri_mme_param => NULL()
INTEGER, DIMENSION(:), POINTER :: eri_blksize => NULL()
LOGICAL :: do_svd = .FALSE.
REAL(KIND=dp) :: eps_range = 0.0_dp
TYPE(libint_potential_type) :: ri_metric = libint_potential_type()
TYPE(local_gemm_ctxt_type) :: local_gemm_ctx = local_gemm_ctxt_type()
REAL(dp) :: e_gap = 0.0_dp, &
e_range = 0.0_dp
END TYPE mp2_type
TYPE integ_mat_buffer_type
REAL(KIND=dp), DIMENSION(:), ALLOCATABLE :: msg
INTEGER, DIMENSION(:), ALLOCATABLE :: sizes
INTEGER, DIMENSION(:, :), ALLOCATABLE :: indx
INTEGER :: proc = -1
TYPE(mp_request_type) :: msg_req = mp_request_type()
END TYPE integ_mat_buffer_type
TYPE integ_mat_buffer_type_2D
REAL(KIND=dp), DIMENSION(:, :), ALLOCATABLE :: msg
INTEGER :: proc = -1
TYPE(mp_request_type) :: msg_req = mp_request_type()
END TYPE integ_mat_buffer_type_2D
TYPE pair_list_type_mp2
TYPE(pair_list_element_type), DIMENSION(:), &
ALLOCATABLE :: elements
INTEGER :: n_element = 0
END TYPE pair_list_type_mp2
CONTAINS
! **************************************************************************************************
!> \brief ...
!> \param mp2_env ...
! **************************************************************************************************
SUBROUTINE mp2_env_release(mp2_env)
TYPE(mp2_type) :: mp2_env
CHARACTER(LEN=*), PARAMETER :: routineN = 'mp2_env_release'
INTEGER :: handle
CALL timeset(routineN, handle)
! release the HFX section for the EXX calculation
IF (.NOT. mp2_env%ri_rpa%reuse_hfx) THEN
IF (ASSOCIATED(mp2_env%ri_rpa%x_data)) CALL hfx_release(mp2_env%ri_rpa%x_data)
END IF
IF (ASSOCIATED(mp2_env%ri_rpa%xc_section_aux)) CALL section_vals_release(mp2_env%ri_rpa%xc_section_aux)
IF (ASSOCIATED(mp2_env%ri_rpa%xc_section_primary)) CALL section_vals_release(mp2_env%ri_rpa%xc_section_primary)
IF (mp2_env%eri_method .EQ. do_eri_mme) CALL cp_eri_mme_finalize(mp2_env%eri_mme_param)
IF (ASSOCIATED(mp2_env%eri_mme_param)) DEALLOCATE (mp2_env%eri_mme_param)
IF (ASSOCIATED(mp2_env%ri_rpa_im_time%tau_tj)) DEALLOCATE (mp2_env%ri_rpa_im_time%tau_tj)
IF (ASSOCIATED(mp2_env%ri_rpa_im_time%tau_wj)) DEALLOCATE (mp2_env%ri_rpa_im_time%tau_wj)
IF (ASSOCIATED(mp2_env%ri_rpa_im_time%tj)) DEALLOCATE (mp2_env%ri_rpa_im_time%tj)
IF (ASSOCIATED(mp2_env%ri_rpa_im_time%wj)) DEALLOCATE (mp2_env%ri_rpa_im_time%wj)
IF (ASSOCIATED(mp2_env%ri_rpa_im_time%weights_cos_tf_t_to_w)) DEALLOCATE (mp2_env%ri_rpa_im_time%weights_cos_tf_t_to_w)
IF (ASSOCIATED(mp2_env%ri_rpa_im_time%weights_cos_tf_w_to_t)) DEALLOCATE (mp2_env%ri_rpa_im_time%weights_cos_tf_w_to_t)
CALL mp2_env%local_gemm_ctx%destroy()
CALL timestop(handle)
END SUBROUTINE mp2_env_release
! **************************************************************************************************
!> \brief ...
!> \param mp2_env ...
! **************************************************************************************************
SUBROUTINE mp2_env_create(mp2_env)
TYPE(mp2_type), POINTER :: mp2_env
CHARACTER(LEN=*), PARAMETER :: routineN = 'mp2_env_create'
INTEGER :: handle
CALL timeset(routineN, handle)
CPASSERT(.NOT. ASSOCIATED(mp2_env))
ALLOCATE (mp2_env)
NULLIFY (mp2_env%ri_rpa%x_data)
CALL timestop(handle)
END SUBROUTINE mp2_env_create
END MODULE mp2_types