Assign members of integrator_multistage_object and parents.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_multistage_object), | intent(inout) | :: | lhs | Left hand side. |
||
class(integrator_object), | intent(in) | :: | rhs | Right hand side. |
subroutine assign_multistage(lhs, rhs)
!< Assign members of [[integrator_multistage_object]] and parents.
class(integrator_multistage_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_object)
lhs%registers = rhs%registers
lhs%stages = rhs%stages
if (allocated(lhs%stage)) deallocate(lhs%stage)
if (allocated(rhs%stage)) then
allocate(lhs%stage(1:lhs%registers), mold=rhs%stage)
do s=1, lhs%registers
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