dbcsr_get_data_p_2d_s Function

public function dbcsr_get_data_p_2d_s(area, lb, ub) result(DATA)

Returns the single/double precision real/complex data \brief dbcsr_get_data_c_s

Calling This routine can be called explicitly.

Arguments

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

data area

integer, intent(in), optional DIMENSION(2):: lb

lower bound for pointer upper bound for pointer

integer, intent(in), optional DIMENSION(2):: ub

lower bound for pointer upper bound for pointer

Return Value real(kind=real_4),DIMENSION(:, :),POINTER

pointer to data


Contents

Source Code


Source Code

      FUNCTION dbcsr_get_data_p_2d_s (area, lb, ub) RESULT(DATA)
     !! Returns the single/double precision real/complex data
     !! \brief dbcsr_get_data_c_s
     !!
     !! Calling
     !! This routine can be called explicitly.

         TYPE(dbcsr_data_obj), INTENT(IN)            :: area
        !! data area
         REAL(kind=real_4), DIMENSION(:, :), POINTER            :: DATA
        !! pointer to data
         INTEGER, DIMENSION(2), INTENT(IN), OPTIONAL :: lb, ub
        !! lower bound for pointer
        !! upper bound for pointer

         INTEGER, DIMENSION(2)          :: l, u
!   ---------------------------------------------------------------------------

         IF (ASSOCIATED(area%d)) THEN
            IF (area%d%data_type /= dbcsr_type_real_4_2d) &
               DBCSR_ABORT("dbcsr_get_data_p_2d_s: data-area has wrong type")
            IF (PRESENT(lb) .OR. PRESENT(ub)) THEN
               l = LBOUND(area%d%r2_sp)
               IF (PRESENT(lb)) l = lb
               u = UBOUND(area%d%r2_sp)
               IF (PRESENT(ub)) u = ub
               IF (debug_mod) THEN
                  IF (l(1) .LT. LBOUND(area%d%r2_sp, 1)) &
                     DBCSR_ABORT("Out of bounds")
                  IF (l(2) .LT. LBOUND(area%d%r2_sp, 2)) &
                     DBCSR_ABORT("Out of bounds")
                  IF (u(1) .GT. UBOUND(area%d%r2_sp, 1)) &
                     DBCSR_ABORT("Out of bounds")
                  IF (u(2) .GT. UBOUND(area%d%r2_sp, 2)) &
                     DBCSR_ABORT("Out of bounds")
               END IF
               DATA => area%d%r2_sp (l(1):u(1), l(2):u(2))
            ELSE
               DATA => area%d%r2_sp
            END IF
         ELSE
            NULLIFY (DATA)
         END IF
      END FUNCTION dbcsr_get_data_p_2d_s