Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(container_t), | intent(inout) | :: | container | |||
character(len=*), | intent(in) | :: | tag | |||
type(c_ptr), | intent(out) | :: | ptr | |||
integer(kind=c_int32_t), | intent(out), | optional | :: | type_id | ||
integer(kind=c_int32_t), | intent(out), | optional | :: | ndims | ||
integer(kind=c_int64_t), | intent(out), | optional | :: | dims(:) | ||
integer(kind=c_int64_t), | intent(out), | optional | :: | data_size |
function tagarray_get_cptr(container, tag, ptr, type_id, ndims, dims, data_size) result(res) type(container_t), intent(inout) :: container character(len=*), intent(in) :: tag type(c_ptr), intent(out) :: ptr integer(c_int64_t) :: res integer(c_int32_t), optional, intent(out) :: type_id integer(c_int32_t), optional, intent(out) :: ndims integer(c_int64_t), optional, intent(out) :: dims(:) integer(c_int64_t), optional, intent(out) :: data_size type(recordinfo_t) :: record_info ptr = c_null_ptr record_info = container%get_record_info(tag) res = container%get_status() if (res == TA_OK) then ptr = record_info%data res = product(record_info%dimensions(1:record_info%n_dimensions)) if (present(type_id)) type_id = record_info%type_id if (present(ndims )) ndims = record_info%n_dimensions if (present(dims )) dims = record_info%dimensions if (present(data_size )) data_size = record_info%data_length end if end function tagarray_get_cptr