Time derivative of Lorenz field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(lorenz), | intent(in) | :: | self | Lorenz field. |
||
real(kind=R_P), | intent(in), | optional | :: | t | Time. |
Lorenz field time derivative.
function dLorenz_dt(self, t) result(dState_dt)
!---------------------------------------------------------------------------------------------------------------------------------
!< Time derivative of Lorenz field.
!---------------------------------------------------------------------------------------------------------------------------------
class(lorenz), intent(IN) :: self !< Lorenz field.
real(R_P), optional, intent(IN) :: t !< Time.
class(integrand), allocatable :: dState_dt !< Lorenz field time derivative.
integer(I_P) :: dn !< Time level, dummy variable.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate(lorenz :: dState_dt)
select type(dState_dt)
class is(lorenz)
dState_dt = self
dState_dt%U(1) = self%sigma * (self%U(2) - self%U(1))
dState_dt%U(2) = self%U(1) * (self%rho - self%U(3)) - self%U(2)
dState_dt%U(3) = self%U(1) * self%U(2) - self%beta * self%U(3)
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction dLorenz_dt