Documentation for module dbcsr_block_access

DBCSR block access

source: dbcsr_block_access.F
Loading...

Generic procedures:

dbcsr_get_block_p
dbcsr_put_block
dbcsr_reserve_block2d

public Subroutines/Functions:

Marks a block for removal from a DBCSR matrix. Handles symmetric matrices.
Inserts all blocks of a dbcsr matrix to make it a full matrix. Thus obviously not linear scaling.
Inserts block reservations into a matrix, avoiding the work matrix.
Inserts diagonal blocks of a dbcsr matrix to make it a matrix with at least all diagonal blocks present

Generic procedure dbcsr_get_block_p

...

TYPE(dbcsr_type),
INTENT(in)
:: matrix × × × × ×
TYPE(dbcsr_type),
INTENT(inout)
:: matrix × × × ×
INTEGER,
INTENT(in)
:: row × × × × × × × × ×
INTEGER,
INTENT(in)
:: col × × × × × × × × ×
REAL(real_8),
POINTER
:: block(:) ×
REAL(real_4),
POINTER
:: block(:) ×
COMPLEX(real_8),
POINTER
:: block(:) ×
COMPLEX(real_4),
POINTER
:: block(:) ×
REAL(real_8),
POINTER
:: block(:,:) ×
REAL(real_4),
POINTER
:: block(:,:) ×
COMPLEX(real_8),
POINTER
:: block(:,:) ×
COMPLEX(real_4),
POINTER
:: block(:,:) ×
INTENT(inout)
:: block ×
LOGICAL,
INTENT(out)
:: tr × × × × × × × × ×
LOGICAL,
INTENT(out)
:: found × × × × × × × × ×
INTEGER,
INTENT(out),
OPTIONAL
:: row_size × × × × × × × × ×
INTEGER,
INTENT(out),
OPTIONAL
:: col_size × × × × × × × × ×

Generic procedure dbcsr_put_block

...

TYPE(dbcsr_type),
INTENT(inout)
:: matrix × × × × × × × × ×
INTEGER,
INTENT(in)
:: row × × × × × × × × ×
INTEGER,
INTENT(in)
:: col × × × × × × × × ×
:: block ×
REAL(real_8),
INTENT(in)
:: block(:) ×
REAL(real_4),
INTENT(in)
:: block(:) ×
COMPLEX(real_8),
INTENT(in)
:: block(:) ×
COMPLEX(real_4),
INTENT(in)
:: block(:) ×
REAL(real_8),
INTENT(in)
:: block(:,:) ×
REAL(real_4),
INTENT(in)
:: block(:,:) ×
COMPLEX(real_8),
INTENT(in)
:: block(:,:) ×
COMPLEX(real_4),
INTENT(in)
:: block(:,:) ×
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) × × × × × × × × ×
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed × × × × × × × × ×
LOGICAL,
INTENT(in),
OPTIONAL
:: summation × × × × × × × × ×
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop × × × × × × × × ×
INTENT(in),
OPTIONAL
:: scale ×
REAL(real_8),
INTENT(in),
OPTIONAL
:: scale × ×
REAL(real_4),
INTENT(in),
OPTIONAL
:: scale × ×
COMPLEX(real_8),
INTENT(in),
OPTIONAL
:: scale × ×
COMPLEX(real_4),
INTENT(in),
OPTIONAL
:: scale × ×

Generic procedure dbcsr_reserve_block2d

Put a 2-D block in a DBCSR matrix using the btree

TYPE(dbcsr_type),
INTENT(inout)
:: matrix × × × ×
INTEGER,
INTENT(in)
:: row × × × ×
INTEGER,
INTENT(in)
:: col × × × ×
REAL(real_4),
POINTER
:: block(:,:) ×
REAL(real_8),
POINTER
:: block(:,:) ×
COMPLEX(real_4),
POINTER
:: block(:,:) ×
COMPLEX(real_8),
POINTER
:: block(:,:) ×
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed × × × ×
LOGICAL,
INTENT(out),
OPTIONAL
:: existed × × × ×

