Loading [MathJax]/extensions/tex2jax.js
MRFFL: MR Fortran Finance Library 2024-12-28
Computational Tools For Finance
All Namespaces Files Functions Variables
mrffl_config.f90
Go to the documentation of this file.
1! -*- Mode:F90; Coding:us-ascii-unix; fill-column:129 -*-
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.H.S.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.H.E.!!
3!>
4!! @file mrffl_config.f90
5!! @author Mitch Richling http://www.mitchr.me/
6!! @date 2024-12-19
7!! @brief Configuratoin for MRFFL.@EOL
8!! @keywords finance fortran monte carlo inflation cashflow time value of money tvm percentages taxes stock market
9!! @std F2023
10!! @see https://github.com/richmit/FortranFinance
11!! @copyright
12!! @parblock
13!! Copyright (c) 2024, Mitchell Jay Richling <http://www.mitchr.me/> All rights reserved.
14!!
15!! Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
16!! conditions are met:
17!!
18!! 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following
19!! disclaimer.
20!!
21!! 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following
22!! disclaimer in the documentation and/or other materials provided with the distribution.
23!!
24!! 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
25!! derived from this software without specific prior written permission.
26!!
27!! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
28!! INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29!! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
31!! USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32!! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33!! OF THE POSSIBILITY OF SUCH DAMAGE.
34!! @endparblock
35!! @filedetails
36!!
37
38!----------------------------------------------------------------------------------------------------------------------------------
39!> Configuration for MRFFL (MR Fortran Finance Library).
40!!
42 use, intrinsic:: iso_c_binding, only: c_int32_t, c_double
43 implicit none
44 private
45
46 integer, parameter, public :: mrfflik = c_int32_t !< Integer kinds used in interfaces
47 integer, parameter, public :: mrfflrk = c_double !< Real kind used in interfaces
48
49 real(kind=mrfflrk), parameter, public :: zero_epsilon = 1.0d-8 !< Used to test for zero
50
51 character(len=5), public :: mrfflcnfmt = "f15.4" !< Used to print cash values
52 character(len=5), public :: mrfflctfmt = "a15" !< Used to print cash titles
53
54 !
55 ! Typical settings for mrfflcnfmt & mrfflctfmt:
56 !
57 ! 000000000011111111112222222222
58 ! 123456789012345678901234567890
59 ! -000000000000000.0000 => 999 Trillion f21.4 a21 Nation state level economic models
60 ! -000000000000000.00 => 999 Trillion f19.2 a19
61 ! -000000000000000. => 999 Trillion f17.0 a17
62 ! -000000000000.0000 => 999 Billion f18.4 a18 Corprate finance
63 ! -000000000000.00 => 999 Billion f16.2 a16
64 ! -000000000000. => 999 Billion f14.0 a14
65 ! -000000000.0000 => 999 Million f15.4 a15 Retirement planning
66 ! -000000000.00 => 999 Million f13.2 a13
67 ! -000000000. => 999 Million f11.0 a11
68 ! -000000.0000 => 999 Thousand f12.4 a12 Small real estate & car loans
69 ! -000000.00 => 999 Thousand f10.4 a10
70 ! -000000. => 999 Thousand f8.4 a8
71 !
72
73contains
74
75end module mrffl_config
Configuration for MRFFL (MR Fortran Finance Library).
integer, parameter, public mrfflrk
Real kind used in interfaces.
real(kind=mrfflrk), parameter, public zero_epsilon
Used to test for zero.
integer, parameter, public mrfflik
Integer kinds used in interfaces.
character(len=5), public mrfflcnfmt
Used to print cash values.
character(len=5), public mrfflctfmt
Used to print cash titles.