Bounds-checked element access, 1-based. Any index outside
1:size() (including indices that are within the capacity but
beyond the live elements) sets value to zero and err to
ERROR_VALIDATION. On success err is left untouched.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fixed_array_dp_t), | intent(in) | :: | self | |||
| integer(kind=default_int), | intent(in) | :: | index | |||
| real(kind=dp), | intent(out) | :: | value | |||
| type(error_t), | intent(inout) | :: | err |
pure subroutine fixed_array_dp_at(self, index, value, err) !! Bounds-checked element access, 1-based. Any index outside !! `1:size()` (including indices that are within the capacity but !! beyond the live elements) sets `value` to zero and `err` to !! `ERROR_VALIDATION`. On success `err` is left untouched. class(fixed_array_dp_t), intent(in) :: self integer(default_int), intent(in) :: index real(dp), intent(out) :: value type(error_t), intent(inout) :: err if (index < 1_default_int .or. index > self%n_items) then value = 0.0_dp call err%set(ERROR_VALIDATION, MSG_OUT_OF_RANGE) return end if value = self%items(index) end subroutine fixed_array_dp_at