Update previous time steps.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(burgers), | intent(inout) | :: | self | Burgers field. |
||
class(integrand), | intent(in), | optional | :: | filter | Filter field displacement. |
|
real(kind=R_P), | intent(in), | optional | :: | weights(:) | Weights for filtering the steps. |
subroutine update_previous_steps(self, filter, weights)
!---------------------------------------------------------------------------------------------------------------------------------
!< Update previous time steps.
!---------------------------------------------------------------------------------------------------------------------------------
class(burgers), intent(INOUT) :: self !< Burgers field.
class(integrand), optional, intent(IN) :: filter !< Filter field displacement.
real(R_P), optional, intent(IN) :: weights(:) !< Weights for filtering the steps.
integer(I_P) :: s !< Time steps counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (self%steps>0) then
do s=1, self%steps - 1
self%previous(:, s) = self%previous(:, s + 1)
enddo
self%previous(:, self%steps) = self%U
endif
if (present(filter).and.present(weights)) then
select type(filter)
class is(burgers)
do s=1, self%steps
self%previous(:, s) = self%previous(:, s) + filter%U * weights(s)
enddo
endselect
endif
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine update_previous_steps