From d205b357822ee12e53934a16e9550a51d53bd872 Mon Sep 17 00:00:00 2001 From: Stepan Marek Date: Thu, 26 Sep 2024 15:51:16 +0200 Subject: [PATCH] RTBSE : Fixing dashboard issues from #3691 (#3698) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Štěpán Marek --- src/emd/rt_bse.F | 30 ++---------- src/emd/rt_bse_types.F | 10 ++++ src/post_scf_bandstructure_types.F | 73 +++++++++++++++++------------- src/rpa_sigma_functional.F | 4 +- 4 files changed, 57 insertions(+), 60 deletions(-) diff --git a/src/emd/rt_bse.F b/src/emd/rt_bse.F index a446f76d4f..c5218cdabe 100644 --- a/src/emd/rt_bse.F +++ b/src/emd/rt_bse.F @@ -74,32 +74,10 @@ MODULE rt_bse omp_get_num_threads, & omp_set_num_threads, & omp_get_max_threads - USE dbt_api, ONLY: dbt_create, & - dbt_clear, & + USE dbt_api, ONLY: dbt_clear, & dbt_contract, & dbt_copy_matrix_to_tensor, & - dbt_copy_tensor_to_matrix, & - dbt_copy, & - dbt_destroy, & - dbt_type, & - dbt_pgrid_type, & - dbt_pgrid_create, & - dbt_pgrid_destroy, & - dbt_mp_environ_pgrid, & - dbt_default_distvec, & - dbt_distribution_type, & - dbt_distribution_new, & - dbt_distribution_destroy, & - dbt_iterator_type, & - dbt_iterator_start, & - dbt_iterator_stop, & - dbt_iterator_blocks_left, & - dbt_iterator_next_block, & - dbt_put_block, & - dbt_get_block, & - dbt_reserve_blocks, & - dbt_get_num_blocks, & - dbt_get_info + dbt_copy_tensor_to_matrix USE libint_2c_3c, ONLY: libint_potential_type USE mp2_ri_2c, ONLY: RI_2c_integral_mat USE qs_tensors, ONLY: neighbor_list_3c_destroy, & @@ -943,7 +921,7 @@ SUBROUTINE get_idempotence_deviation(rtbse_env, rho, deviation_metric) CALL cp_fm_to_cfm(msourcer=rtbse_env%S_fm, mtarget=rtbse_env%rho_workspace(1)) DO j = 1, rtbse_env%n_spin CALL cp_cfm_trace(rtbse_env%rho_workspace(1), rho(j), buffer_1) - buffer_dev = buffer_dev + REAL(ABS(buffer_1)*ABS(buffer_1)) + buffer_dev = buffer_dev + REAL(ABS(buffer_1)*ABS(buffer_1), kind=dp) END DO ! Now, determine Tr(S * rho_re * S * rho_re) - Tr(S * rho_im * S * rho_im) + 2i Tr(S * rho_re * S * rho_im) DO j = 1, rtbse_env%n_spin @@ -957,7 +935,7 @@ SUBROUTINE get_idempotence_deviation(rtbse_env, rho, deviation_metric) CMPLX(0.0, 0.0, kind=dp), rtbse_env%rho_workspace(3)) ! Tr (S * rho * S * rho) CALL cp_cfm_trace(rtbse_env%rho_workspace(1), rtbse_env%rho_workspace(3), buffer_2) - deviation_metric = deviation_metric + REAL(ABS(buffer_2)*ABS(buffer_2)) + deviation_metric = deviation_metric + REAL(ABS(buffer_2)*ABS(buffer_2), kind=dp) END DO deviation_metric = SQRT(deviation_metric) - SQRT(buffer_dev) END SUBROUTINE get_idempotence_deviation diff --git a/src/emd/rt_bse_types.F b/src/emd/rt_bse_types.F index ac8f26bbfb..c03e90fec7 100644 --- a/src/emd/rt_bse_types.F +++ b/src/emd/rt_bse_types.F @@ -247,6 +247,15 @@ MODULE rt_bse_types ! Workspace required for hartree_pw TYPE(dbcsr_type) :: v_dbcsr = dbcsr_type(), & w_dbcsr = dbcsr_type() +#if defined(__GNUC__) && defined(__GNUC_MINOR__) && CPVERSION(9, 5) > CPVERSION(__GNUC__, __GNUC_MINOR__) + TYPE(dbt_type) :: screened_dbt, & + sigma_dbt, & + greens_dbt, & + t_3c_w, & + t_3c_work_RI__AO_AO, & + t_3c_work_RI_AO__AO, & + t_3c_work2_RI_AO__AO +#else TYPE(dbt_type) :: screened_dbt = dbt_type(), & sigma_dbt = dbt_type(), & greens_dbt = dbt_type(), & @@ -254,6 +263,7 @@ MODULE rt_bse_types t_3c_work_RI__AO_AO = dbt_type(), & t_3c_work_RI_AO__AO = dbt_type(), & t_3c_work2_RI_AO__AO = dbt_type() +#endif ! These matrices are always real INTEGER :: etrs_max_iter = 10 INTEGER :: ham_reference_type = 2 diff --git a/src/post_scf_bandstructure_types.F b/src/post_scf_bandstructure_types.F index fc24486c6f..bcd1435c05 100644 --- a/src/post_scf_bandstructure_types.F +++ b/src/post_scf_bandstructure_types.F @@ -21,7 +21,8 @@ MODULE post_scf_bandstructure_types cp_fm_type USE dbt_api, ONLY: dbt_destroy,& dbt_type - USE input_constants, ONLY: small_cell_full_kp + USE input_constants, ONLY: rtp_method_bse,& + small_cell_full_kp USE kinds, ONLY: default_string_length,& dp USE kpoint_types, ONLY: kpoint_release,& @@ -70,10 +71,10 @@ MODULE post_scf_bandstructure_types eigenval_scGW0 REAL(KIND=dp), DIMENSION(:, :), ALLOCATABLE :: eigenval_scf_soc, & eigenval_G0W0_soc - TYPE(band_edges_type), DIMENSION(2) :: band_edges_scf_Gamma - TYPE(band_edges_type) :: band_edges_scf, & - band_edges_G0W0, & - band_edges_HF + TYPE(band_edges_type), DIMENSION(2) :: band_edges_scf_Gamma = band_edges_type() + TYPE(band_edges_type) :: band_edges_scf = band_edges_type(), & + band_edges_G0W0 = band_edges_type(), & + band_edges_HF = band_edges_type() ! parameters that influence the GW flavor LOGICAL :: do_hedin_shift = .FALSE. @@ -151,38 +152,46 @@ MODULE post_scf_bandstructure_types regularization_RI = -1.0_dp ! global full cfm_1d used in GW - TYPE(cp_fm_type) :: fm_s_Gamma, & - fm_Gocc, & - fm_Gvir - TYPE(cp_fm_type), DIMENSION(2) :: fm_ks_Gamma, & - fm_V_xc_Gamma, & - fm_mo_coeff_Gamma - TYPE(cp_fm_type), DIMENSION(4) :: fm_work_mo - TYPE(cp_fm_type) :: fm_RI_RI, & - fm_chi_Gamma_freq, & - fm_W_MIC_freq, & - fm_W_MIC_freq_1_extra, & - fm_W_MIC_freq_1_no_extra, & - fm_W_MIC_freq_zero, & - fm_h_G0W0_Gamma - TYPE(cp_cfm_type) :: cfm_work_mo, & - cfm_work_mo_2 + TYPE(cp_fm_type) :: fm_s_Gamma = cp_fm_type(), & + fm_Gocc = cp_fm_type(), & + fm_Gvir = cp_fm_type() + TYPE(cp_fm_type), DIMENSION(2) :: fm_ks_Gamma = cp_fm_type(), & + fm_V_xc_Gamma = cp_fm_type(), & + fm_mo_coeff_Gamma = cp_fm_type() + TYPE(cp_fm_type), DIMENSION(4) :: fm_work_mo = cp_fm_type() + TYPE(cp_fm_type) :: fm_RI_RI = cp_fm_type(), & + fm_chi_Gamma_freq = cp_fm_type(), & + fm_W_MIC_freq = cp_fm_type(), & + fm_W_MIC_freq_1_extra = cp_fm_type(), & + fm_W_MIC_freq_1_no_extra = cp_fm_type(), & + fm_W_MIC_freq_zero = cp_fm_type(), & + fm_h_G0W0_Gamma = cp_fm_type() + TYPE(cp_cfm_type) :: cfm_work_mo = cp_cfm_type(), & + cfm_work_mo_2 = cp_cfm_type() ! global dbcsr cfm_1d used in GW - TYPE(dbcsr_p_type) :: mat_ao_ao, & - mat_RI_RI + TYPE(dbcsr_p_type) :: mat_ao_ao = dbcsr_p_type(), & + mat_RI_RI = dbcsr_p_type() TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: mat_chi_Gamma_tau => NULL() ! local dbcsr cfm_1d used in GW (local in tensor group) - TYPE(dbcsr_p_type) :: mat_ao_ao_tensor, & - mat_RI_RI_tensor + TYPE(dbcsr_p_type) :: mat_ao_ao_tensor = dbcsr_p_type(), & + mat_RI_RI_tensor = dbcsr_p_type() ! tensors for sparse matrix-tensor operations +#if defined(__GNUC__) && defined(__GNUC_MINOR__) && CPVERSION(9, 5) > CPVERSION(__GNUC__, __GNUC_MINOR__) TYPE(dbt_type) :: t_G, & t_chi, & t_W, & t_RI_AO__AO, & t_RI__AO_AO +#else + TYPE(dbt_type) :: t_G = dbt_type(), & + t_chi = dbt_type(), & + t_W = dbt_type(), & + t_RI_AO__AO = dbt_type(), & + t_RI__AO_AO = dbt_type() +#endif ! parameters and data for parallelization INTEGER :: group_size_tensor = -1, & @@ -213,7 +222,7 @@ MODULE post_scf_bandstructure_types LOGICAL, DIMENSION(:, :), ALLOCATABLE :: skip_Sigma_occ, & skip_Sigma_vir ! Marek : rtp_method - INTEGER :: rtp_method + INTEGER :: rtp_method = rtp_method_bse ! check-arrays and names for restarting LOGICAL, DIMENSION(:), ALLOCATABLE :: read_chi, & @@ -235,19 +244,19 @@ MODULE post_scf_bandstructure_types basis_set_RI INTEGER, DIMENSION(:), ALLOCATABLE :: sizes_AO, & sizes_RI - TYPE(neighbor_list_3c_type) :: nl_3c - TYPE(libint_potential_type) :: ri_metric, & - trunc_coulomb + TYPE(neighbor_list_3c_type) :: nl_3c = neighbor_list_3c_type() + TYPE(libint_potential_type) :: ri_metric = libint_potential_type(), & + trunc_coulomb = libint_potential_type() ! parameters for SOC calculation REAL(KIND=dp) :: energy_window_soc = -1.0_dp ! sizes: mat_V_SOC_xyz: xyz, img TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: mat_V_SOC_xyz => NULL() - TYPE(cp_fm_type), DIMENSION(3) :: fm_V_SOC_xyz_mo + TYPE(cp_fm_type), DIMENSION(3) :: fm_V_SOC_xyz_mo = cp_fm_type() ! small-cell GW: dimension = number of kpoints; large-cell GW: Gamma-point, dimension = 1 TYPE(cp_cfm_type), DIMENSION(:), ALLOCATABLE :: cfm_SOC_spinor_ao - TYPE(band_edges_type) :: band_edges_scf_SOC, & - band_edges_G0W0_SOC + TYPE(band_edges_type) :: band_edges_scf_SOC = band_edges_type(), & + band_edges_G0W0_SOC = band_edges_type() ! parameters for DOS and PDOS calculation REAL(KIND=dp) :: energy_window_DOS = -1.0_dp, & diff --git a/src/rpa_sigma_functional.F b/src/rpa_sigma_functional.F index 0bbe4ab78c..c4b2244287 100644 --- a/src/rpa_sigma_functional.F +++ b/src/rpa_sigma_functional.F @@ -731,7 +731,7 @@ INTEGER FUNCTION intervalnum(x_coord, n, sigma) RESULT(inum) INTEGER :: i - IF (sigma <= 0.0_dp) STOP 'intervalnum: sigma should be positive' + IF (sigma <= 0.0_dp) CPABORT('intervalnum: sigma should be positive') inum = -1 IF (sigma > x_coord(n)) inum = n @@ -739,7 +739,7 @@ INTEGER FUNCTION intervalnum(x_coord, n, sigma) RESULT(inum) IF ((sigma > x_coord(i)) .AND. (sigma <= x_coord(i + 1))) inum = i END DO - IF (inum == -1) STOP 'interval: something was wrong' + IF (inum == -1) CPABORT('interval: something was wrong') END FUNCTION intervalnum