Create the actual LMM-SSP-VSS integrator.
If the integrator is initialized with a bad (unsupported) number of required time steps the initialization fails and the integrator error status is updated consistently for external-provided errors handling.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_lmm_ssp_vss), | intent(inout) | :: | self | Integrator. |
||
character(len=*), | intent(in) | :: | scheme | Selected scheme. |
||
logical, | intent(in), | optional | :: | autoupdate | Enable cyclic autoupdate of previous time steps. |
|
class(integrand_object), | intent(in), | optional | :: | U | Integrand molding prototype. |
|
logical, | intent(in), | optional | :: | stop_on_fail | Stop execution if initialization fail. |
subroutine initialize(self, scheme, autoupdate, U, stop_on_fail)
!< Create the actual LMM-SSP-VSS integrator.
!<
!< @note If the integrator is initialized with a bad (unsupported) number of required time steps the initialization fails and
!< the integrator error status is updated consistently for external-provided errors handling.
class(integrator_lmm_ssp_vss), intent(inout) :: self !< Integrator.
character(*), intent(in) :: scheme !< Selected scheme.
logical, intent(in), optional :: autoupdate !< Enable cyclic autoupdate of previous time steps.
class(integrand_object), intent(in), optional :: U !< Integrand molding prototype.
logical, intent(in), optional :: stop_on_fail !< Stop execution if initialization fail.
if (self%is_supported(scheme=scheme)) then
call self%destroy
self%description_ = trim(adjustl(scheme))
select case(trim(adjustl(scheme)))
case('lmm_ssp_vss_steps_2_order_2')
self%steps = 2
self%integrate_ => integrate_order_2
self%integrate_fast_ => integrate_order_2_fast
case('lmm_ssp_vss_steps_3_order_2')
self%steps = 3
self%integrate_ => integrate_order_2
self%integrate_fast_ => integrate_order_2_fast
case('lmm_ssp_vss_steps_3_order_3')
self%steps = 3
self%integrate_ => integrate_order_3
self%integrate_fast_ => integrate_order_3_fast
case('lmm_ssp_vss_steps_4_order_3')
self%steps = 4
self%integrate_ => integrate_order_3
self%integrate_fast_ => integrate_order_3_fast
case('lmm_ssp_vss_steps_5_order_3')
self%steps = 5
self%integrate_ => integrate_order_3
self%integrate_fast_ => integrate_order_3_fast
endselect
self%autoupdate = .true. ; if (present(autoupdate)) self%autoupdate = autoupdate
self%registers = self%steps
if (present(U)) call self%allocate_integrand_members(U=U)
else
call self%trigger_error(error=ERROR_UNSUPPORTED_SCHEME, &
error_message='"'//trim(adjustl(scheme))//'" unsupported scheme', &
is_severe=stop_on_fail)
endif
endsubroutine initialize