dbcsr_make_index_exist Subroutine

public subroutine dbcsr_make_index_exist(m)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(inout) :: m

Create index for this matrix


Source Code

   SUBROUTINE dbcsr_make_index_exist(m)

      TYPE(dbcsr_type), INTENT(INOUT)                    :: m
         !! Create index for this matrix

      CHARACTER(len=*), PARAMETER :: routineN = 'dbcsr_make_index_exist'

      INTEGER                                            :: error_handle

!   ---------------------------------------------------------------------------

      CALL timeset(routineN, error_handle)
      IF (.NOT. ASSOCIATED(m%index)) &
         DBCSR_ABORT("Index array does not yet exist.")
      IF (.NOT. ASSOCIATED(m%row_p)) THEN
         CALL dbcsr_addto_index_array(m, dbcsr_slot_row_p, &
                                      reservation=m%nblkrows_total + 1)
         m%row_p(:) = 0
      END IF
      IF (.NOT. ASSOCIATED(m%col_i)) THEN
         CALL dbcsr_addto_index_array(m, dbcsr_slot_col_i, &
                                      reservation=0)
      END IF
      IF (.NOT. ASSOCIATED(m%blk_p)) THEN
         CALL dbcsr_addto_index_array(m, dbcsr_slot_blk_p, &
                                      reservation=0)
      END IF
      CALL dbcsr_repoint_index(m)
      CALL timestop(error_handle)
   END SUBROUTINE dbcsr_make_index_exist