Right trim an autodiff array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | a | ||
| integer, | intent(in) | :: | b | |||
| integer, | intent(in), | optional | :: | dim |
module function rtrim_array(a, b, dim) result(c) !! Right trim an autodiff array implicit none class(array_type), intent(in), target :: a integer, intent(in) :: b integer, intent(in), optional :: dim type(array_type), pointer :: c if(present(dim)) then c => slice_left_array(a, size(a%val, dim) - b, dim) else c => slice_left_array(a, size(a%val, 1) - b, 1) end if end function rtrim_array