NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
|
This module will provide some basic convenience routines Description. More...
Data Types | |
type | timer |
Simple timer. Holds start-time, stop-time, and time-difference. More... | |
Functions/Subroutines | |
integer function, public | is_inf (x) |
is_inf Checks if the argument is plus or minus infinite. | |
subroutine, public | print_msg (msg, sub, errcode, unit) |
Print a message, and optionally stop the program. | |
This module will provide some basic convenience routines Description.
Eventually it will provide:
iso_fortran_env
)For numerical work we need to use specific minimal precision which is machine-and-compiler-independent. The real type definitions emphatize this. The names are sp
and dp
are chosen only by tradition/historic reasons. We define types with at least 15 decimal places and exponent range of 307. (see for instance http://fortranwiki.org/fortran/show/Real+precision). We also could use c_double from module iso_c_binding (fortran 2003 and later)
integer function, public is_inf | ( | real(dp), intent(in) | x | ) |
is_inf Checks if the argument is plus or minus infinite.
[in] | x | Variable to test |
References zero.
Referenced by timer::assignment().
subroutine, public print_msg | ( | character(len=*), intent(in) | msg, |
character(len=*), intent(in), optional | sub, | ||
integer, intent(in), optional | errcode, | ||
integer, intent(in), optional | unit ) |
Print a message, and optionally stop the program.
If errcode > 0 stop the program
The first three examples print the given message and stop the program. The next two will keep running after printing the message to stderr. The last will keep running after printing the message to a previously open file.
[in] | msg | Message to print on stderr |
[in] | sub | Routine name. Default = None |
[in] | errcode | Error code. Default = 0 |
[in] | unit | Unit to write. Default = stderr |
Referenced by timer::assignment(), csplines::cspl_clean(), csplevder::cspl_interpdev(), csplevder::cspl_interpdev_tab(), csplines::csplder(), csplines::csplrep(), histograms::histogram(), polynomial::polyder(), polynomial::polyint(), save_array::save_array1d(), and save_array::save_array2d().