dbcsr_data_set_ac Subroutine

private subroutine dbcsr_data_set_ac(dst, lb, data_size, src, source_lb)

Copy data from a double real array to a data area There are no checks done for correctness!

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_data_obj), intent(inout) :: dst

destination data area

integer, intent(in) :: lb

lower bound for destination (and source if not given explicitly) number of elements to copy

integer, intent(in) :: data_size

lower bound for destination (and source if not given explicitly) number of elements to copy

complex(kind=real_4), intent(in), DIMENSION(:), CONTIGUOUS:: src

source data array

integer, intent(in), optional :: source_lb

lower bound of source


Contents

Source Code


Source Code

      SUBROUTINE dbcsr_data_set_ac (dst, lb, data_size, src, source_lb)
     !! Copy data from a double real array to a data area
     !! There are no checks done for correctness!

         TYPE(dbcsr_data_obj), INTENT(INOUT)      :: dst
        !! destination data area
         INTEGER, INTENT(IN)                      :: lb, data_size
        !! lower bound for destination (and source if not given explicitly)
        !! number of elements to copy
         COMPLEX(kind=real_4), DIMENSION(:), INTENT(IN), CONTIGUOUS :: src
        !! source data array
         INTEGER, INTENT(IN), OPTIONAL            :: source_lb
        !! lower bound of source
         INTEGER                                  :: lb_s, ub, ub_s

         COMPLEX(kind=real_4), DIMENSION(:), POINTER, CONTIGUOUS :: cont_data

!    ---------------------------------------------------------------------------
         IF (debug_mod) THEN
            IF (.NOT. ASSOCIATED(dst%d)) &
               DBCSR_ABORT("Target data area must be setup.")
            IF (SIZE(src) .LT. data_size) &
               DBCSR_ABORT("Not enough source data.")
            IF (dst%d%data_type .NE. dbcsr_type_complex_4) &
               DBCSR_ABORT("Data type mismatch.")
         END IF
         ub = lb + data_size - 1
         IF (PRESENT(source_lb)) THEN
            lb_s = source_lb
            ub_s = source_lb + data_size - 1
         ELSE
            lb_s = lb
            ub_s = ub
         END IF
         cont_data => dst%d%c_sp (lb:ub)
         CALL memory_copy(cont_data, src(lb_s:ub_s), data_size)
      END SUBROUTINE dbcsr_data_set_ac