check_fsal_cache Subroutine

private subroutine check_fsal_cache(me, t, x, f)

Check the FSAL cache.

Type Bound

rk_variable_step_fsal_class

Arguments

Type IntentOptional 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

Calls

proc~~check_fsal_cache~~CallsGraph proc~check_fsal_cache rklib_module::rk_variable_step_fsal_class%check_fsal_cache f f proc~check_fsal_cache->f

Called by

proc~~check_fsal_cache~~CalledByGraph proc~check_fsal_cache rklib_module::rk_variable_step_fsal_class%check_fsal_cache proc~rkbs32 rklib_variable_steps::rkbs32 proc~rkbs32->proc~check_fsal_cache proc~rkdp54 rklib_variable_steps::rkdp54 proc~rkdp54->proc~check_fsal_cache proc~rkpp54 rklib_variable_steps::rkpp54 proc~rkpp54->proc~check_fsal_cache proc~rkpp54b rklib_variable_steps::rkpp54b proc~rkpp54b->proc~check_fsal_cache proc~rks54 rklib_variable_steps::rks54 proc~rks54->proc~check_fsal_cache proc~rkt54 rklib_variable_steps::rkt54 proc~rkt54->proc~check_fsal_cache proc~rktf65 rklib_variable_steps::rktf65 proc~rktf65->proc~check_fsal_cache proc~rkv65e rklib_variable_steps::rkv65e proc~rkv65e->proc~check_fsal_cache proc~rkv65r rklib_variable_steps::rkv65r proc~rkv65r->proc~check_fsal_cache

Source Code

    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