MRKISS 2025-09-10
A tiny library with zero dependencies that aims to make it easy to use & experiment with explicit Runge-Kutta methods.
Loading...
Searching...
No Matches
mrkiss_config.f90
Go to the documentation of this file.
1! -*- Mode:F90; Coding:us-ascii-unix; fill-column:129 -*-
2!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.H.S.!!
3!>
4!! @file mrkiss_config.f90
5!! @author Mitch Richling http://www.mitchr.me/
6!! @brief Configuration for MRKISS == MR RK KISS == Mitch Richling's Runge-Kutta Keep It Simple Stupid.@EOL
7!! @std F2023
8!! @see https://github.com/richmit/MRKISS/
9!! @copyright
10!! @parblock
11!! Copyright (c) 2025, Mitchell Jay Richling <http://www.mitchr.me/> All rights reserved.
12!!
13!! Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
14!! conditions are met:
15!!
16!! 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following
17!! disclaimer.
18!!
19!! 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following
20!! disclaimer in the documentation and/or other materials provided with the distribution.
21!!
22!! 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
23!! derived from this software without specific prior written permission.
24!!
25!! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
26!! INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27!! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
29!! USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30!! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31!! OF THE POSSIBILITY OF SUCH DAMAGE.
32!! @endparblock
33!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.H.E.!!
34
35!----------------------------------------------------------------------------------------------------------------------------------
36!> Configuration for MRKISS == MR RK KISS == Mitch Richling's Runge-Kutta Keep It Simple Stupid
37!!
39 use, intrinsic:: iso_c_binding, only: c_double, c_float
40 implicit none
41 private
42
43 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44 !> @name Real type used for computations
45
46 integer, parameter, public :: rk = c_double !< Real kind used across the library
47
48 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49 !> @name ab initio frmat specificaiton constants
50
51 integer, parameter, public :: fmt_d_ai = 15 !< Real print format: digits to the right of decimal
52 integer, parameter, public :: fmt_w_ai = 25 !< Numeric print format: total width
53 integer, parameter, public :: fmt_e_ai = 4 !< Real print format: digits in exponent
54
55 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
56 !> @name Constants related to istats
57
58 integer, parameter, public :: istats_size = 16 !< Number of elements in istats(:)
59 integer, parameter, public :: istats_max_idx = 10 !< Number of used elements in istats(:)
60
61 integer, parameter, public :: isi_num_pts = 1 !< istats index num_pts
62 integer, parameter, public :: isi_one_reg = 2 !< istats index one_step_norm
63 integer, parameter, public :: isi_all_norm = 3 !< istats index one_etab_norm
64 integer, parameter, public :: isi_one_y_err = 4 !< istats index one_step_y_delta_err
65 integer, parameter, public :: isi_all_y_err = 5 !< istats index one_stab_y_delta_err
66 integer, parameter, public :: isi_one_y_len = 6 !< istats index one_step_y_delta_len
67 integer, parameter, public :: isi_one_spp_td = 7 !< istats index one_step_stepp_t_delta
68 integer, parameter, public :: isi_sdf_step = 8 !< istats index one_step_sdf_bisection
69 integer, parameter, public :: isi_bic_max = 9 !< istats index bisect_fail_max
70 integer, parameter, public :: isi_bic_bnd = 10 !< istats index bisect_fail_containment
71
72 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
73 !> @name Constants related to istats messages
74
75 integer, parameter, public :: istats_str_lng = 62 !< Length of istats content message
76 !> Array of istats descriptions
77 !! @showinlinesource
78 character(len=istats_str_lng), parameter, public :: istats_strs(istats_size) = [ &
79! SS-BEGIN:istats_strings:
80 "Computed solution points ", & ! istats( 1)
81 "step_one call count not caused by an event ", & ! istats( 2)
82 "step_all call count not caused by an event ", & ! istats( 3)
83 "step_one call count caused by y_delta error constraint ", & ! istats( 4)
84 "step_all call count caused by y_delta error constraint ", & ! istats( 5)
85 "step_one call count caused by y_delta length constraint ", & ! istats( 6)
86 "step_one call count caused by step processing with new t_delta", & ! istats( 7)
87 "step_one call count caused by SDF bisection ", & ! istats( 8)
88 "Bisection failures due to max_bisect_o ", & ! istats( 9)
89 "Bisection failures due to target containment ", & ! istats(10)
90 " ", & ! istats(11)
91 " ", & ! istats(12)
92 " ", & ! istats(13)
93 " ", & ! istats(14)
94 " ", & ! istats(15)
95 " " ]
96! SS-END:istats_strings:
97
98 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
99 !> @name Absolute constants
100
101 real(kind=rk), parameter, public :: zero_epsilon = 1.0e-12_rk !< Used to test for zero
102 real(kind=rk), parameter, public :: t_delta_tiny = tiny(zero_epsilon) * 1.0e18_rk !< Smallest value for t_delta
103
104 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
105 !> @name ab initio parameters for defaults when we know nothing
106
107 real(kind=rk), parameter, public :: t_delta_ai = 1.0e-4_rk !< t_delta ai default
108 real(kind=rk), parameter, public :: error_tol_abs_ai = 1.0e-5_rk !< error_tol_abs ai default
109 real(kind=rk), parameter, public :: error_tol_rel_ai = 1.0e-3_rk !< error_tol_rel ai default
110 integer, parameter, public :: max_bisect_ai = 1000 !< max_bisect ai default
111 real(kind=rk), parameter, public :: t_delta_fac_min_ai = 0.5_rk !< t_delta_fac_min ai default
112 real(kind=rk), parameter, public :: t_delta_fac_max_ai = 2.0_rk !< t_delta_fac_max ai default
113 real(kind=rk), parameter, public :: t_delta_fac_fdg_ai = 0.5_rk !< t_delta_fac_fdg ai default
114 real(kind=rk), parameter, public :: sdf_tol_ai = 1.0e-3 !< sdf_tol ai default
115 real(kind=rk), parameter, public :: t_delta_min_ai = t_delta_tiny !< t_delta_min ai default
116
117end module mrkiss_config
118
119
120!----------------------------------------------------------------------------------------------------------------------------------
121!> @mainpage
122!!
123!! @image html MRKISS_logo_c_500x250.png
124!!
125!! MRKISS == MR RK KISS == Mitch Richling's Runge-Kutta Keep It Simple Stupid
126!!
127!! [MRKISS](https://github.com/richmit/MRKISS) is a *tiny* library with *zero dependencies* that aims to make it easy to *use*
128!! and *experiment with* explicit Runge-Kutta methods.
129!!
130!! Everything is on github: https://github.com/richmit/MRKISS
131!!
132!! For an overview of MRKISS and some tutorial information, check out the [documentation](https://richmit.github.io/MRKISS/index.html).
133!!
134!! A couple of the examples in the repository have longer explanatory documentation:
135!! - [Three Body Problem](https://richmit.github.io/MRKISS/ex_three_body.html)
136!! - [Lornez Attracter](https://richmit.github.io/MRKISS/ex_lorenz.html)
137!! - [Step Size & Order Vs. Accuracy](https://richmit.github.io/MRKISS/ex_step_order_vs_error.html)
138!! - [Langford Attracter](https://richmit.github.io/MRKISS/ex_langford.html)
139!! - [Step Size Vs. Accuracy](https://richmit.github.io/MRKISS/ex_step_too_far.html)
140!!
141!! Generated [API documentation](https://www.mitchr.me/SS/MRKISS/doc-lib/html/index.html) is viable as well.
142!!
143!! Development News:
144!! - [changelog](https://richmit.github.io/MRKISS/changelog.html)
145!! - [roadmap](https://richmit.github.io/MRKISS/roadmap.html)
146!!
147!! This library powers the [Strange Attractor Zoo](https://richmit.github.io/StrangeAttractorZoo/).
148!!
149!! The canonical URL for this documentation: https://www.mitchr.me/SS/MRKISS/doc-lib/html/index.html
150!!
Configuration for MRKISS == MR RK KISS == Mitch Richling's Runge-Kutta Keep It Simple Stupid.
integer, parameter, public isi_all_y_err
istats index one_stab_y_delta_err
real(kind=rk), parameter, public t_delta_fac_fdg_ai
t_delta_fac_fdg ai default
integer, parameter, public isi_num_pts
istats index num_pts
real(kind=rk), parameter, public zero_epsilon
Used to test for zero.
integer, parameter, public isi_one_y_err
istats index one_step_y_delta_err
integer, parameter, public isi_bic_max
istats index bisect_fail_max
real(kind=rk), parameter, public t_delta_ai
t_delta ai default
integer, parameter, public isi_one_y_len
istats index one_step_y_delta_len
integer, parameter, public isi_one_spp_td
istats index one_step_stepp_t_delta
integer, parameter, public rk
Real kind used across the library.
real(kind=rk), parameter, public t_delta_min_ai
t_delta_min ai default
integer, parameter, public isi_one_reg
istats index one_step_norm
real(kind=rk), parameter, public t_delta_tiny
Smallest value for t_delta.
real(kind=rk), parameter, public sdf_tol_ai
sdf_tol ai default
integer, parameter, public isi_sdf_step
istats index one_step_sdf_bisection
real(kind=rk), parameter, public error_tol_abs_ai
error_tol_abs ai default
integer, parameter, public istats_size
Number of elements in istats(:)
integer, parameter, public fmt_d_ai
Real print format: digits to the right of decimal.
integer, parameter, public istats_str_lng
Length of istats content message.
integer, parameter, public isi_all_norm
istats index one_etab_norm
integer, parameter, public isi_bic_bnd
istats index bisect_fail_containment
integer, parameter, public fmt_e_ai
Real print format: digits in exponent.
integer, parameter, public istats_max_idx
Number of used elements in istats(:)
real(kind=rk), parameter, public error_tol_rel_ai
error_tol_rel ai default
integer, parameter, public fmt_w_ai
Numeric print format: total width.
real(kind=rk), parameter, public t_delta_fac_min_ai
t_delta_fac_min ai default
character(len=istats_str_lng), dimension(istats_size), parameter, public istats_strs
Array of istats descriptions.
real(kind=rk), parameter, public t_delta_fac_max_ai
t_delta_fac_max ai default
integer, parameter, public max_bisect_ai
max_bisect ai default