Allocate members of interpolator being of integrand_object class.
It is assumed that the integrator has been properly initialized before calling this method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_leapfrog), | intent(inout) | :: | self | Integrator. |
||
class(integrand_object), | intent(in) | :: | U | Integrand. |
subroutine allocate_integrand_members(self, U)
!< Allocate members of interpolator being of [[integrand_object]] class.
!<
!< @note It is assumed that the integrator has been properly initialized before calling this method.
class(integrator_leapfrog), intent(inout) :: self !< Integrator.
class(integrand_object), intent(in) :: U !< Integrand.
integer(I_P) :: s !< Counter.
if (self%is_multistep() .and. self%registers > 0) then
if (allocated(self%Dt)) deallocate(self%Dt)
allocate(self%Dt(1:self%registers)) ; self%Dt = 0._R_P
if (allocated(self%t)) deallocate(self%t)
allocate(self%t(1:self%registers)) ; self%t = 0._R_P
if (allocated(self%previous)) deallocate(self%previous)
allocate(self%previous(1:self%registers), mold=U)
do s=1, self%registers
self%previous(s) = U
enddo
endif
if (self%has_fast_mode()) then
if (allocated(self%buffer)) deallocate(self%buffer)
allocate(self%buffer, mold=U)
self%buffer = U
endif
if (self%is_filtered) then
if (allocated(self%filter)) deallocate(self%filter)
allocate(self%filter, mold=U)
self%filter = U
endif
endsubroutine allocate_integrand_members