Subtract two Euler fields.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D_openmp), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Operator result.
function sub_euler(lhs, rhs) result(opr)
!---------------------------------------------------------------------------------------------------------------------------------
!< Subtract two Euler fields.
!---------------------------------------------------------------------------------------------------------------------------------
class(euler_1D_openmp), intent(IN) :: lhs !< Left hand side.
class(integrand), intent(IN) :: rhs !< Right hand side.
class(integrand), allocatable :: opr !< Operator result.
integer(I_P) :: i !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate (euler_1D_openmp :: opr)
select type(opr)
class is(euler_1D_openmp)
opr = lhs
endselect
!$OMP PARALLEL DEFAULT(NONE) PRIVATE(i) SHARED(lhs, rhs, opr)
select type(opr)
class is(euler_1D_openmp)
select type(rhs)
class is (euler_1D_openmp)
!$OMP DO
do i=1, lhs%Ni
opr%U(:, i) = lhs%U(:, i) - rhs%U(:, i)
enddo
endselect
endselect
!$OMP END PARALLEL
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction sub_euler