Compute the function at t and x, or get it from the function evaluation
cache if it is there (see set_fsal_cache). This is used by all the variable-step
methods for the first stage of a step. It may already be in the cache because:
If it is not in the cache, it is computed and saved in the cache.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
subroutine check_fsal_cache(me,t,x,f) class(rk_variable_step_class),intent(inout) :: me real(wp),intent(in) :: t real(wp),dimension(:),intent(in) :: x real(wp),dimension(:),intent(out) :: f logical :: fsal !! if we can avoid a step due to first-same-as-last fsal = .false. if (allocated(me%x_saved)) then if (size(x) == size(me%x_saved)) then fsal = all(x==me%x_saved) .and. t==me%t_saved end if end if if (fsal) then f = me%f_saved else call me%set_fsal_cache(t, x, f) end if end subroutine check_fsal_cache