r: right hand side of Euler equations
function rhs(nx,dx,gamma,q,r)
qL = Array{Float64}(undef,nx+1,3)
qR = Array{Float64}(undef,nx+1,3)
fL = Array{Float64}(undef,nx+1,3)
fR = Array{Float64}(undef,nx+1,3)
```

```
f = Array{Float64}(undef,nx+1,3)
qL = wenoL(nx,q) # compute left state of q using WENO-5
qR = wenoR(nx,q) # compute right state of q using~WENO-5
fluxes(nx,gamma,qL,fL) # compute fluxes for left state at the interface
fluxes(nx,gamma,qR,fR) # compute fluxes for right state at the~interface
roe(nx,gamma,q,qL,qR,f,fL,fR) # call Rusanov scheme~function
for i = 1:nx for m = 1:3
r[i,m] = -(f[i+1,m] - f[i,m])/dx # compute right hand side term (-dF/dx)
end end
end