Estimate the order of accuracy using 2 subsequent refined numerical solutions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | error(1:,1:) | Computed errors. |
||
real(kind=R_P), | intent(in) | :: | Dt(1:) | 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:, 1:) !< Computed errors.
real(R_P), intent(in) :: Dt(1:) !< Time steps used.
real(R_P) :: observed_order(1:size(error, dim=1)) !< Estimation of the order of accuracy.
integer(I_P) :: v !< Variables counter.
do v=1, size(error, dim=1)
observed_order(v) = log(error(v, 1) / error(v, 2)) / log(Dt(1) / Dt(2))
enddo
endfunction observed_order