1!--------------------------------------------------------------------------------------------------!
2!   CP2K: A general program to perform molecular dynamics simulations                              !
3!   Copyright (C) 2000 - 2020  CP2K developers group                                               !
4!--------------------------------------------------------------------------------------------------!
5
6! **************************************************************************************************
7!> \brief Types to handle submatrices
8!> \par History
9!>       2013.01 created [Rustam Z Khaliullin]
10!> \author Rustam Z Khaliullin
11! **************************************************************************************************
12MODULE domain_submatrix_types
13   USE kinds,                           ONLY: dp
14#include "./base/base_uses.f90"
15
16   IMPLICIT NONE
17
18   PRIVATE
19
20   CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'domain_submatrix_types'
21
22   INTEGER, PARAMETER, PUBLIC           :: select_row_col = 1
23   INTEGER, PARAMETER, PUBLIC           :: select_row = 2
24
25   PUBLIC :: domain_submatrix_type, domain_map_type
26
27   ! submatrix storage with the meta-data necessary to convert
28   ! the submatrix into the DBCSR format
29   TYPE domain_submatrix_type
30      INTEGER                                       :: domain
31      REAL(KIND=dp), DIMENSION(:, :), ALLOCATABLE    :: mdata
32      INTEGER                                       :: nbrows
33      INTEGER                                       :: nbcols
34      INTEGER                                       :: nrows
35      INTEGER                                       :: ncols
36      INTEGER, DIMENSION(:), ALLOCATABLE            :: dbcsr_row
37      INTEGER, DIMENSION(:), ALLOCATABLE            :: dbcsr_col
38      INTEGER, DIMENSION(:), ALLOCATABLE            :: size_brow
39      INTEGER, DIMENSION(:), ALLOCATABLE            :: size_bcol
40      INTEGER                                       :: nnodes
41      INTEGER                                       :: groupid
42   END TYPE domain_submatrix_type
43
44   TYPE domain_map_type
45      INTEGER, DIMENSION(:), ALLOCATABLE     :: index1
46      INTEGER, DIMENSION(:, :), ALLOCATABLE   :: pairs
47   END TYPE domain_map_type
48
49END MODULE domain_submatrix_types
50
51