Returns the single/double precision real/complex data
Calling This routine is hidden behind the dbcsr_get_data interface, hence the need for the select_data_type argument. see dbcsr_get_data_p_d
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_data_obj), | intent(in) | :: | area |
data area |
||
real(kind=real_8), | intent(in) | :: | select_data_type |
force datatype |
||
integer, | intent(in), | optional | :: | lb |
lower bound for pointer upper bound for pointer |
|
integer, | intent(in), | optional | :: | ub |
lower bound for pointer upper bound for pointer |
pointer to data
FUNCTION dbcsr_get_data_c_d (area, select_data_type, lb, ub) RESULT(DATA) !! Returns the single/double precision real/complex data !! !! Calling !! This routine is hidden behind the dbcsr_get_data interface, hence the !! need for the select_data_type argument. !! see dbcsr_get_data_p_d TYPE(dbcsr_data_obj), INTENT(IN) :: area !! data area REAL(kind=real_8), INTENT(IN) :: select_data_type !! force datatype INTEGER, INTENT(IN), OPTIONAL :: lb, ub !! lower bound for pointer !! upper bound for pointer REAL(kind=real_8), DIMENSION(:), POINTER :: DATA !! pointer to data INTEGER :: l, u ! --------------------------------------------------------------------------- ! The select_data_type argument is needed to make this function unique ! enough to use in the interface. IF (KIND(select_data_type) .NE. KIND(DATA)) & DBCSR_ABORT("compiler borken") IF (ASSOCIATED(area%d)) THEN IF (area%d%data_type /= dbcsr_type_real_8) & DBCSR_ABORT("dbcsr_get_data_c_d: data-area has wrong type") IF (PRESENT(lb) .OR. PRESENT(ub)) THEN l = LBOUND(area%d%r_dp, 1) IF (PRESENT(lb)) l = lb u = UBOUND(area%d%r_dp, 1) IF (PRESENT(ub)) u = ub IF (debug_mod) THEN IF (l .LT. LBOUND(area%d%r_dp, 1)) & DBCSR_ABORT("Out of bounds") IF (u .GT. UBOUND(area%d%r_dp, 1)) & DBCSR_ABORT("Out of bounds") END IF DATA => area%d%r_dp (l:u) ELSE DATA => area%d%r_dp END IF ELSE NULLIFY (DATA) END IF END FUNCTION dbcsr_get_data_c_d