Check the FSAL cache.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_variable_step_fsal_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_fsal_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%f(t, x, f) end if end subroutine check_fsal_cache