dbcsr_create_new Subroutine

private subroutine dbcsr_create_new(matrix, name, dist, matrix_type, row_blk_size, col_blk_size, nze, data_type, reuse, reuse_arrays, mutable_work, replication_type)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(inout) :: matrix
character(len=*), intent(in) :: name
type(dbcsr_distribution_type), intent(in) :: dist
character(len=1), intent(in) :: matrix_type
integer, intent(inout), DIMENSION(:), POINTER :: row_blk_size
integer, intent(inout), DIMENSION(:), POINTER :: col_blk_size
integer, intent(in), optional :: nze
integer, intent(in), optional :: data_type
logical, intent(in), optional :: reuse
logical, intent(in), optional :: reuse_arrays
logical, intent(in), optional :: mutable_work
character(len=1), intent(in), optional :: replication_type

Source Code

   SUBROUTINE dbcsr_create_new(matrix, name, dist, matrix_type, &
                               row_blk_size, col_blk_size, nze, data_type, reuse, &
                               reuse_arrays, mutable_work, replication_type)
      TYPE(dbcsr_type), INTENT(INOUT)                    :: matrix
      CHARACTER(len=*), INTENT(IN)                       :: name
      TYPE(dbcsr_distribution_type), INTENT(IN)          :: dist
      CHARACTER, INTENT(IN)                              :: matrix_type
      INTEGER, DIMENSION(:), INTENT(INOUT), POINTER      :: row_blk_size, col_blk_size
      INTEGER, INTENT(IN), OPTIONAL                      :: nze, data_type
      LOGICAL, INTENT(IN), OPTIONAL                      :: reuse, reuse_arrays, mutable_work
      CHARACTER, INTENT(IN), OPTIONAL                    :: replication_type

      INTEGER, DIMENSION(:), POINTER, CONTIGUOUS         :: cont_row_blk_size, cont_col_blk_size

      ! Make the array contiguous, avoid to change API
      ALLOCATE (cont_row_blk_size(SIZE(row_blk_size)), cont_col_blk_size(SIZE(col_blk_size)))
      cont_row_blk_size(:) = row_blk_size(:)
      cont_col_blk_size(:) = col_blk_size(:)
      IF (PRESENT(reuse_arrays)) THEN
         IF (reuse_arrays) THEN
            DEALLOCATE (row_blk_size, col_blk_size)
            NULLIFY (row_blk_size, col_blk_size)
         END IF
      END IF
      CALL dbcsr_create_prv(matrix%prv, name, dist%prv, &
                            matrix_type, &
                            cont_row_blk_size, cont_col_blk_size, nze=nze, &
                            data_type=data_type, reuse=reuse, &
                            reuse_arrays=.TRUE., &
                            mutable_work=mutable_work, replication_type=replication_type)
   END SUBROUTINE dbcsr_create_new