         subroutine  update_boundary(q, Nx, Ng) 

c------------------------------------------------------------
c        Implements first-order outflow conditions using 
c        ghost cell. 
c------------------------------------------------------------

         implicit      none

         character*15  cdnm
         parameter   ( cdnm = 'update_boundary' ) 

         logical       ltrace
         parameter   ( ltrace = .false. )

         integer       Nx
         integer       Ng

         real*8        q ( Nx )

         integer       j

c============================================================
c============================================================
         if ( ltrace ) then
            write(0,*) cdnm,':  Nx = ', Nx
            write(0,*) cdnm,':  Ng = ', Ng
         endif
         do j = 1, Ng
            q  (j)      = q (Ng+1)
            q  (Nx-j+1) = q (Nx-Ng)
         enddo
         return
         end

