ddeabm_interp Subroutine

private subroutine ddeabm_interp(me, tc, yc, istat)

Interpolation function. Can be used for dense output after a step. It calls the low-level routine dintp.

Type Bound

ddeabm_class

Arguments

Type IntentOptional Attributes Name
class(ddeabm_class), intent(inout) :: me
real(kind=wp), intent(in) :: tc

point at which solution is desired

real(kind=wp), intent(out), dimension(me%neq) :: yc

interpolated state at tc

integer, intent(out), optional :: istat

status flag:

  • 0 : success
  • -1 : no integration step is available to interpolate (yc is set to the current integrator state, which is zero before the first call to integrate).

If not present, an error message is printed in this case.


Calls

proc~~ddeabm_interp~~CallsGraph proc~ddeabm_interp ddeabm_class%ddeabm_interp proc~dintp dintp proc~ddeabm_interp->proc~dintp proc~report_error report_error proc~ddeabm_interp->proc~report_error

Called by

proc~~ddeabm_interp~~CalledByGraph proc~ddeabm_interp ddeabm_class%ddeabm_interp proc~ddeabm_with_event_wrapper ddeabm_with_event_class%ddeabm_with_event_wrapper proc~ddeabm_with_event_wrapper->proc~ddeabm_interp proc~ddeabm_with_event_wrapper_vec ddeabm_with_event_class_vec%ddeabm_with_event_wrapper_vec proc~ddeabm_with_event_wrapper_vec->proc~ddeabm_interp

Source Code

   subroutine ddeabm_interp(me, tc, yc, istat)

      implicit none

      class(ddeabm_class), intent(inout)       :: me
      real(wp), intent(in)                     :: tc  !! point at which solution is desired
      real(wp), dimension(me%neq), intent(out)  :: yc  !! interpolated state at `tc`
      integer, intent(out), optional           :: istat !! status flag:
                                                        !!
                                                        !! * 0 : success
                                                        !! * -1 : no integration step is available
                                                        !!   to interpolate (`yc` is set to the
                                                        !!   current integrator state, which is zero
                                                        !!   before the first call to `integrate`).
                                                        !!
                                                        !! If not present, an error message is
                                                        !! printed in this case.

      if (present(istat)) istat = 0

      ! the interpolating polynomial is not defined until a step
      ! has been taken (and the step size must be nonzero):
      if (me%kold < 1 .or. me%x == me%xold) then
         yc = me%yy
         if (present(istat)) then
            istat = -1
         else
            call report_error('ddeabm_interp', &
                              'no integration step is available for interpolation.', 0, 0)
         end if
         return
      end if

      ! interpolate to get the state at tc:
      call dintp(me%x, me%yy, tc, yc, &
                 me%ypout, me%neq, me%kold, me%phi, &
                 me%ivc, me%iv, me%kgi, me%gi, me%alpha, &
                 me%g, me%w, me%xold, me%p)

   end subroutine ddeabm_interp