dbcsr_data_get_sizes_1 Subroutine

private subroutine dbcsr_data_get_sizes_1(area, total_size, valid)

Returns the allocated data size

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_data_obj), intent(in) :: area

data area to query for size

integer, intent(out) :: total_size

size of array

logical, intent(out) :: valid

whether the data is actually allocated


Contents


Source Code

   SUBROUTINE dbcsr_data_get_sizes_1(area, total_size, valid)
      !! Returns the allocated data size

      TYPE(dbcsr_data_obj), INTENT(IN)                   :: area
         !! data area to query for size
      INTEGER, INTENT(OUT)                               :: total_size
         !! size of array
      LOGICAL, INTENT(OUT)                               :: valid
         !! whether the data is actually allocated

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

      INTEGER                                            :: handle
      INTEGER, DIMENSION(1)                              :: s

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

      CALL timeset(routineN, handle)

      IF (ASSOCIATED(area%d)) THEN
         IF (careful_mod .AND. dbcsr_type_is_2d(area%d%data_type)) &
            DBCSR_ABORT("Should not use 2-D data")
         CALL dbcsr_data_get_sizes_any(area, s, valid)
         total_size = s(1)
      ELSE
         valid = .FALSE.
         total_size = 0
      END IF
      CALL timestop(handle)
   END SUBROUTINE dbcsr_data_get_sizes_1