dbcsr_scale_s Subroutine

private subroutine dbcsr_scale_s(matrix_a, alpha_scalar, last_column)

Interface for matrix scaling by a scalar

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: matrix_a
real(kind=real_4), intent(in) :: alpha_scalar
integer, intent(in), optional :: last_column

Contents

Source Code


Source Code

      SUBROUTINE dbcsr_scale_s (matrix_a, alpha_scalar, last_column)
      !! Interface for matrix scaling by a scalar
         TYPE(dbcsr_type), INTENT(INOUT)           :: matrix_a
         REAL(kind=real_4), INTENT(IN)                      :: alpha_scalar
         INTEGER, INTENT(IN), OPTIONAL            :: last_column

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

         INTEGER                                  :: error_handler
         TYPE(dbcsr_scalar_type)                  :: sc

         sc = dbcsr_scalar(alpha_scalar)
         CALL dbcsr_scalar_fill_all(sc)
         sc%data_type = dbcsr_get_data_type(matrix_a)
         CALL timeset(routineN, error_handler)
         IF (PRESENT(last_column)) THEN
            CALL dbcsr_scale_anytype(matrix_a, &
                                     alpha_scalar=sc, &
                                     limits=(/0, 0, 0, last_column/))
         ELSE
            CALL dbcsr_scale_anytype(matrix_a, alpha_scalar=sc)
         END IF
         CALL timestop(error_handler)
      END SUBROUTINE dbcsr_scale_s