Assign members of integrator_multistage_multistep_object and parents.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_multistage_multistep_object), | intent(inout) | :: | lhs | Left hand side. |
||
class(integrator_object), | intent(in) | :: | rhs | Right hand side. |
subroutine assign_multistage_multistep(lhs, rhs)
!< Assign members of [[integrator_multistage_multistep_object]] and parents.
class(integrator_multistage_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_multistage_multistep_object)
lhs%registers_stages = rhs%registers_stages
lhs%registers_steps = rhs%registers_steps
lhs%stages = rhs%stages
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_steps), mold=rhs%previous)
do s=1, lhs%registers_steps
lhs%previous(s) = rhs%previous(s)
enddo
endif
if (allocated(lhs%stage)) deallocate(lhs%stage)
if (allocated(rhs%stage)) then
allocate(lhs%stage(1:lhs%registers_stages), mold=rhs%stage)
do s=1, lhs%registers_stages
lhs%stage(s) = rhs%stage(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_multistage_multistep