Core routines used by two or more of the hompack solvers.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | problem_fix_point | = | 1 | |
| integer, | public, | parameter | :: | problem_zero_find | = | 2 | |
| integer, | public, | parameter | :: | problem_curve_track | = | 3 | |
| integer, | public, | parameter | :: | hompack_success | = | 1 |
Container to hold user routines for f-suffix (dense Jacobian) methods.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| procedure(f_t), | public, | nopass, pointer | :: | f | => | null() | |
| procedure(fjac_t), | public, | nopass, pointer | :: | fjac | => | null() | |
| procedure(rho_t), | public, | nopass, pointer | :: | rho | => | null() | |
| procedure(rhojac_t), | public, | nopass, pointer | :: | rhojac | => | null() | |
| type(c_ptr), | public | :: | data | = | c_null_ptr |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | code | = | hompack_success | ||
| character(len=256), | public | :: | message | = | "" |
| procedure, public :: ok => hompack_status_ok |
State variables for root.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=dp), | public | :: | a |
Previous iterate point used for secant step calculation. |
|||
| real(kind=dp), | public | :: | acbs |
Width of the bracketing interval at the last forced bisection checkpoint. |
|||
| real(kind=dp), | public | :: | acmb |
Absolute value of half the current interval length, |
|||
| real(kind=dp), | public | :: | ae |
Internal absolute error tolerance bound, |
|||
| real(kind=dp), | public | :: | cmb |
Half-interval vector representation, |
|||
| real(kind=dp), | public | :: | fa |
Function value evaluated at point |
|||
| real(kind=dp), | public | :: | fb |
Function value evaluated at point |
|||
| real(kind=dp), | public | :: | fc |
Function value evaluated at point |
|||
| real(kind=dp), | public | :: | fx |
Maximum initial absolute function value, used to detect poles or divergence. |
|||
| real(kind=dp), | public | :: | p |
Numerator of the proposed secant step update fraction |
|||
| real(kind=dp), | public | :: | q |
Denominator of the proposed secant step update fraction |
|||
| real(kind=dp), | public | :: | re |
Internal relative error tolerance bound, |
|||
| real(kind=dp), | public | :: | tol |
Dynamic convergence tolerance threshold for the current iteration step. |
|||
| integer, | public | :: | ic |
Counter of sequential secant steps used to force bisection if convergence stalls. |
|||
| integer, | public | :: | fcount |
Total number of function evaluations completed so far. |
This function computes the Hermite cubic interpolant at a point s.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | f0 |
Function value at the start of the interval. |
||
| real(kind=dp), | intent(in) | :: | fp0 |
Derivative value at the start of the interval. |
||
| real(kind=dp), | intent(in) | :: | f1 |
Function value at the end of the interval. |
||
| real(kind=dp), | intent(in) | :: | fp1 |
Derivative value at the end of the interval. |
||
| real(kind=dp), | intent(in) | :: | dels |
Width of the interpolation interval. |
||
| real(kind=dp), | intent(in) | :: | s |
Local coordinate of the interpolation point to the start. |
This subroutine computes a root of the nonlinear equation f(x) = 0 where f(x)
is a continuous real function of a single real variable x. The method used is a
combination of bisection and the secant rule.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | t |
Point at which the function is to be evaluated.
On output with |
||
| real(kind=dp), | intent(inout) | :: | ft |
Function value at |
||
| real(kind=dp), | intent(inout) | :: | b |
Lower endpoint of the current bracketing interval.
On input, together with |
||
| real(kind=dp), | intent(inout) | :: | c |
Upper endpoint of the current bracketing interval. On output, contains the second endpoint of the final bracketing interval. |
||
| real(kind=dp), | intent(in) | :: | relerr |
Relative error tolerance.
Convergence is declared when |
||
| real(kind=dp), | intent(in) | :: | abserr |
Absolute error tolerance.
Used together with |
||
| integer, | intent(inout) | :: | iflag |
Reverse-communication control and status flag. |
||
| type(root_state), | intent(inout) | :: | state |
Internal state of the root-finding iteration. The caller should not modify it.
Used internally by |