![]() |
MRKISS 2025-09-10
A tiny library with zero dependencies that aims to make it easy to use & experiment with explicit Runge-Kutta methods.
|
Utilities. More...
Functions/Subroutines | |
I/O | |
| subroutine, public | print_solution (status, solution, filename_o, separator_o, fmt_w_o, fmt_d_o, fmt_e_o, start_o, end_o, step_o, prt_titles_o, t_min_o, t_max_o, tag_o, append_o) |
| Output an RK solution matrix. | |
| subroutine, public | print_istats (status, istats, idxs_to_prt_o, filename_o, fmt_w_o, prt_zeros_o) |
| Output an istat array. | |
| subroutine, public | analyze_solution (status, solution, filename_o, start_o, end_o, y_delta_len_idxs_o, fmt_w_o, fmt_d_o, fmt_e_o) |
| Analyze an RK solution matrix. | |
Miscellaneous | |
| subroutine, public | seq (status, t, from_o, to_o, step_o, max_pts_o) |
| Produce a sequence of values with fixed seporation. | |
Status Codes | |
| character(len=32) function, public | status_to_origin (status) |
| Return, as a string, the source of a status code. | |
| character(len=128) function, public | status_to_message (status) |
| Return, as a string, the source of a status code. | |
Utilities.
| subroutine, public mrkiss_utils::print_solution | ( | integer, intent(out) | status, |
| real(kind=rk), dimension(:,:), intent(in) | solution, | ||
| character(len=*), intent(in), optional | filename_o, | ||
| character(len=*), intent(in), optional | separator_o, | ||
| integer, intent(in), optional | fmt_w_o, | ||
| integer, intent(in), optional | fmt_d_o, | ||
| integer, intent(in), optional | fmt_e_o, | ||
| integer, intent(in), optional | start_o, | ||
| integer, intent(in), optional | end_o, | ||
| integer, intent(in), optional | step_o, | ||
| logical, intent(in), optional | prt_titles_o, | ||
| real(kind=rk), intent(in), optional | t_min_o, | ||
| real(kind=rk), intent(in), optional | t_max_o, | ||
| integer, intent(in), optional | tag_o, | ||
| logical, intent(in), optional | append_o ) |
Output an RK solution matrix.
Examples
| status | Exit status
| ||||||||||
| solution | Array containing the solution. Each COLUMN is a solution:
| ||||||||||
| filename_o | Filename to which we print. Default: NONE
| ||||||||||
| fmt_d_o | Number of digits for floating point numbers. Default: mrkiss_config::fmt_d_ai | ||||||||||
| fmt_w_o | Width of print format for all entities. Default: 0
| ||||||||||
| fmt_e_o | Number of digits in the exponent of floating point numbers. Default: mrkiss_config::fmt_e_ai
| ||||||||||
| start_o | Starting index to print in solution. Default: 1 | ||||||||||
| end_o | Ending index to print in solution. Default: Number of columns in solution. | ||||||||||
| step_o | Print only every step_o th value in solution. Default: 1 | ||||||||||
| prt_titles_o | Print titles if .TRUE. Default: .not. append_o | ||||||||||
| separator_o | String to place between fields. Default: ',' if fmt_w_o missing, and ' ' otherwise. | ||||||||||
| t_min_o | Print only solutions with time values >= t_min_o | ||||||||||
| t_max_o | Print only solutions with time values <= t_min_o | ||||||||||
| tag_o | If non-negative, this integer that will become the first column of the output. Default: -1 | ||||||||||
| append_o | Append to file instead of overwriting. Default: .FALSE. |
Definition at line 89 of file mrkiss_utils.f90.
| subroutine, public mrkiss_utils::print_istats | ( | integer, intent(out) | status, |
| integer, dimension(istats_size), intent(in) | istats, | ||
| integer, dimension(:), intent(in), optional | idxs_to_prt_o, | ||
| character(len=*), intent(in), optional | filename_o, | ||
| integer, intent(in), optional | fmt_w_o, | ||
| logical, intent(in), optional | prt_zeros_o ) |
Output an istat array.
| status | Exit status
| ||||||||||
| istats(:) | Integer statistics from a solver run. See mrkiss_utils::print_istats() for description of elements. | ||||||||||
| idxs_to_prt_o(:) | Indexes of istats to print. Indexes too large are silently ignored. | ||||||||||
| filename_o | Filename to which we print. Default: NONE
| ||||||||||
| fmt_w_o | Width of print format for all entities. Default: mrkiss_config::fmt_w_ai | ||||||||||
| prt_zeros_o | If .TRUE., then print zero values. Default: .FALSE. |
Definition at line 252 of file mrkiss_utils.f90.
| subroutine, public mrkiss_utils::analyze_solution | ( | integer, intent(out) | status, |
| real(kind=rk), dimension(:,:), intent(in) | solution, | ||
| character(len=*), intent(in), optional | filename_o, | ||
| integer, intent(in), optional | start_o, | ||
| integer, intent(in), optional | end_o, | ||
| integer, dimension(:), intent(in), optional | y_delta_len_idxs_o, | ||
| integer, intent(in), optional | fmt_w_o, | ||
| integer, intent(in), optional | fmt_d_o, | ||
| integer, intent(in), optional | fmt_e_o ) |
Analyze an RK solution matrix.
| status | Exit status
| ||||||||||
| solution | Array containing the solution. Each COLUMN is a solution:
| ||||||||||
| start_o | Starting index to use in solution. Default: 1 | ||||||||||
| end_o | Ending index to use in solution. Default: Number of columns in solution. | ||||||||||
| y_delta_len_idxs_o | Components of \(\mathbf{\Delta{y}}\) to use for length computation | ||||||||||
| filename_o | Filename to which we print. Default: NONE
| ||||||||||
| fmt_d_o | Number of digits for floating point numbers. Default: mrkiss_config::fmt_d_ai | ||||||||||
| fmt_w_o | Width of print format for all entities. Default: mrkiss_config::fmt_w_ai | ||||||||||
| fmt_e_o | Number of digits in the exponent of floating point numbers. Default: mrkiss_config::fmt_e_ai |
Definition at line 330 of file mrkiss_utils.f90.
| subroutine, public mrkiss_utils::seq | ( | integer, intent(out) | status, |
| real(kind=rk), dimension(:), intent(out) | t, | ||
| real(kind=rk), intent(in), optional | from_o, | ||
| real(kind=rk), intent(in), optional | to_o, | ||
| real(kind=rk), intent(in), optional | step_o, | ||
| integer, intent(in), optional | max_pts_o ) |
Produce a sequence of values with fixed seporation.
Modeled after R's seq() function.
Exactly two of from_o, to_o, and step_o should be provided. The one not provided will be computed from the others. If all three are are provided, then they will be checked for consistency. Note that this consistency check is not completely reliable due to round-off error. This is why only two should be provided.
| status | Exit status
| ||||||||||
| t | Vector to fill with \(t\) values | ||||||||||
| from_o | Starting value for \(t\) | ||||||||||
| to_o | Ending value for \(t\) | ||||||||||
| step_o | Delta between valeus | ||||||||||
| max_pts_o | Maximum number of points to produce. Default: size(t, 1) If max_pts_o < size(t, 1), then elements beyond max_pts_o will be untouched. |
Definition at line 474 of file mrkiss_utils.f90.
| character(len=32) function, public mrkiss_utils::status_to_origin | ( | integer, intent(in) | status | ) |
Return, as a string, the source of a status code.
Status codes are assigned in blocks to subroutines and interfaces. Status codes are frequently "passed up" the call chain. i.e. a routine may return a status code that was returned to it by another routine it called. Assigning the codes in blocks allows the user to know from which subroutine a status code originated.
Assigned Status Ranges
I use the following bit of Emacs lisp code to generate new blocks:
!! (let ((s )) !! (cl-loop for f from 1348 to 2000 by 17 !! do (print f) !! do (setq s (concat s (format f (+ 16 f))))) !! s) !!
| status | This is an intent(in) argument!!!! |
Definition at line 583 of file mrkiss_utils.f90.


| character(len=128) function, public mrkiss_utils::status_to_message | ( | integer, intent(in) | status | ) |
Return, as a string, the source of a status code.
| status | This is an intent(in) argument!!!! |
Definition at line 643 of file mrkiss_utils.f90.

