Adds a coordinate (or other data) into a work matrix's row_i and col_i arrays and returns its position.
Note
Uses the matrix%lastblk to keep track of the current position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | matrix |
work matrix |
||
integer, | intent(in) | :: | row |
row data to add col data to add |
||
integer, | intent(in) | :: | col |
row data to add col data to add |
||
integer, | intent(in), | optional | :: | blk |
block pointer to add |
|
integer, | intent(out), | optional | :: | index |
saved position |
SUBROUTINE add_work_coordinate(matrix, row, col, blk, index) !! Adds a coordinate (or other data) into a work matrix's row_i and !! col_i arrays and returns its position. !! @note Uses the matrix%lastblk to keep track of the current position. TYPE(dbcsr_work_type), INTENT(INOUT) :: matrix !! work matrix INTEGER, INTENT(IN) :: row, col !! row data to add !! col data to add INTEGER, INTENT(IN), OPTIONAL :: blk !! block pointer to add INTEGER, INTENT(OUT), OPTIONAL :: index !! saved position CHARACTER(len=*), PARAMETER :: routineN = 'add_work_coordinate' INTEGER :: handle ! --------------------------------------------------------------------------- IF (careful_mod) CALL timeset(routineN, handle) matrix%lastblk = matrix%lastblk + 1 CALL ensure_array_size(matrix%row_i, ub=matrix%lastblk, & factor=default_resize_factor) CALL ensure_array_size(matrix%col_i, ub=matrix%lastblk, & factor=default_resize_factor) matrix%row_i(matrix%lastblk) = row matrix%col_i(matrix%lastblk) = col IF (PRESENT(blk)) THEN CALL ensure_array_size(matrix%blk_p, ub=matrix%lastblk, & factor=default_resize_factor) matrix%blk_p(matrix%lastblk) = blk END IF IF (PRESENT(index)) index = matrix%lastblk IF (careful_mod) CALL timestop(handle) END SUBROUTINE add_work_coordinate