Execute test(s).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(test_object), | intent(inout) | :: | self | Test. |
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.
subroutine execute(self)
!< Execute test(s).
class(test_object), intent(inout) :: self !< Test.
character(99), allocatable :: integrator_schemes(:) !< Name of FOODIE integrator schemes.
real(R_P), allocatable :: error(:,:) !< Error of integrand integration.
real(R_P), allocatable :: order(:,:) !< Observed order of accuravy.
integer(I_P) :: s !< Counter.
integer(I_P) :: t !< Counter.
call self%initialize
if (trim(adjustl(self%scheme))/='all') then
if (is_class_available(scheme=self%scheme)) then
integrator_schemes = foodie_integrator_schemes(class_name=self%scheme)
elseif (is_available(scheme=self%scheme)) then
integrator_schemes = [trim(adjustl(self%scheme))]
endif
else
integrator_schemes = foodie_integrator_schemes()
endif
allocate(error(1:size(self%integrand_0%error(t=0._R_P), dim=1), 1:size(self%Dt, dim=1)))
if (size(self%Dt, dim=1) > 1) allocate(order(1:size(error, dim=1), 1:size(error, dim=2)-1))
do s=1, size(integrator_schemes, dim=1)
print '(A)', trim(integrator_schemes(s))
do t=1, size(self%Dt)
call self%integrand_0%initialize(Dt=self%Dt(t))
print '(A)', self%integrand_0%description()
call integrate(scheme=trim(integrator_schemes(s)), &
integrand_0=self%integrand_0, &
Dt=self%Dt(t), &
final_time=self%final_time, &
iterations=self%implicit_iterations, &
stages=self%stages, &
is_fast=self%is_fast, &
save_results=self%save_results, &
output_base_name=trim(adjustl(self%output)), &
save_frequency=self%save_frequency, &
error=error(:,t))
print*, 'Dt = ', self%Dt(t), ', error = ', error(:,t)
if (t > 1) then
order(:, t-1) = observed_order(error=error(:, t-1:t), Dt=self%Dt(t-1:t))
print '(A,'//trim(str(size(order, dim=1), no_sign=.true.))//'F6.2)', ' Observed order =', order(:,t-1)
endif
enddo
enddo
endsubroutine execute