private pure function root_dup_tol(x1, x2) result(tol)
Tolerance for removing duplicate roots in db1root: two roots
closer than this are the same root (found twice, e.g. at a knot).
It is relative to the width of the domain (the resolution of the
roots found in the knot intervals), plus one unit in the last place
of the coordinates. It is not relative to the coordinates
themselves, which would merge distinct roots for a narrow domain
far from zero.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
pure function root_dup_tol(x1,x2)result(tol)implicit nonereal(wp),intent(in)::x1!! left end of the domain: `t(k)`real(wp),intent(in)::x2!! right end of the domain: `t(n+1)`real(wp)::tol!! the duplicate tolerance! (the domain width is scaled before the subtraction, so it does not overflow)tol=(root_xtol*x2-root_xtol*x1)+spacing(max(abs(x1),abs(x2)))end function root_dup_tol