mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 06:05:29 -04:00
DBX: Remove dbcsr_iterator_next_1d_block
This commit is contained in:
parent
f85442acf3
commit
599c882fa0
7 changed files with 15 additions and 42 deletions
|
|
@ -207,7 +207,7 @@ CONTAINS
|
|||
REAL(dp) :: rnorm
|
||||
REAL(kind=dp) :: norm
|
||||
REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: v_vec, w_vec
|
||||
REAL(kind=dp), DIMENSION(:), POINTER :: data_vec
|
||||
REAL(kind=dp), DIMENSION(:, :), POINTER :: data_block
|
||||
TYPE(arnoldi_control_type), POINTER :: control
|
||||
TYPE(arnoldi_data_type), POINTER :: ar_data
|
||||
TYPE(dbcsr_iterator_type) :: iter
|
||||
|
|
@ -235,9 +235,9 @@ CONTAINS
|
|||
! Setup the initial normalized random vector (sufficient if it only happens on proc_col 0)
|
||||
CALL dbcsr_iterator_start(iter, vectors%input_vec)
|
||||
DO WHILE (dbcsr_iterator_blocks_left(iter))
|
||||
CALL dbcsr_iterator_next_block(iter, row, col, data_vec, row_size=row_size, col_size=col_size)
|
||||
CALL dbcsr_iterator_next_block(iter, row, col, data_block, row_size=row_size, col_size=col_size)
|
||||
iseed(1) = 2; iseed(2) = MOD(row, 4095); iseed(3) = MOD(col, 4095); iseed(4) = 11
|
||||
CALL dlarnv(2, iseed, row_size*col_size, data_vec)
|
||||
CALL dlarnv(2, iseed, row_size*col_size, data_block)
|
||||
END DO
|
||||
CALL dbcsr_iterator_stop(iter)
|
||||
END IF
|
||||
|
|
@ -298,7 +298,7 @@ CONTAINS
|
|||
REAL(dp) :: rnorm
|
||||
REAL(kind=dp) :: denom, norm
|
||||
REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: v_vec, w_vec
|
||||
REAL(kind=dp), DIMENSION(:), POINTER :: data_vec
|
||||
REAL(kind=dp), DIMENSION(:, :), POINTER :: data_block
|
||||
TYPE(arnoldi_control_type), POINTER :: control
|
||||
TYPE(arnoldi_data_type), POINTER :: ar_data
|
||||
TYPE(dbcsr_iterator_type) :: iter
|
||||
|
|
@ -326,9 +326,9 @@ CONTAINS
|
|||
! Setup the initial normalized random vector (sufficient if it only happens on proc_col 0)
|
||||
CALL dbcsr_iterator_start(iter, vectors%input_vec)
|
||||
DO WHILE (dbcsr_iterator_blocks_left(iter))
|
||||
CALL dbcsr_iterator_next_block(iter, row, col, data_vec, row_size=row_size, col_size=col_size)
|
||||
CALL dbcsr_iterator_next_block(iter, row, col, data_block, row_size=row_size, col_size=col_size)
|
||||
iseed(1) = 2; iseed(2) = MOD(row, 4095); iseed(3) = MOD(col, 4095); iseed(4) = 11
|
||||
CALL dlarnv(2, iseed, row_size*col_size, data_vec)
|
||||
CALL dlarnv(2, iseed, row_size*col_size, data_block)
|
||||
END DO
|
||||
CALL dbcsr_iterator_stop(iter)
|
||||
END IF
|
||||
|
|
|
|||
|
|
@ -242,7 +242,6 @@ MODULE cp_dbcsr_api
|
|||
|
||||
INTERFACE dbcsr_iterator_next_block
|
||||
MODULE PROCEDURE dbcsr_iterator_next_block_index
|
||||
MODULE PROCEDURE dbcsr_iterator_next_1d_block
|
||||
MODULE PROCEDURE dbcsr_iterator_next_2d_block
|
||||
END INTERFACE
|
||||
|
||||
|
|
@ -1034,31 +1033,6 @@ CONTAINS
|
|||
CALL dbcsr_iterator_next_block_prv(iterator%prv, row=row, column=column, blk=blk)
|
||||
END SUBROUTINE dbcsr_iterator_next_block_index
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param iterator ...
|
||||
!> \param row ...
|
||||
!> \param column ...
|
||||
!> \param block ...
|
||||
!> \param block_number ...
|
||||
!> \param row_size ...
|
||||
!> \param col_size ...
|
||||
!> \param row_offset ...
|
||||
!> \param col_offset ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE dbcsr_iterator_next_1d_block(iterator, row, column, block, &
|
||||
block_number, row_size, col_size, &
|
||||
row_offset, col_offset)
|
||||
TYPE(dbcsr_iterator_type), INTENT(INOUT) :: iterator
|
||||
INTEGER, INTENT(OUT) :: row, column
|
||||
REAL(kind=dp), DIMENSION(:), POINTER :: block
|
||||
INTEGER, INTENT(OUT), OPTIONAL :: block_number, row_size, col_size, &
|
||||
row_offset, col_offset
|
||||
|
||||
CALL dbcsr_iterator_next_block_prv(iterator%prv, row, column, block, block_number, &
|
||||
row_size, col_size, row_offset, col_offset)
|
||||
END SUBROUTINE dbcsr_iterator_next_1d_block
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief ...
|
||||
!> \param iterator ...
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ CONTAINS
|
|||
|
||||
INTEGER :: col_atom, handle, row_atom
|
||||
LOGICAL :: found
|
||||
REAL(dp), DIMENSION(:), POINTER :: block_values, block_values2
|
||||
REAL(dp), DIMENSION(:, :), POINTER :: block_values, block_values2
|
||||
TYPE(dbcsr_iterator_type) :: iter
|
||||
TYPE(dbcsr_type), POINTER :: tmp
|
||||
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ CONTAINS
|
|||
INTEGER :: col_atom, group_handle, handle, i, &
|
||||
ispin, row_atom
|
||||
REAL(dp) :: alpha, max_alpha
|
||||
REAL(dp), DIMENSION(:), POINTER :: block_values
|
||||
REAL(dp), DIMENSION(:, :), POINTER :: block_values
|
||||
TYPE(dbcsr_iterator_type) :: iter
|
||||
TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_new
|
||||
TYPE(dbcsr_type), POINTER :: tmp
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ CONTAINS
|
|||
nder, row_atom
|
||||
INTEGER, DIMENSION(6, 2) :: c_map_mat
|
||||
LOGICAL :: return_s_derivatives
|
||||
REAL(dp), DIMENSION(:), POINTER :: block_values
|
||||
REAL(dp), DIMENSION(:, :), POINTER :: block_values
|
||||
TYPE(dbcsr_iterator_type) :: iter
|
||||
TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: C_mat, S_der, s_derivs
|
||||
TYPE(dbcsr_type), POINTER :: B_mat, tmp_mat, tmp_mat2
|
||||
|
|
|
|||
|
|
@ -483,9 +483,8 @@ CONTAINS
|
|||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'generate_extended_space_sparse'
|
||||
|
||||
INTEGER :: col, col_offset, handle, homo, i_first, i_last, imo, iteration, j, jj, k, &
|
||||
max_iter, n, nao, nmat, nmat2, nmo, nmo_converged, nmo_not_converged, nset, nset_conv, &
|
||||
nset_not_conv, row
|
||||
INTEGER :: col_offset, handle, homo, i_first, i_last, imo, iteration, j, jj, k, max_iter, n, &
|
||||
nao, nmat, nmat2, nmo, nmo_converged, nmo_not_converged, nset, nset_conv, nset_not_conv
|
||||
INTEGER, ALLOCATABLE, DIMENSION(:) :: iconv, inotconv
|
||||
INTEGER, ALLOCATABLE, DIMENSION(:, :) :: iconv_set, inotconv_set
|
||||
LOGICAL :: converged, do_apply_preconditioner
|
||||
|
|
@ -577,7 +576,7 @@ CONTAINS
|
|||
vnorm = 0.0_dp
|
||||
CALL dbcsr_iterator_start(iter, matrix_z)
|
||||
DO WHILE (dbcsr_iterator_blocks_left(iter))
|
||||
CALL dbcsr_iterator_next_block(iter, row, col, block, col_offset=col_offset)
|
||||
CALL dbcsr_iterator_next_block(iter, block=block, col_offset=col_offset)
|
||||
DO j = 1, SIZE(block, 2)
|
||||
vnorm(col_offset + j - 1) = vnorm(col_offset + j - 1) + SUM(block(:, j)**2)
|
||||
END DO
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ CONTAINS
|
|||
|
||||
INTEGER :: col_atom, i, ikind, kind_atom, row_atom
|
||||
LOGICAL :: found
|
||||
REAL(dp), DIMENSION(:), POINTER :: block_values, block_values2
|
||||
REAL(dp), DIMENSION(:, :), POINTER :: block_values, block_values2
|
||||
TYPE(dbcsr_iterator_type) :: iter
|
||||
|
||||
DO i = 1, 3
|
||||
|
|
@ -185,7 +185,7 @@ CONTAINS
|
|||
!The block_values are in a vector format,
|
||||
! so the dot_product is the sum over all elements of the hamand product, that I need
|
||||
force(ikind)%ehrenfest(i, kind_atom) = force(ikind)%ehrenfest(i, kind_atom) + &
|
||||
2.0_dp*DOT_PRODUCT(block_values, block_values2)
|
||||
2.0_dp*SUM(block_values*block_values2)
|
||||
END IF
|
||||
END DO
|
||||
CALL dbcsr_iterator_stop(iter)
|
||||
|
|
@ -202,7 +202,7 @@ CONTAINS
|
|||
!The block_values are in a vector format, so the dot_product is
|
||||
! the sum over all elements of the hamand product, that I need
|
||||
force(ikind)%ehrenfest(i, kind_atom) = force(ikind)%ehrenfest(i, kind_atom) + &
|
||||
2.0_dp*DOT_PRODUCT(block_values, block_values2)
|
||||
2.0_dp*SUM(block_values*block_values2)
|
||||
END IF
|
||||
END DO
|
||||
CALL dbcsr_iterator_stop(iter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue