Subtract two Lorenz fields.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(lorenz), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Operator result.
function sub_lorenz(lhs, rhs) result(opr)
!---------------------------------------------------------------------------------------------------------------------------------
!< Subtract two Lorenz fields.
!---------------------------------------------------------------------------------------------------------------------------------
class(lorenz), intent(IN) :: lhs !< Left hand side.
class(integrand), intent(IN) :: rhs !< Right hand side.
class(integrand), allocatable :: opr !< Operator result.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate(lorenz :: opr)
select type(opr)
class is(lorenz)
opr = lhs
select type(rhs)
class is (lorenz)
opr%U = lhs%U - rhs%U
endselect
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction sub_lorenz