Assign members of integrator_multistep_object and parents.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_multistep_object), | intent(inout) | :: | lhs | Left hand side. |
||
class(integrator_object), | intent(in) | :: | rhs | Right hand side. |
subroutine assign_multistep(lhs, rhs)
!< Assign members of [[integrator_multistep_object]] and parents.
class(integrator_multistep_object), intent(inout) :: lhs !< Left hand side.
class(integrator_object), intent(in) :: rhs !< Right hand side.
integer(I_P) :: s !< Counter.
call lhs%assign_abstract(rhs=rhs)
select type(rhs)
class is (integrator_multistep_object)
lhs%registers = rhs%registers
lhs%steps = rhs%steps
lhs%autoupdate = rhs%autoupdate
lhs%iterations = rhs%iterations
if (allocated(lhs%Dt)) deallocate(lhs%Dt)
if (allocated(rhs%Dt)) lhs%Dt = rhs%Dt
if (allocated(lhs%t)) deallocate(lhs%t)
if (allocated(rhs%t)) lhs%t = rhs%t
if (allocated(lhs%previous)) deallocate(lhs%previous)
if (allocated(rhs%previous)) then
allocate(lhs%previous(1:lhs%registers), mold=rhs%previous)
do s=1, lhs%registers
lhs%previous(s) = rhs%previous(s)
enddo
endif
if (allocated(lhs%buffer)) deallocate(lhs%buffer)
if (allocated(rhs%buffer)) then
allocate(lhs%buffer, mold=rhs%buffer)
lhs%buffer = rhs%buffer
endif
endselect
endsubroutine assign_multistep