Repository navigation
New features
- Maximum step size. New optional
max_step_sizeargument toinitializeandinitialize_event. It limits the magnitude of every integration step. By default, there is no limit. - User-selectable maximum order (#22). New optional
max_orderargument (1 to 20, default 12). With the default, results are identical to previous versions.- A lower order can improve stability on some problems.
- A higher order mainly helps with
REAL128at very tight tolerances. For example, at a tolerance of 1e-30,max_order=16needed 1.6 to 1.9 times fewer function evaluations than 12.
- Continuing an interrupted integration. New
resume_integrationmethod. Call it afteridid= -1 (step limit reached), -2 (tolerances increased by the code), -3, or -4 (problem appears stiff), and then call the integration routine again. Previously, there was no way to continue through the class interface. interpolatehas a new optionalistatoutput, which is-1if no integration step has been taken yet.- New public constants
ddeabm_default_max_order(12) andddeabm_max_order_limit(20).
Bug fixes
Integrator
- A leftover value in the caller's
ididvariable (e.g., -33 or -2 from a previous call) could make a valid call fail immediately. initial_step_mode=3could take a first step pasttoutortstop.rtol=atol=0(most accurate solution) always failed. It can now be continued withresume_integration.interpolatedivided by zero if called before any integration step.- A mismatched size of
rtoloratolwas silently ignored, and only the first element was used. A size-1rtolcombined with a size-neqatol(or the reverse) now gives vector tolerances. - Calling
integrateon an uninitialized or destroyed object crashed. It now returnsidid=-33.
Event location
- Vector events: if any event function was zero at the start, roots of all the functions were ignored over the first interval.
gvalwas not set when the integration ended without finding a root.- With
tstep, the root location was less accurate than the requested tolerance (it was found by extrapolating over several integration steps). - With
continue=.true., the rest of the integration step in which the previous event was found was skipped (#17). Events in that part of the step could be missed, and fixed-step output points were skipped. - Vector events: the returned state was not always computed at the root time.
- With
continue=.true., atmaxbeyondtstopwas not rejected. - A
tsteptoo small to advance the time (lost in roundoff) could produce an effectively unlimited number of output points. It now returnsidid=-33. - When the input was rejected (
idid=-33), the event function was still called.
Behavior changes
These may affect existing code:
- Invalid input sizes: an
rtoloratolwhose size is neither 1 norneqnow stops the program (error stop) ininitialize. Agvalof the wrong size (vector events) or an invalidtstepnow returnsidid=-33. - Event evaluation: the event function is evaluated at the end of each integration step, as well as every
tstep(if given). Fixed-step output points are interpolated within each step. - Continuing after an event (
continue=.true.): withtstep, the output points now start at the event and continue everytstepfrom there. - Relaxed tolerances: tolerances increased by the code (
idid=-2) are kept when the integration is resumed. They are reset only at the start of a new problem (first_call). - Stiffness detection: it is not done when
max_orderis 4 or less.
Testing and development
- New unit test (
test/ddeabm_unit_test.f90) and regression test (test/ddeabm_regression_test.f90). The tests check results against known solutions, and they pass forREAL32,REAL64andREAL128builds. - A pixi environment (
pixi.toml) for development, and CI updates.