get_data_2d_d Subroutine

private subroutine get_data_2d_d(area, DATA, lb, ub)

Returns the single/double precision real/complex data

Arguments

Type IntentOptional Attributes Name
type(dbcsr_data_obj), intent(in) :: area

data area

real(kind=real_8), DIMENSION(:, :), POINTER :: DATA

pointer to data

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


Source Code

      SUBROUTINE get_data_2d_d (area, DATA, lb, ub)
     !! Returns the single/double precision real/complex data

         TYPE(dbcsr_data_obj), INTENT(IN)            :: area
        !! data area
         REAL(kind=real_8), 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_8_2d) &
               DBCSR_ABORT("get_data_2d_d: data-area has wrong type")
            IF (PRESENT(lb) .OR. PRESENT(ub)) THEN
               l = LBOUND(area%d%r2_dp)
               IF (PRESENT(lb)) l = lb
               u = UBOUND(area%d%r2_dp)
               IF (PRESENT(ub)) u = ub
               IF (debug_mod) THEN
                  IF (l(1) < LBOUND(area%d%r2_dp, 1)) &
                     DBCSR_ABORT("Out of bounds")
                  IF (l(2) < LBOUND(area%d%r2_dp, 2)) &
                     DBCSR_ABORT("Out of bounds")
                  IF (u(1) > UBOUND(area%d%r2_dp, 1)) &
                     DBCSR_ABORT("Out of bounds")
                  IF (u(2) > UBOUND(area%d%r2_dp, 2)) &
                     DBCSR_ABORT("Out of bounds")
               END IF
               DATA => area%d%r2_dp (l(1):u(1), l(2):u(2))
            ELSE
               DATA => area%d%r2_dp
            END IF
         ELSE
            NULLIFY (DATA)
         END IF
      END SUBROUTINE get_data_2d_d