c
c
c ==========================================================
subroutine chk1eurhok(q,mx,lb,ub,lbr,ubr,shaper,meqn,
& mout,mresult)
c ==========================================================
c
c # Copyright (C) 2002 Ralf Deiterding
c # Brandenburgische Universitaet Cottbus
c
c # Copyright (C) 2003-2007 California Institute of Technology
c # Ralf Deiterding, ralf@cacr.caltech.edu
c
implicit double precision(a-h,o-z)
include "ck.i"
c
integer meqn, mx, mout
dimension q(meqn,mx)
c
integer lb(1), ub(1), lbr(1), ubr(1), shaper(1),
& mresult, stride, imin(1), imax(1), i, getindx
c
stride = (ub(1) - lb(1))/(mx-1)
imin(1) = max(lb(1), lbr(1))
imax(1) = min(ub(1), ubr(1))
if (mod(imin(1)-lb(1),stride) .ne. 0) then
imin(1) = imin(1) + stride - mod(imin(1)-lb(1),stride)
endif
imin(1) = getindx(imin(1), lb(1), stride)
if (mod(imax(1)-lb(1),stride) .ne. 0) then
imax(1) = imax(1) - mod(imax(1)-lb(1),stride)
endif
imax(1) = getindx(imax(1), lb(1), stride)
mresult = 1
do 10 i = imin(1), imax(1)
rho = 0.d0
rhoW = 0.d0
do k = 1, Nsp
rho = rho + q(k,i)
rhoW = rhoW + q(k,i)/Wk(k)
if (q(k,i).lt.-1.d-15) then
if (mout.gt.0) write(6,601) k,
& lb(1)+(i-imin(1))*stride,q(k,i),
& lb(1),ub(1),stride
end if
enddo
if (rho.le.0.d0) then
if (mout.gt.0)
& write(6,602) lb(1)+(i-imin(1))*stride,rho,
& lb(1),ub(1),stride
mresult = 0
end if
p = rhoW*RU*q(Nsp+3,i)
if (p.le.0.d0) then
if (mout.gt.0)
& write(6,603) lb(1)+(i-imin(1))*stride,p,
& lb(1),ub(1),stride
mresult = 0
end if
if ( TabS.gt.q(Nsp+3,i)*TABFAC .or.
& q(Nsp+3,i)*TABFAC.gt.TabE ) then
if (mout.gt.0)
& write(6,604) lb(1)+(i-imin(1))*stride,
& q(Nsp+3,i),lb(1),ub(1),stride
mresult = 0
end if
10 continue
601 format('chk1eu: Error in rho_',i3,' (',i5,')',f16.8,
& ' on [(',i5,'),(',i5,'),(',i3,')]')
602 format('chk1eu: Error in rho (',i5,')',f16.8,
& ' on [(',i5,'),(',i5,')](',i3,')]')
603 format('chk1eu: Error in p (',i5,')',f16.8,
& ' on [(',i5,'),(',i5,')](',i3,')]')
604 format('chk1eu: Error in T (',i5,')',f16.8,
& ' on [(',i5,'),(',i5,')](',i3,')]')
return
end