Skip to content

Commit

Permalink
Initialize DBCSR_related variables
Browse files Browse the repository at this point in the history
  • Loading branch information
fstein93 committed Aug 13, 2024
1 parent f3901f6 commit 5378413
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/dbx/cp_dbcsr_api.F
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ MODULE cp_dbcsr_api
END TYPE

TYPE dbcsr_type
TYPE(dbcsr_type_prv), PRIVATE :: prv
TYPE(dbcsr_type_prv), PRIVATE :: prv = dbcsr_type_prv()
END TYPE dbcsr_type

TYPE dbcsr_distribution_type
TYPE(dbcsr_distribution_type_prv), PRIVATE :: prv
TYPE(dbcsr_distribution_type_prv), PRIVATE :: prv = dbcsr_distribution_type_prv()
END TYPE dbcsr_distribution_type

TYPE dbcsr_iterator_type
TYPE(dbcsr_iterator_type_prv), PRIVATE :: prv
TYPE(dbcsr_iterator_type_prv), PRIVATE :: prv = dbcsr_iterator_type_prv()
END TYPE dbcsr_iterator_type

INTERFACE dbcsr_add
Expand Down
26 changes: 17 additions & 9 deletions src/dm_ls_scf_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ MODULE dm_ls_scf_types
INTEGER :: cluster_type = -1
LOGICAL :: do_pao = .FALSE.
INTEGER, DIMENSION(:), ALLOCATABLE :: atom_to_molecule
TYPE(dbcsr_type) :: matrix_A
TYPE(dbcsr_type) :: matrix_B
TYPE(dbcsr_type) :: matrix_A = dbcsr_type()
TYPE(dbcsr_type) :: matrix_B = dbcsr_type()
END TYPE

TYPE ls_mat_history_type
Expand Down Expand Up @@ -93,8 +93,11 @@ MODULE dm_ls_scf_types
REAL(KIND=dp), DIMENSION(2) :: homo_spin = 0.0_dp
REAL(KIND=dp), DIMENSION(2) :: lumo_spin = 0.0_dp

! This prevents a bug in GCC up to version 9.x (9.5 seems to work though)
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (CPVERSION(9, 5) > CPVERSION(__GNUC__, __GNUC_MINOR__))
TYPE(ls_mat_history_type) :: scf_history = ls_mat_history_type(matrix=null())
#else
TYPE(ls_mat_history_type) :: scf_history = ls_mat_history_type()
#endif
INTEGER :: extrapolation_order = -1

LOGICAL :: has_unit_metric = .FALSE.
Expand Down Expand Up @@ -126,18 +129,23 @@ MODULE dm_ls_scf_types
REAL(KIND=dp) :: eps_diis = 0.0_dp
REAL(KIND=dp) :: energy_init = 0.0_dp

TYPE(dbcsr_type) :: matrix_s_inv
TYPE(dbcsr_type) :: matrix_s
TYPE(dbcsr_type) :: matrix_bs_sqrt, matrix_bs_sqrt_inv
TYPE(dbcsr_type) :: matrix_s_sqrt, matrix_s_sqrt_inv
TYPE(dbcsr_type) :: matrix_s_inv = dbcsr_type()
TYPE(dbcsr_type) :: matrix_s = dbcsr_type()
TYPE(dbcsr_type) :: matrix_bs_sqrt = dbcsr_type(), matrix_bs_sqrt_inv = dbcsr_type()
TYPE(dbcsr_type) :: matrix_s_sqrt = dbcsr_type(), matrix_s_sqrt_inv = dbcsr_type()
TYPE(dbcsr_type), DIMENSION(:), ALLOCATABLE :: matrix_ks
TYPE(dbcsr_type), DIMENSION(:), ALLOCATABLE :: matrix_p

LOGICAL :: report_all_sparsities = .FALSE., perform_mu_scan = .FALSE., use_s_sqrt = .FALSE.

TYPE(ls_mstruct_type) :: ls_mstruct
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (CPVERSION(9, 5) > CPVERSION(__GNUC__, __GNUC_MINOR__))
TYPE(ls_mstruct_type) :: ls_mstruct = ls_mstruct_type(atom_to_molecule=NULL())
TYPE(ls_scf_curvy_type) :: curvy_data = ls_scf_curvy_type(matrix_dp=null(), matrix_p=null(), &
matrix_psave=null(), matrix_bch=null())
#else
TYPE(ls_mstruct_type) :: ls_mstruct = ls_mstruct_type()
TYPE(ls_scf_curvy_type) :: curvy_data = ls_scf_curvy_type()
#endif

