dbcsr_zero Subroutine

public subroutine dbcsr_zero(matrix_a)

fill a dbcsr matrix with zeros

Arguments

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

Source Code

   SUBROUTINE dbcsr_zero(matrix_a)
      !! fill a dbcsr matrix with zeros
      TYPE(dbcsr_type), INTENT(INOUT)                    :: matrix_a

      CHARACTER(len=*), PARAMETER :: routineN = 'dbcsr_zero'
      INTEGER                                            :: handle

      CALL timeset(routineN, handle)
      SELECT CASE (dbcsr_get_data_type(matrix_a))
#if defined(__DBCSR_DISABLE_WORKSHARE)
      CASE (dbcsr_type_complex_4)
         matrix_a%data_area%d%c_sp = (0.0, 0.0)
      CASE (dbcsr_type_complex_8)
         matrix_a%data_area%d%c_dp = (0.0_dp, 0.0_dp)
      CASE (dbcsr_type_real_4)
         matrix_a%data_area%d%r_sp = 0.0
      CASE (dbcsr_type_real_8)
         matrix_a%data_area%d%r_dp = 0.0_dp
#else
      CASE (dbcsr_type_complex_4)
!$OMP       PARALLEL WORKSHARE DEFAULT(NONE), SHARED(matrix_a)
         matrix_a%data_area%d%c_sp = (0.0, 0.0)
!$OMP       END PARALLEL WORKSHARE
      CASE (dbcsr_type_complex_8)
!$OMP       PARALLEL WORKSHARE DEFAULT(NONE), SHARED(matrix_a)
         matrix_a%data_area%d%c_dp = (0.0_dp, 0.0_dp)
!$OMP       END PARALLEL WORKSHARE
      CASE (dbcsr_type_real_4)
!$OMP       PARALLEL WORKSHARE DEFAULT(NONE), SHARED(matrix_a)
         matrix_a%data_area%d%r_sp = 0.0
!$OMP       END PARALLEL WORKSHARE
      CASE (dbcsr_type_real_8)
!$OMP       PARALLEL WORKSHARE DEFAULT(NONE), SHARED(matrix_a)
         matrix_a%data_area%d%r_dp = 0.0_dp
!$OMP       END PARALLEL WORKSHARE
#endif
      END SELECT
      CALL timestop(handle)
   END SUBROUTINE dbcsr_zero