Estimate the order of accuracy using 2 subsequent refined numerical solutions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | error(1:2) | Computed errors. |
||
real(kind=R_P), | intent(in) | :: | Dt(1:2) | Time steps used. |
Estimation of the order of accuracy.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
pure function observed_order(error, Dt)
!< Estimate the order of accuracy using 2 subsequent refined numerical solutions.
real(R_P), intent(IN) :: error(1:2) !< Computed errors.
real(R_P), intent(IN) :: Dt(1:2) !< Time steps used.
real(R_P) :: observed_order !< Estimation of the order of accuracy.
observed_order = log(error(1) / error(2)) / log(Dt(1) / Dt(2))
endfunction observed_order