SUBROUTINEdbcsr_remove_block(matrix, row, col, block_nze, block_number)

Marks a block for removal from a DBCSR matrix. Handles symmetric matrices.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row row of block to remove
INTEGER,
INTENT(in)
:: col column of block to remove
INTEGER,
INTENT(in)
:: block_nze ...
INTEGER,
INTENT(in),
OPTIONAL
:: block_number the block number, if it is known

SUBROUTINEdbcsr_reserve_all_blocks(matrix)

Inserts all blocks of a dbcsr matrix to make it a full matrix. Thus obviously not linear scaling.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix Matrix into which blocks should be added.

SUBROUTINEdbcsr_reserve_blocks(matrix, rows, columns, blk_pointers)

Inserts block reservations into a matrix, avoiding the work matrix.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix Matrix into which blocks should be added.
INTEGER,
INTENT(in)
:: rows(:) Rows of the blocks to add
INTEGER,
INTENT(in)
:: columns(:) Columns of the blocks to add
INTEGER,
INTENT(in),
OPTIONAL
:: blk_pointers(:) block pointers to use for new blocks

SUBROUTINEdbcsr_reserve_diag_blocks(matrix)

Inserts diagonal blocks of a dbcsr matrix to make it a matrix with at least all diagonal blocks present

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix Matrix into which blocks should be added.

