export_point Subroutine

private subroutine export_point(me, t, x, first_or_last)

Wrapper for exporting points during integration.

Type Bound

rk_class

Arguments

Type IntentOptional Attributes Name
class(rk_class), intent(inout) :: me
real(kind=wp), intent(in) :: t
real(kind=wp), intent(in), dimension(:) :: x
logical, intent(in), optional :: first_or_last

if this is the first or last point (always reported)


Called by

proc~~export_point~~CalledByGraph proc~export_point rklib_module::rk_class%export_point proc~integrate_fixed_step rklib_module::rk_fixed_step_class%integrate_fixed_step proc~integrate_fixed_step->proc~export_point proc~integrate_to_event_fixed_step rklib_module::rk_fixed_step_class%integrate_to_event_fixed_step proc~integrate_to_event_fixed_step->proc~export_point proc~integrate_to_event_variable_step rklib_module::rk_variable_step_class%integrate_to_event_variable_step proc~integrate_to_event_variable_step->proc~export_point proc~integrate_variable_step rklib_module::rk_variable_step_class%integrate_variable_step proc~integrate_variable_step->proc~export_point program~rklib_example rklib_example program~rklib_example->proc~integrate_variable_step

Source Code

    subroutine export_point(me,t,x,first_or_last)
        class(rk_class),intent(inout) :: me
        real(wp),intent(in) :: t
        real(wp),dimension(:),intent(in) :: x
        logical,intent(in),optional :: first_or_last  !! if this is the first or
                                                      !! last point (always reported)

        logical :: export !! if the point is to be exported

        if (associated(me%report) .and. me%report_rate > 0) then

            export = .false.
            if (present(first_or_last)) then
                ! always report first and last step
                if (first_or_last) export = .true.
            end if

            if (.not. export) then
                ! report steps at user-specified rate
                export = modulo(me%num_steps, me%report_rate) == 0
            end if

            if (export) call me%report(t,x)

        end if

    end subroutine export_point