Assign one Euler field to another.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D_openmp), | intent(inout) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
subroutine euler_assign_euler(lhs, rhs)
!---------------------------------------------------------------------------------------------------------------------------------
!< Assign one Euler field to another.
!---------------------------------------------------------------------------------------------------------------------------------
class(euler_1D_openmp), intent(INOUT) :: lhs !< Left hand side.
class(integrand), intent(IN) :: rhs !< Right hand side.
integer(I_P) :: i !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
select type(rhs)
class is(euler_1D_openmp)
lhs%ord = rhs%ord
lhs%Ni = rhs%Ni
lhs%Ng = rhs%Ng
lhs%Ns = rhs%Ns
lhs%Nc = rhs%Nc
lhs%Np = rhs%Np
lhs%Dx = rhs%Dx
lhs%weno = rhs%weno
if (allocated(rhs%U)) then
if (allocated(lhs%U)) deallocate(lhs%U) ; allocate(lhs%U(1:lhs%Nc, 1:lhs%Ni))
endif
if (allocated(rhs%cp0)) lhs%cp0 = rhs%cp0
if (allocated(rhs%cv0)) lhs%cv0 = rhs%cv0
if (allocated(rhs%BC_L)) lhs%BC_L = rhs%BC_L
if (allocated(rhs%BC_R)) lhs%BC_R = rhs%BC_R
endselect
!$OMP PARALLEL DEFAULT(NONE) PRIVATE(i) SHARED(lhs, rhs)
select type(rhs)
class is(euler_1D_openmp)
if (allocated(rhs%U)) then
!$OMP DO
do i=1, lhs%Ni
lhs%U(:, i) = rhs%U(:, i)
enddo
endif
endselect
!$OMP END PARALLEL
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine euler_assign_euler