TYPE(chebyshev_type) :: chebyshev = chebyshev_type()

Expand All @@ -150,7 +158,7 @@ MODULE dm_ls_scf_types

LOGICAL :: calculate_forces = .FALSE.

TYPE(lib_pexsi_env) :: pexsi
TYPE(lib_pexsi_env) :: pexsi = lib_pexsi_env()

TYPE(mp_para_env_type), POINTER :: para_env => NULL()
LOGICAL :: do_pao = .FALSE.
Expand Down
13 changes: 7 additions & 6 deletions src/pexsi_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,21 @@ MODULE pexsi_types
!> \author Patrick Seewald
! **************************************************************************************************
TYPE lib_pexsi_env
TYPE(dbcsr_type) :: dbcsr_template_matrix_sym, &
dbcsr_template_matrix_nonsym
TYPE(dbcsr_csr_type) :: csr_mat_p, csr_mat_ks, csr_mat_s, &
csr_mat_E, csr_mat_F
TYPE(dbcsr_type) :: dbcsr_template_matrix_sym = dbcsr_type(), &
dbcsr_template_matrix_nonsym = dbcsr_type()
TYPE(dbcsr_csr_type) :: csr_mat_p = dbcsr_csr_type(), csr_mat_ks = dbcsr_csr_type(), &
csr_mat_s = dbcsr_csr_type(), csr_mat_E = dbcsr_csr_type(), &
csr_mat_F = dbcsr_csr_type()
TYPE(cp_pexsi_options) :: options
REAL(KIND=dp), DIMENSION(:), POINTER :: kTS => NULL()
TYPE(dbcsr_p_type), DIMENSION(:), &
POINTER :: matrix_w => NULL()
INTEGER(KIND=C_INTPTR_T) :: plan = 0_C_INTPTR_T
INTEGER :: nspin = -1, num_ranks_per_pole = -1
TYPE(mp_comm_type) :: mp_group = mp_comm_type()
TYPE(mp_comm_type) :: mp_group = mp_comm_type()
TYPE(dbcsr_type), DIMENSION(:), &
POINTER :: max_ev_vector => NULL()
TYPE(dbcsr_type) :: csr_sparsity
TYPE(dbcsr_type) :: csr_sparsity = dbcsr_type()
INTEGER, DIMENSION(2) :: mp_dims = -1

LOGICAL :: csr_screening = .FALSE., do_adaptive_tol_nel = .FALSE.
Expand Down
14 changes: 7 additions & 7 deletions src/transport_env_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ MODULE transport_env_types
TYPE transport_env_type
TYPE(C_FUNPTR) :: ext_c_method_ptr = C_NULL_FUNPTR
TYPE(cp2k_transport_parameters) :: params = cp2k_transport_parameters()
TYPE(dbcsr_type) :: template_matrix_sym
TYPE(dbcsr_type) :: template_matrix_nosym
TYPE(dbcsr_type) :: csr_sparsity
TYPE(dbcsr_type) :: template_matrix_sym = dbcsr_type()
TYPE(dbcsr_type) :: template_matrix_nosym = dbcsr_type()
TYPE(dbcsr_type) :: csr_sparsity = dbcsr_type()
TYPE(dbcsr_type), POINTER :: dm_imag => NULL()
TYPE(dbcsr_csr_type) :: s_matrix
TYPE(dbcsr_csr_type) :: ks_matrix
TYPE(dbcsr_csr_type) :: p_matrix
TYPE(dbcsr_csr_type) :: imagp_matrix
TYPE(dbcsr_csr_type) :: s_matrix = dbcsr_csr_type()
TYPE(dbcsr_csr_type) :: ks_matrix = dbcsr_csr_type()
TYPE(dbcsr_csr_type) :: p_matrix = dbcsr_csr_type()
TYPE(dbcsr_csr_type) :: imagp_matrix = dbcsr_csr_type()
LOGICAL :: csr_screening = .FALSE.
INTEGER, DIMENSION(:), POINTER :: contacts_data => NULL()
INTEGER, DIMENSION(:), POINTER :: nsgf => NULL()
Expand Down
1 change: 1 addition & 0 deletions tools/precommit/check_file_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
r"LIBXSMM_VERSION2",
r"LIBXSMM_VERSION3",
r"LIBXSMM_VERSION4",
r"CPVERSION",
)

FLAG_EXCEPTIONS_RE = re.compile(r"|".join(FLAG_EXCEPTIONS))
Expand Down

0 comments on commit 5378413

Please sign in to comment.