vtf-logo

clawpack/applications/euler_znd/2d/Carbuncle/src/init2.f

c
c
c     =====================================================
       subroutine ic(maxmx,maxmy,meqn,mbc,mx,my,xc,yc,dx,dy,q)
c     =====================================================
c
c      Copyright (C) 2002 Ralf Deiterding
c      Brandenburgische Universitaet Cottbus
c
       implicit double precision (a-h,o-z)
       include  "cuser.i"
c
       dimension q(meqn, 1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc)
       dimension xc(1-mbc:maxmx+mbc),yc(1-mbc:maxmy+mbc)
c  
       do 150 j=1,my
          do 150 i=1,mx
             if ( xc(i) .lt. sloc ) then
                q(1,i,j) = rhol
                q(2,i,j) = rhoul
                q(3,i,j) = rhovl
                q(4,i,j) = el
             else
                q(1,i,j) = rhor
                q(2,i,j) = rhour
                q(3,i,j) = rhovr
                q(4,i,j) = er
            endif
 150  continue
c
      do 160 j=1,my
         do 160 i=1,mx
            if ( xc(i).gt.sloc-dx .and. xc(i).lt.sloc .and. 
     &           yc(j).gt.sloc2-dy .and. yc(j).lt.sloc2) then
               eps=0.01d0
               write (6,*) i,j
               p = (1.+eps)*(gamma1*(q(4,i,j) - 
     &              0.5d0*(q(2,i,j)**2  + q(3,i,j)**2)/ q(1,i,j)))
               q(4,i,j)=p/gamma1 +
     &              0.5d0*(q(2,i,j)**2  + q(3,i,j)**2)/ q(1,i,j)
            endif
 160  continue
c     
      return
      end
c