SUBROUTINEdbcsr_get_block_p_d(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 1-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_8),
POINTER
:: block(:) the block to get (rank-1 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_block_p_s(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 1-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_4),
POINTER
:: block(:) the block to get (rank-1 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_block_p_z(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 1-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_8),
POINTER
:: block(:) the block to get (rank-1 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_block_p_c(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 1-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_4),
POINTER
:: block(:) the block to get (rank-1 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_2d_block_p_d(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 2-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_8),
POINTER
:: block(:,:) the block to get (rank-2 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_2d_block_p_s(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 2-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_4),
POINTER
:: block(:,:) the block to get (rank-2 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_2d_block_p_z(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 2-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_8),
POINTER
:: block(:,:) the block to get (rank-2 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_2d_block_p_c(matrix, row, col, block, tr, found, row_size, col_size)

Gets a 2-d block from a dbcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_4),
POINTER
:: block(:,:) the block to get (rank-2 array)
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_get_block_p_area(matrix, row, col, block, tr, found, row_size, col_size)

Gets a block from a dbcsr matrix as a data area

Arguments:
TYPE(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
INTENT(inout)
:: block the block to get
LOGICAL,
INTENT(out)
:: tr whether the data is transposed
LOGICAL,
INTENT(out)
:: found whether the block exists in the matrix
INTEGER,
INTENT(out),
OPTIONAL
:: row_size logical row size of block
INTEGER,
INTENT(out),
OPTIONAL
:: col_size logical column size of block

SUBROUTINEdbcsr_put_block_area(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

We allow : matrix(dp) [+]= [scale(dp)] * block(dp) matrix(dp) [+]= [scale(dp)] * block(sp) matrix(sp) [+]= [scale(dp)] * block(sp)

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix ...
INTEGER,
INTENT(in)
:: row ...
INTEGER,
INTENT(in)
:: col ...
:: block ...
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed ...
LOGICAL,
INTENT(in),
OPTIONAL
:: summation ...
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
INTENT(in),
OPTIONAL
:: scale ...

SUBROUTINEdbcsr_put_block_d(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Inserts a block in a dbcsr matrix.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the logical row
INTEGER,
INTENT(in)
:: col the logical column
REAL(real_8),
INTENT(in)
:: block(:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
REAL(real_8),
INTENT(in),
OPTIONAL
:: scale scale the OBblock being added

SUBROUTINEdbcsr_put_block_s(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Inserts a block in a dbcsr matrix.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the logical row
INTEGER,
INTENT(in)
:: col the logical column
REAL(real_4),
INTENT(in)
:: block(:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
REAL(real_4),
INTENT(in),
OPTIONAL
:: scale scale the OBblock being added

SUBROUTINEdbcsr_put_block_z(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Inserts a block in a dbcsr matrix.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the logical row
INTEGER,
INTENT(in)
:: col the logical column
COMPLEX(real_8),
INTENT(in)
:: block(:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
COMPLEX(real_8),
INTENT(in),
OPTIONAL
:: scale scale the OBblock being added

SUBROUTINEdbcsr_put_block_c(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Inserts a block in a dbcsr matrix.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the logical row
INTEGER,
INTENT(in)
:: col the logical column
COMPLEX(real_4),
INTENT(in)
:: block(:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
COMPLEX(real_4),
INTENT(in),
OPTIONAL
:: scale scale the OBblock being added

SUBROUTINEdbcsr_put_block2d_d(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Put a 2-D block in a DBCSR matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_8),
INTENT(in)
:: block(:,:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
REAL(real_8),
INTENT(in),
OPTIONAL
:: scale scale the block being added

SUBROUTINEdbcsr_put_block2d_s(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Put a 2-D block in a DBCSR matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_4),
INTENT(in)
:: block(:,:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
REAL(real_4),
INTENT(in),
OPTIONAL
:: scale scale the block being added

SUBROUTINEdbcsr_put_block2d_z(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Put a 2-D block in a DBCSR matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_8),
INTENT(in)
:: block(:,:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
COMPLEX(real_8),
INTENT(in),
OPTIONAL
:: scale scale the block being added

SUBROUTINEdbcsr_put_block2d_c(matrix, row, col, block, lb_row_col, transposed, summation, flop, scale)

Put a 2-D block in a DBCSR matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_4),
INTENT(in)
:: block(:,:) the block to put
INTEGER,
INTENT(inout),
OPTIONAL
:: lb_row_col(2) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block is transposed
LOGICAL,
INTENT(in),
OPTIONAL
:: summation if block exists, then sum the new block to the old one instead of replacing it
INTEGER(int_8),
INTENT(inout),
OPTIONAL
:: flop ...
COMPLEX(real_4),
INTENT(in),
OPTIONAL
:: scale scale the block being added

SUBROUTINEdbcsr_reserve_block2d_s(matrix, row, col, block, transposed, existed)

Put a 2-D block in a DBCSR matrix using the btree

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_4),
POINTER
:: block(:,:) the block to reserve; added if not NULL
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block holds transposed data
LOGICAL,
INTENT(out),
OPTIONAL
:: existed block already existed

SUBROUTINEdbcsr_reserve_block2d_d(matrix, row, col, block, transposed, existed)

Put a 2-D block in a DBCSR matrix using the btree

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
REAL(real_8),
POINTER
:: block(:,:) the block to reserve; added if not NULL
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block holds transposed data
LOGICAL,
INTENT(out),
OPTIONAL
:: existed block already existed

SUBROUTINEdbcsr_reserve_block2d_c(matrix, row, col, block, transposed, existed)

Put a 2-D block in a DBCSR matrix using the btree

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_4),
POINTER
:: block(:,:) the block to reserve; added if not NULL
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block holds transposed data
LOGICAL,
INTENT(out),
OPTIONAL
:: existed block already existed

SUBROUTINEdbcsr_reserve_block2d_z(matrix, row, col, block, transposed, existed)

Put a 2-D block in a DBCSR matrix using the btree

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row the row
INTEGER,
INTENT(in)
:: col the column
COMPLEX(real_8),
POINTER
:: block(:,:) the block to reserve; added if not NULL
LOGICAL,
INTENT(in),
OPTIONAL
:: transposed the block holds transposed data
LOGICAL,
INTENT(out),
OPTIONAL
:: existed block already existed