4 use,
intrinsic :: iso_fortran_env, only : int32, real64
8 public :: int_out_of_memory_error
9 public :: int_count_exceeded_error
10 public :: int_round_off_error
11 public :: int_integrand_behavior_error
12 public :: int_convergence_error
13 public :: int_divergent_error
14 public :: int_invalid_input_error
15 public :: int_lack_of_definition_error
16 public :: int_array_size_mismatch_error
17 public :: int_excessive_work_error
18 public :: int_impractical_tolerance_error
19 public :: int_repeated_error_test_failure
20 public :: int_15_point_rule
21 public :: int_21_point_rule
22 public :: int_31_point_rule
23 public :: int_41_point_rule
24 public :: int_51_point_rule
25 public :: int_61_point_rule
44 integer(int32),
parameter :: int_out_of_memory_error = 1
47 integer(int32),
parameter :: int_count_exceeded_error = 2
49 integer(int32),
parameter :: int_round_off_error = 3
51 integer(int32),
parameter :: int_integrand_behavior_error = 4
53 integer(int32),
parameter :: int_convergence_error = 5
55 integer(int32),
parameter :: int_divergent_error = 6
57 integer(int32),
parameter :: int_invalid_input_error = 7
59 integer(int32),
parameter :: int_lack_of_definition_error = 8
61 integer(int32),
parameter :: int_array_size_mismatch_error = 9
62 integer(int32),
parameter :: int_excessive_work_error = 10
63 integer(int32),
parameter :: int_impractical_tolerance_error = 11
64 integer(int32),
parameter :: int_repeated_error_test_failure = 12
68 integer(int32),
parameter :: int_15_point_rule = 15
70 integer(int32),
parameter :: int_21_point_rule = 21
72 integer(int32),
parameter :: int_31_point_rule = 31
74 integer(int32),
parameter :: int_41_point_rule = 41
76 integer(int32),
parameter :: int_51_point_rule = 51
78 integer(int32),
parameter :: int_61_point_rule = 61
88 use,
intrinsic :: iso_fortran_env, only : real64
89 real(real64),
intent(in) :: x
103 use,
intrinsic :: iso_fortran_env, only : real64
104 real(real64),
intent(in) :: x
105 real(real64),
intent(in),
dimension(:) :: y
106 real(real64),
intent(out),
dimension(:) :: dydx
118 use,
intrinsic :: iso_fortran_env, only : real64
119 real(real64),
intent(in) :: x
120 real(real64),
intent(in),
dimension(:) :: y
121 real(real64),
intent(out),
dimension(:,:) :: jac
134 use,
intrinsic :: iso_fortran_env, only : real64
135 real(real64),
intent(in) :: x
136 real(real64),
intent(in),
dimension(:) :: y
137 real(real64),
intent(out),
dimension(:) :: f
145 real(real64) :: error_estimate
147 integer(int32) :: evaluation_count
150 integer(int32) :: subinterval_count
160 real(real64) :: m_abstol = 1.0d-8
162 real(real64) :: m_reltol = 1.0d-8
164 integer(int32) :: m_maxint = 10
175 procedure,
public :: get_abs_tol => ib_get_abs_tol
185 procedure,
public :: set_abs_tol => ib_set_abs_tol
195 procedure,
public :: get_rel_tol => ib_get_rel_tol
205 procedure,
public :: set_rel_tol => ib_set_rel_tol
216 procedure,
public :: get_max_subintervals => ib_get_max_subintervals
227 procedure,
public :: ib_set_max_subintervals => ib_set_max_subintervals
232 pure module function ib_get_abs_tol(this) result(x)
233 class(integrator_base),
intent(in) :: this
237 module subroutine ib_set_abs_tol(this, x)
238 class(integrator_base),
intent(inout) :: this
239 real(real64),
intent(in) :: x
242 pure module function ib_get_rel_tol(this) result(x)
243 class(integrator_base),
intent(in) :: this
247 module subroutine ib_set_rel_tol(this, x)
248 class(integrator_base),
intent(inout) :: this
249 real(real64),
intent(in) :: x
252 pure module function ib_get_max_subintervals(this) result(x)
253 class(integrator_base),
intent(in) :: this
257 module subroutine ib_set_max_subintervals(this, x)
258 class(integrator_base),
intent(inout) :: this
259 integer(int32),
intent(in) :: x
266 type,
abstract,
extends(integrator_base) :: finite_interval_integrator
269 procedure(finite_interval_fcn),
public,
deferred, pass :: integrate
285 function finite_interval_fcn(this, fcn, a, b, info, err)
result(rst)
286 use,
intrinsic :: iso_fortran_env, only : real64
288 import finite_interval_integrator
290 import integration_behavior
291 class(finite_interval_integrator),
intent(inout) :: this
292 procedure(integrand),
intent(in),
pointer :: fcn
293 real(real64),
intent(in) :: a, b
294 type(integration_behavior),
intent(out),
optional :: info
295 class(errors),
intent(inout),
optional,
target :: err
351 type,
extends(finite_interval_integrator) :: adaptive_integrator
354 real(real64),
allocatable,
dimension(:) :: m_work
356 integer(int32),
allocatable,
dimension(:) :: m_iwork
358 logical :: m_userdefinedbreaks = .false.
360 real(real64),
allocatable,
dimension(:) :: m_breakpoints
376 procedure,
public :: initialize => ai_init
412 procedure,
public :: integrate => ai_integrate
425 procedure,
public :: get_use_breakpoints => ai_get_use_brkpnts
438 procedure,
public :: set_use_breakpoints => ai_set_use_brkpnts
449 procedure,
public :: get_breakpoints => ai_get_breakpoints
462 procedure,
public :: set_breakpoints => ai_set_breakpoints
467 module subroutine ai_init(this, err)
468 class(adaptive_integrator),
intent(inout) :: this
469 class(errors),
intent(inout),
optional,
target :: err
472 module function ai_integrate(this, fcn, a, b, info, err) result(rst)
473 class(adaptive_integrator),
intent(inout) :: this
474 procedure(integrand),
intent(in),
pointer :: fcn
475 real(real64),
intent(in) :: a, b
476 type(integration_behavior),
intent(out),
optional :: info
477 class(errors),
intent(inout),
optional,
target :: err
481 pure module function ai_get_use_brkpnts(this) result(x)
482 class(adaptive_integrator),
intent(in) :: this
486 module subroutine ai_set_use_brkpnts(this, x)
487 class(adaptive_integrator),
intent(inout) :: this
488 logical,
intent(in) :: x
491 module function ai_get_breakpoints(this) result(x)
492 class(adaptive_integrator),
intent(in) :: this
493 real(real64),
allocatable,
dimension(:) :: x
496 module subroutine ai_set_breakpoints(this, x)
497 class(adaptive_integrator),
intent(inout) :: this
498 real(real64),
intent(in),
dimension(:) :: x
508 type,
extends(finite_interval_integrator) :: nonadaptive_integrator
511 integer(int32) :: m_rule = int_15_point_rule
537 procedure,
public :: integrate => ni_integrate
555 procedure,
public :: get_rule => ni_get_rule
578 procedure,
public :: set_rule => ni_set_rule
583 module function ni_integrate(this, fcn, a, b, info, err) result(rst)
584 class(nonadaptive_integrator),
intent(inout) :: this
585 procedure(integrand),
intent(in),
pointer :: fcn
586 real(real64),
intent(in) :: a, b
587 type(integration_behavior),
intent(out),
optional :: info
588 class(errors),
intent(inout),
optional,
target :: err
592 pure module function ni_get_rule(this) result(x)
593 class(nonadaptive_integrator),
intent(in) :: this
597 module subroutine ni_set_rule(this, x, err)
598 class(nonadaptive_integrator),
intent(inout) :: this
599 integer(int32),
intent(in) :: x
600 class(errors),
intent(inout),
optional,
target :: err
612 procedure(ode_fcn),
pointer,
nopass :: m_fcn => null()
614 procedure(ode_jacobian),
pointer,
nopass :: m_jac => null()
616 procedure(ode_constraint),
pointer,
nopass :: m_rts => null()
618 integer(int32) :: m_count = 0
620 integer(int32) :: m_constraints = 0
712 procedure,
public :: define_equations => oh_init
722 procedure,
public :: get_equation_count => oh_get_count
735 procedure,
public :: get_equations_defined => oh_is_fcn_defined
748 procedure,
public :: get_jacobian_defined => oh_is_jac_defined
883 procedure,
public :: define_constraints => oh_define_constraints
893 procedure,
public :: get_constraint_count => oh_get_constraint_count
904 procedure,
public :: get_constraints_defined => oh_get_constraints_defined
919 procedure,
public :: evaluate_ode => oh_eval
933 procedure,
public :: evaluate_jacobian => oh_eval_jac
948 procedure,
public :: evaluate_constraints => oh_eval_constraints
952 module subroutine oh_init(this, neqn, fcn, jac)
953 class(ode_helper),
intent(inout) :: this
954 integer(int32),
intent(in) :: neqn
955 procedure(ode_fcn),
pointer,
intent(in) :: fcn
956 procedure(ode_jacobian),
pointer,
intent(in),
optional :: jac
959 pure module function oh_get_count(this) result(x)
960 class(ode_helper),
intent(in) :: this
964 pure module function oh_is_fcn_defined(this) result(x)
965 class(ode_helper),
intent(in) :: this
969 pure module function oh_is_jac_defined(this) result(x)
970 class(ode_helper),
intent(in) :: this
974 module subroutine oh_define_constraints(this, n, fcn)
975 class(ode_helper),
intent(inout) :: this
976 integer(int32),
intent(in) :: n
977 procedure(ode_constraint),
intent(in),
pointer :: fcn
980 pure module function oh_get_constraint_count(this) result(x)
981 class(ode_helper),
intent(in) :: this
985 pure module function oh_get_constraints_defined(this) result(x)
986 class(ode_helper),
intent(in) :: this
990 module subroutine oh_eval(this, x, y, dydx)
991 class(ode_helper),
intent(inout) :: this
992 real(real64),
intent(in) :: x
993 real(real64),
intent(in),
dimension(:) :: y
994 real(real64),
intent(out),
dimension(:) :: dydx
997 module subroutine oh_eval_jac(this, x, y, jac)
998 class(ode_helper),
intent(inout) :: this
999 real(real64),
intent(in) :: x
1000 real(real64),
intent(in),
dimension(:) :: y
1001 real(real64),
intent(out),
dimension(:,:) :: jac
1004 module subroutine oh_eval_constraints(this, x, y, f)
1005 class(ode_helper),
intent(inout) :: this
1006 real(real64),
intent(in) :: x
1007 real(real64),
intent(in),
dimension(:) :: y
1008 real(real64),
intent(out),
dimension(:) :: f
1015 type,
abstract :: ode_integrator
1017 real(real64),
allocatable,
dimension(:) :: m_rtol
1019 real(real64),
allocatable,
dimension(:) :: m_atol
1022 logical :: m_alloutput = .true.
1026 logical :: m_canovershoot = .true.
1029 real(real64) :: m_criticalpoint = 0.0d0
1031 integer(int32) :: m_minbuffersize = 500
1034 real(real64) :: m_maxstepsize = 1.0d0
1037 logical :: m_limitstepsize = .false.
1039 integer(int32) :: m_maxstepcount = 500
1075 procedure,
public :: integrate => oi_integrate
1087 procedure,
public :: get_provide_all_output => oi_get_use_all_output
1100 procedure,
public :: set_provide_all_output => oi_set_use_all_output
1112 procedure,
public :: get_allow_overshoot => oi_get_allow_overshoot
1125 procedure,
public :: set_allow_overshoot => oi_set_allow_overshoot
1136 procedure,
public :: get_integration_limit => oi_get_critical_point
1147 procedure,
public :: set_integration_limit => oi_set_critical_point
1157 procedure,
public :: get_min_buffer_size => oi_get_min_buffer_size
1169 procedure,
public :: set_min_buffer_size => oi_set_min_buffer_size
1179 procedure,
public :: get_max_step_size => oi_get_max_step_size
1190 procedure,
public :: set_max_step_size => oi_set_max_step_size
1201 procedure,
public :: get_limit_step_size => oi_get_limit_step_size
1214 procedure,
public :: set_limit_step_size => oi_set_limit_step_size
1225 procedure,
public :: get_iteration_limit => oi_get_iteration_limit
1236 procedure,
public :: set_iteration_limit => oi_set_iteration_limit
1246 procedure,
public :: get_relative_tolerances => oi_get_rtol
1256 procedure,
public :: set_relative_tolerances => oi_set_rtol
1266 procedure,
public :: get_absolute_tolerances => oi_get_atol
1276 procedure,
public :: set_absolute_tolerances => oi_set_atol
1304 procedure(ode_integrator_interface),
public,
deferred, pass :: step
1313 procedure(ode_integrator_reset),
public,
deferred, pass :: reset
1340 function ode_integrator_interface(this, fcn, x, y, xout, rtol, atol, err)
result(brk)
1341 use,
intrinsic :: iso_fortran_env, only : int32, real64
1343 import ode_integrator
1345 class(ode_integrator),
intent(inout) :: this
1346 class(ode_helper),
intent(inout) :: fcn
1347 real(real64),
intent(inout) :: x
1348 real(real64),
intent(inout),
dimension(:) :: y
1349 real(real64),
intent(in) :: xout
1350 real(real64),
intent(in),
dimension(:) :: rtol, atol
1351 class(errors),
intent(inout),
optional,
target :: err
1358 subroutine ode_integrator_reset(this)
1359 import ode_integrator
1360 class(ode_integrator),
intent(inout) :: this
1363 module function oi_integrate(this, fcnobj, x, y, err) result(rst)
1364 class(ode_integrator),
intent(inout) :: this
1365 class(ode_helper),
intent(inout) :: fcnobj
1366 real(real64),
intent(in),
dimension(:) :: x, y
1367 class(errors),
intent(inout),
optional,
target :: err
1368 real(real64),
allocatable,
dimension(:,:) :: rst
1371 pure module function oi_get_use_all_output(this) result(x)
1372 class(ode_integrator),
intent(in) :: this
1376 module subroutine oi_set_use_all_output(this, x)
1377 class(ode_integrator),
intent(inout) :: this
1378 logical,
intent(in) :: x
1381 pure module function oi_get_allow_overshoot(this) result(x)
1382 class(ode_integrator),
intent(in) :: this
1386 module subroutine oi_set_allow_overshoot(this, x)
1387 class(ode_integrator),
intent(inout) :: this
1388 logical,
intent(in) :: x
1391 pure module function oi_get_critical_point(this) result(x)
1392 class(ode_integrator),
intent(in) :: this
1396 module subroutine oi_set_critical_point(this, x)
1397 class(ode_integrator),
intent(inout) :: this
1398 real(real64),
intent(in) :: x
1401 pure module function oi_get_min_buffer_size(this) result(x)
1402 class(ode_integrator),
intent(in) :: this
1406 module subroutine oi_set_min_buffer_size(this, x)
1407 class(ode_integrator),
intent(inout) :: this
1408 integer(int32),
intent(in) :: x
1411 pure module function oi_get_max_step_size(this) result(x)
1412 class(ode_integrator),
intent(in) :: this
1416 module subroutine oi_set_max_step_size(this, x)
1417 class(ode_integrator),
intent(inout) :: this
1418 real(real64),
intent(in) :: x
1421 pure module function oi_get_limit_step_size(this) result(x)
1422 class(ode_integrator),
intent(in) :: this
1426 module subroutine oi_set_limit_step_size(this, x)
1427 class(ode_integrator),
intent(inout) :: this
1428 logical,
intent(in) :: x
1431 pure module function oi_get_iteration_limit(this) result(x)
1432 class(ode_integrator),
intent(in) :: this
1436 module subroutine oi_set_iteration_limit(this, x)
1437 class(ode_integrator),
intent(inout) :: this
1438 integer(int32),
intent(in) :: x
1441 module function oi_get_rtol(this) result(x)
1442 class(ode_integrator),
intent(in) :: this
1443 real(real64),
allocatable,
dimension(:) :: x
1446 module subroutine oi_set_rtol(this, x)
1447 class(ode_integrator),
intent(inout) :: this
1448 real(real64),
intent(in),
dimension(:) :: x
1451 module function oi_get_atol(this) result(x)
1452 class(ode_integrator),
intent(in) :: this
1453 real(real64),
allocatable,
dimension(:) :: x
1456 module subroutine oi_set_atol(this, x)
1457 class(ode_integrator),
intent(inout) :: this
1458 real(real64),
intent(in),
dimension(:) :: x
1541 type,
extends(ode_integrator) :: ode_auto
1543 real(real64),
allocatable,
dimension(:) :: m_rwork
1545 integer(int32),
allocatable,
dimension(:) :: m_iwork
1550 integer(int32),
allocatable,
dimension(:) :: m_rststats
1552 integer(int32) :: m_istate = 1
1594 procedure,
public :: step => oa_step
1603 procedure,
public :: reset => oa_reset_integrator
1615 procedure,
public :: get_constraint_status => oa_get_constraint_info
1617 procedure,
private :: init_workspace => oa_init_workspace
1621 module function oa_step(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1622 class(ode_auto),
intent(inout) :: this
1623 class(ode_helper),
intent(inout) :: fcn
1624 real(real64),
intent(inout) :: x
1625 real(real64),
intent(inout),
dimension(:) :: y
1626 real(real64),
intent(in) :: xout
1627 real(real64),
intent(in),
dimension(:) :: rtol, atol
1628 class(errors),
intent(inout),
optional,
target :: err
1632 module subroutine oa_init_workspace(this, liw, lrw, ncnsts, err)
1633 class(ode_auto),
intent(inout) :: this
1634 integer(int32),
intent(in) :: liw, lrw, ncnsts
1635 class(errors),
intent(inout) :: err
1638 module subroutine oa_reset_integrator(this)
1639 class(ode_auto),
intent(inout) :: this
1642 module function oa_get_constraint_info(this) result(x)
1643 class(ode_auto),
intent(in) :: this
1644 logical,
allocatable,
dimension(:) :: x
Defines a routine capable of describing constraints on a system of ODEs of N variables exposed to M c...
-
Defines an integrator for systems of first order ODEs that is capable of switching between an Adams m...
-
Defines a routine capable of computing the Jacobian matrix of a system of N first order ODEs of N var...
-
Defines a routine containing a system of first order ODEs.
-
Resets the state of the integrator.
-
Defines a routine for computing a single integration step in the direction of xout.
-
Defines a base type for integrator types.
-
Defines the signature of a routine used to integrate a function of one variable over a finite interva...
-
Defines an integrator that uses a non-adaptive Gauss-Kronrod method to compute the integral of a func...
-
Defines a type used to pass information regarding the ODEs to the solver.
-
Defines a function of one variable to be integrated.
-
A type that defines an integrator meant to operate on integrands over a finite region.
-
-
Defines an integrator that uses an adaptive Gauss-Kronrod method to compute the integral of a functio...
-
Provides information regarding the behavior of an integrator.
+
19 use,
intrinsic :: iso_fortran_env, only : int32, real64
23 public :: int_out_of_memory_error
24 public :: int_count_exceeded_error
25 public :: int_round_off_error
26 public :: int_integrand_behavior_error
27 public :: int_convergence_error
28 public :: int_divergent_error
29 public :: int_invalid_input_error
30 public :: int_lack_of_definition_error
31 public :: int_array_size_mismatch_error
32 public :: int_excessive_work_error
33 public :: int_impractical_tolerance_error
34 public :: int_repeated_error_test_failure
35 public :: int_15_point_rule
36 public :: int_21_point_rule
37 public :: int_31_point_rule
38 public :: int_41_point_rule
39 public :: int_51_point_rule
40 public :: int_61_point_rule
59 integer(int32),
parameter :: int_out_of_memory_error = 1
62 integer(int32),
parameter :: int_count_exceeded_error = 2
64 integer(int32),
parameter :: int_round_off_error = 3
66 integer(int32),
parameter :: int_integrand_behavior_error = 4
68 integer(int32),
parameter :: int_convergence_error = 5
70 integer(int32),
parameter :: int_divergent_error = 6
72 integer(int32),
parameter :: int_invalid_input_error = 7
74 integer(int32),
parameter :: int_lack_of_definition_error = 8
76 integer(int32),
parameter :: int_array_size_mismatch_error = 9
80 integer(int32),
parameter :: int_excessive_work_error = 10
83 integer(int32),
parameter :: int_impractical_tolerance_error = 11
85 integer(int32),
parameter :: int_repeated_error_test_failure = 12
89 integer(int32),
parameter :: int_15_point_rule = 15
91 integer(int32),
parameter :: int_21_point_rule = 21
93 integer(int32),
parameter :: int_31_point_rule = 31
95 integer(int32),
parameter :: int_41_point_rule = 41
97 integer(int32),
parameter :: int_51_point_rule = 51
99 integer(int32),
parameter :: int_61_point_rule = 61
109 use,
intrinsic :: iso_fortran_env, only : real64
110 real(real64),
intent(in) :: x
124 use,
intrinsic :: iso_fortran_env, only : real64
125 real(real64),
intent(in) :: x
126 real(real64),
intent(in),
dimension(:) :: y
127 real(real64),
intent(out),
dimension(:) :: dydx
139 use,
intrinsic :: iso_fortran_env, only : real64
140 real(real64),
intent(in) :: x
141 real(real64),
intent(in),
dimension(:) :: y
142 real(real64),
intent(out),
dimension(:,:) :: jac
155 use,
intrinsic :: iso_fortran_env, only : real64
156 real(real64),
intent(in) :: x
157 real(real64),
intent(in),
dimension(:) :: y
158 real(real64),
intent(out),
dimension(:) :: f
166 real(real64) :: error_estimate
168 integer(int32) :: evaluation_count
171 integer(int32) :: subinterval_count
181 real(real64) :: m_abstol = 1.0d-8
183 real(real64) :: m_reltol = 1.0d-8
185 integer(int32) :: m_maxint = 10
196 procedure,
public :: get_abs_tol => ib_get_abs_tol
206 procedure,
public :: set_abs_tol => ib_set_abs_tol
216 procedure,
public :: get_rel_tol => ib_get_rel_tol
226 procedure,
public :: set_rel_tol => ib_set_rel_tol
237 procedure,
public :: get_max_subintervals => ib_get_max_subintervals
248 procedure,
public :: ib_set_max_subintervals => ib_set_max_subintervals
253 pure module function ib_get_abs_tol(this) result(x)
254 class(integrator_base),
intent(in) :: this
258 module subroutine ib_set_abs_tol(this, x)
259 class(integrator_base),
intent(inout) :: this
260 real(real64),
intent(in) :: x
263 pure module function ib_get_rel_tol(this) result(x)
264 class(integrator_base),
intent(in) :: this
268 module subroutine ib_set_rel_tol(this, x)
269 class(integrator_base),
intent(inout) :: this
270 real(real64),
intent(in) :: x
273 pure module function ib_get_max_subintervals(this) result(x)
274 class(integrator_base),
intent(in) :: this
278 module subroutine ib_set_max_subintervals(this, x)
279 class(integrator_base),
intent(inout) :: this
280 integer(int32),
intent(in) :: x
287 type,
abstract,
extends(integrator_base) :: finite_interval_integrator
290 procedure(finite_interval_fcn),
public,
deferred, pass :: integrate
306 function finite_interval_fcn(this, fcn, a, b, info, err) result(rst)
307 use,
intrinsic :: iso_fortran_env, only : real64
309 import finite_interval_integrator
311 import integration_behavior
312 class(finite_interval_integrator),
intent(inout) :: this
313 procedure(integrand),
intent(in),
pointer :: fcn
314 real(real64),
intent(in) :: a, b
315 type(integration_behavior),
intent(out),
optional :: info
316 class(errors),
intent(inout),
optional,
target :: err
372 type,
extends(finite_interval_integrator) :: adaptive_integrator
375 real(real64),
allocatable,
dimension(:) :: m_work
377 integer(int32),
allocatable,
dimension(:) :: m_iwork
379 logical :: m_userdefinedbreaks = .false.
381 real(real64),
allocatable,
dimension(:) :: m_breakpoints
397 procedure,
public :: initialize => ai_init
433 procedure,
public :: integrate => ai_integrate
446 procedure,
public :: get_use_breakpoints => ai_get_use_brkpnts
459 procedure,
public :: set_use_breakpoints => ai_set_use_brkpnts
470 procedure,
public :: get_breakpoints => ai_get_breakpoints
483 procedure,
public :: set_breakpoints => ai_set_breakpoints
488 module subroutine ai_init(this, err)
489 class(adaptive_integrator),
intent(inout) :: this
490 class(errors),
intent(inout),
optional,
target :: err
493 module function ai_integrate(this, fcn, a, b, info, err) result(rst)
494 class(adaptive_integrator),
intent(inout) :: this
495 procedure(integrand),
intent(in),
pointer :: fcn
496 real(real64),
intent(in) :: a, b
497 type(integration_behavior),
intent(out),
optional :: info
498 class(errors),
intent(inout),
optional,
target :: err
502 pure module function ai_get_use_brkpnts(this) result(x)
503 class(adaptive_integrator),
intent(in) :: this
507 module subroutine ai_set_use_brkpnts(this, x)
508 class(adaptive_integrator),
intent(inout) :: this
509 logical,
intent(in) :: x
512 module function ai_get_breakpoints(this) result(x)
513 class(adaptive_integrator),
intent(in) :: this
514 real(real64),
allocatable,
dimension(:) :: x
517 module subroutine ai_set_breakpoints(this, x)
518 class(adaptive_integrator),
intent(inout) :: this
519 real(real64),
intent(in),
dimension(:) :: x
529 type,
extends(finite_interval_integrator) :: nonadaptive_integrator
532 integer(int32) :: m_rule = int_15_point_rule
558 procedure,
public :: integrate => ni_integrate
576 procedure,
public :: get_rule => ni_get_rule
599 procedure,
public :: set_rule => ni_set_rule
604 module function ni_integrate(this, fcn, a, b, info, err) result(rst)
605 class(nonadaptive_integrator),
intent(inout) :: this
606 procedure(integrand),
intent(in),
pointer :: fcn
607 real(real64),
intent(in) :: a, b
608 type(integration_behavior),
intent(out),
optional :: info
609 class(errors),
intent(inout),
optional,
target :: err
613 pure module function ni_get_rule(this) result(x)
614 class(nonadaptive_integrator),
intent(in) :: this
618 module subroutine ni_set_rule(this, x, err)
619 class(nonadaptive_integrator),
intent(inout) :: this
620 integer(int32),
intent(in) :: x
621 class(errors),
intent(inout),
optional,
target :: err
633 procedure(ode_fcn),
pointer,
nopass :: m_fcn => null()
635 procedure(ode_jacobian),
pointer,
nopass :: m_jac => null()
637 procedure(ode_constraint),
pointer,
nopass :: m_rts => null()
639 integer(int32) :: m_count = 0
641 integer(int32) :: m_constraints = 0
733 procedure,
public :: define_equations => oh_init
743 procedure,
public :: get_equation_count => oh_get_count
756 procedure,
public :: get_equations_defined => oh_is_fcn_defined
769 procedure,
public :: get_jacobian_defined => oh_is_jac_defined
904 procedure,
public :: define_constraints => oh_define_constraints
914 procedure,
public :: get_constraint_count => oh_get_constraint_count
925 procedure,
public :: get_constraints_defined => oh_get_constraints_defined
940 procedure,
public :: evaluate_ode => oh_eval
954 procedure,
public :: evaluate_jacobian => oh_eval_jac
969 procedure,
public :: evaluate_constraints => oh_eval_constraints
973 module subroutine oh_init(this, neqn, fcn, jac)
974 class(ode_helper),
intent(inout) :: this
975 integer(int32),
intent(in) :: neqn
976 procedure(ode_fcn),
pointer,
intent(in) :: fcn
977 procedure(ode_jacobian),
pointer,
intent(in),
optional :: jac
980 pure module function oh_get_count(this) result(x)
981 class(ode_helper),
intent(in) :: this
985 pure module function oh_is_fcn_defined(this) result(x)
986 class(ode_helper),
intent(in) :: this
990 pure module function oh_is_jac_defined(this) result(x)
991 class(ode_helper),
intent(in) :: this
995 module subroutine oh_define_constraints(this, n, fcn)
996 class(ode_helper),
intent(inout) :: this
997 integer(int32),
intent(in) :: n
998 procedure(ode_constraint),
intent(in),
pointer :: fcn
1001 pure module function oh_get_constraint_count(this) result(x)
1002 class(ode_helper),
intent(in) :: this
1006 pure module function oh_get_constraints_defined(this) result(x)
1007 class(ode_helper),
intent(in) :: this
1011 module subroutine oh_eval(this, x, y, dydx)
1012 class(ode_helper),
intent(inout) :: this
1013 real(real64),
intent(in) :: x
1014 real(real64),
intent(in),
dimension(:) :: y
1015 real(real64),
intent(out),
dimension(:) :: dydx
1018 module subroutine oh_eval_jac(this, x, y, jac)
1019 class(ode_helper),
intent(inout) :: this
1020 real(real64),
intent(in) :: x
1021 real(real64),
intent(in),
dimension(:) :: y
1022 real(real64),
intent(out),
dimension(:,:) :: jac
1025 module subroutine oh_eval_constraints(this, x, y, f)
1026 class(ode_helper),
intent(inout) :: this
1027 real(real64),
intent(in) :: x
1028 real(real64),
intent(in),
dimension(:) :: y
1029 real(real64),
intent(out),
dimension(:) :: f
1036 type,
abstract :: ode_integrator
1038 real(real64),
allocatable,
dimension(:) :: m_rtol
1040 real(real64),
allocatable,
dimension(:) :: m_atol
1043 logical :: m_alloutput = .true.
1047 logical :: m_canovershoot = .true.
1050 real(real64) :: m_criticalpoint = 0.0d0
1052 integer(int32) :: m_minbuffersize = 500
1055 real(real64) :: m_maxstepsize = 1.0d0
1058 logical :: m_limitstepsize = .false.
1060 integer(int32) :: m_maxstepcount = 500
1096 procedure,
public :: integrate => oi_integrate
1108 procedure,
public :: get_provide_all_output => oi_get_use_all_output
1121 procedure,
public :: set_provide_all_output => oi_set_use_all_output
1133 procedure,
public :: get_allow_overshoot => oi_get_allow_overshoot
1146 procedure,
public :: set_allow_overshoot => oi_set_allow_overshoot
1157 procedure,
public :: get_integration_limit => oi_get_critical_point
1168 procedure,
public :: set_integration_limit => oi_set_critical_point
1178 procedure,
public :: get_min_buffer_size => oi_get_min_buffer_size
1190 procedure,
public :: set_min_buffer_size => oi_set_min_buffer_size
1200 procedure,
public :: get_max_step_size => oi_get_max_step_size
1211 procedure,
public :: set_max_step_size => oi_set_max_step_size
1222 procedure,
public :: get_limit_step_size => oi_get_limit_step_size
1235 procedure,
public :: set_limit_step_size => oi_set_limit_step_size
1246 procedure,
public :: get_iteration_limit => oi_get_iteration_limit
1257 procedure,
public :: set_iteration_limit => oi_set_iteration_limit
1267 procedure,
public :: get_relative_tolerances => oi_get_rtol
1277 procedure,
public :: set_relative_tolerances => oi_set_rtol
1287 procedure,
public :: get_absolute_tolerances => oi_get_atol
1297 procedure,
public :: set_absolute_tolerances => oi_set_atol
1325 procedure(ode_integrator_interface),
public,
deferred, pass :: step
1334 procedure(ode_integrator_reset),
public,
deferred, pass :: reset
1361 function ode_integrator_interface(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1362 use,
intrinsic :: iso_fortran_env, only : int32, real64
1364 import ode_integrator
1366 class(ode_integrator),
intent(inout) :: this
1367 class(ode_helper),
intent(inout) :: fcn
1368 real(real64),
intent(inout) :: x
1369 real(real64),
intent(inout),
dimension(:) :: y
1370 real(real64),
intent(in) :: xout
1371 real(real64),
intent(in),
dimension(:) :: rtol, atol
1372 class(errors),
intent(inout),
optional,
target :: err
1379 subroutine ode_integrator_reset(this)
1380 import ode_integrator
1381 class(ode_integrator),
intent(inout) :: this
1384 module function oi_integrate(this, fcnobj, x, y, err) result(rst)
1385 class(ode_integrator),
intent(inout) :: this
1386 class(ode_helper),
intent(inout) :: fcnobj
1387 real(real64),
intent(in),
dimension(:) :: x, y
1388 class(errors),
intent(inout),
optional,
target :: err
1389 real(real64),
allocatable,
dimension(:,:) :: rst
1392 pure module function oi_get_use_all_output(this) result(x)
1393 class(ode_integrator),
intent(in) :: this
1397 module subroutine oi_set_use_all_output(this, x)
1398 class(ode_integrator),
intent(inout) :: this
1399 logical,
intent(in) :: x
1402 pure module function oi_get_allow_overshoot(this) result(x)
1403 class(ode_integrator),
intent(in) :: this
1407 module subroutine oi_set_allow_overshoot(this, x)
1408 class(ode_integrator),
intent(inout) :: this
1409 logical,
intent(in) :: x
1412 pure module function oi_get_critical_point(this) result(x)
1413 class(ode_integrator),
intent(in) :: this
1417 module subroutine oi_set_critical_point(this, x)
1418 class(ode_integrator),
intent(inout) :: this
1419 real(real64),
intent(in) :: x
1422 pure module function oi_get_min_buffer_size(this) result(x)
1423 class(ode_integrator),
intent(in) :: this
1427 module subroutine oi_set_min_buffer_size(this, x)
1428 class(ode_integrator),
intent(inout) :: this
1429 integer(int32),
intent(in) :: x
1432 pure module function oi_get_max_step_size(this) result(x)
1433 class(ode_integrator),
intent(in) :: this
1437 module subroutine oi_set_max_step_size(this, x)
1438 class(ode_integrator),
intent(inout) :: this
1439 real(real64),
intent(in) :: x
1442 pure module function oi_get_limit_step_size(this) result(x)
1443 class(ode_integrator),
intent(in) :: this
1447 module subroutine oi_set_limit_step_size(this, x)
1448 class(ode_integrator),
intent(inout) :: this
1449 logical,
intent(in) :: x
1452 pure module function oi_get_iteration_limit(this) result(x)
1453 class(ode_integrator),
intent(in) :: this
1457 module subroutine oi_set_iteration_limit(this, x)
1458 class(ode_integrator),
intent(inout) :: this
1459 integer(int32),
intent(in) :: x
1462 module function oi_get_rtol(this) result(x)
1463 class(ode_integrator),
intent(in) :: this
1464 real(real64),
allocatable,
dimension(:) :: x
1467 module subroutine oi_set_rtol(this, x)
1468 class(ode_integrator),
intent(inout) :: this
1469 real(real64),
intent(in),
dimension(:) :: x
1472 module function oi_get_atol(this) result(x)
1473 class(ode_integrator),
intent(in) :: this
1474 real(real64),
allocatable,
dimension(:) :: x
1477 module subroutine oi_set_atol(this, x)
1478 class(ode_integrator),
intent(inout) :: this
1479 real(real64),
intent(in),
dimension(:) :: x
1562 type,
extends(ode_integrator) :: ode_auto
1564 real(real64),
allocatable,
dimension(:) :: m_rwork
1566 integer(int32),
allocatable,
dimension(:) :: m_iwork
1571 integer(int32),
allocatable,
dimension(:) :: m_rststats
1573 integer(int32) :: m_istate = 1
1615 procedure,
public :: step => oa_step
1624 procedure,
public :: reset => oa_reset_integrator
1636 procedure,
public :: get_constraint_status => oa_get_constraint_info
1638 procedure,
private :: init_workspace => oa_init_workspace
1642 module function oa_step(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1643 class(ode_auto),
intent(inout) :: this
1644 class(ode_helper),
intent(inout) :: fcn
1645 real(real64),
intent(inout) :: x
1646 real(real64),
intent(inout),
dimension(:) :: y
1647 real(real64),
intent(in) :: xout
1648 real(real64),
intent(in),
dimension(:) :: rtol, atol
1649 class(errors),
intent(inout),
optional,
target :: err
1653 module subroutine oa_init_workspace(this, liw, lrw, ncnsts, err)
1654 class(ode_auto),
intent(inout) :: this
1655 integer(int32),
intent(in) :: liw, lrw, ncnsts
1656 class(errors),
intent(inout) :: err
1659 module subroutine oa_reset_integrator(this)
1660 class(ode_auto),
intent(inout) :: this
1663 module function oa_get_constraint_info(this) result(x)
1664 class(ode_auto),
intent(in) :: this
1665 logical,
allocatable,
dimension(:) :: x
Defines a routine capable of describing constraints on a system of ODEs of N variables exposed to M c...
+
Defines an integrator for systems of first order ODEs that is capable of switching between an Adams m...
+
Defines a routine capable of computing the Jacobian matrix of a system of N first order ODEs of N var...
+
Defines a routine containing a system of first order ODEs.
+
Resets the state of the integrator.
+
Defines a routine for computing a single integration step in the direction of xout.
+
Defines a base type for integrator types.
+
Defines the signature of a routine used to integrate a function of one variable over a finite interva...
+
Defines an integrator that uses a non-adaptive Gauss-Kronrod method to compute the integral of a func...
+
Defines a type used to pass information regarding the ODEs to the solver.
+
Defines a function of one variable to be integrated.
+
A type that defines an integrator meant to operate on integrands over a finite region.
+
+
+
Defines an integrator that uses an adaptive Gauss-Kronrod method to compute the integral of a functio...
+
Provides information regarding the behavior of an integrator.