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