AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

1d/equations/euler/rp/chk1eu.f

c
c
c     ==========================================================
      subroutine chk1eu(q,mx,lb,ub,lbr,ubr,shaper,meqn,mresult)
c     ==========================================================
c
c     # Controls, if density and pressure remain positive. 
c     # An essential debugging tool for AMROC.
c
      implicit none
c
      integer meqn, mx
      real*8  q(meqn,mx)
c
      common /param/  gamma, gamma1
      real*8  gamma, gamma1, p
      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)
 
         if (q(1,i).le.0.d0) then
            write(6,601) lb(1)+(i-imin(1))*stride,q(1,i),
     &           lb(1),ub(1),stride
            mresult = 0
         end if

         p = gamma1*(q(3,i) - 0.5d0*(q(2,i)**2)/q(1,i))
         if (p.le.0.d0) then
            write(6,602) lb(1)+(i-imin(1))*stride,p,
     &           lb(1),ub(1),stride
            mresult = 0
         end if

 10   continue         

 601  format('chk1eu: Error in rho (',i5,')',f16.8,
     &     '   on   [(',i5,'),(',i5,'),(',i3,')]')
 602  format('chk1eu: Error in p   (',i5,')',f16.8,
     &     '   on   [(',i5,'),(',i5,')](',i3,')]')
      return
      end


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04