subroutine sweepx C C This subroutine performs 1D hydro sweeps in the X direction, C looping over j by k rows. C C----------------------------------------------------------------------- C C GLOBALS C include 'global.h' include 'zone.h' include 'sweep.h' C C LOCALS C integer i, j, k, n real paracoff( 9, maxsweep ) C C----------------------------------------------------------------------- sweep = 'x' C C Add two ghost zones to 1D sweep arrays nmin = 3 nmax = imax + 2 C C Load up 1D array of grid coordinates (xa:Lagrangian, xa0:Eulerian) do 2 i = 1, imax n = i + 2 xa (n) = zxa(i) dx (n) = zdx(i) xa0(n) = zxa(i) dx0(n) = zdx(i) 2 continue C C Set coordinates in ghost zones before calling paraset to get coefficients dx(nmin-1) = dx(nmin) dx(nmin-2) = dx(nmin) xa(nmin-1) = xa(nmin) - dx(nmin-1) xa(nmin-2) = xa(nmin-1) - dx(nmin-2) dx(nmax+1) = dx(nmax) dx(nmax+2) = dx(nmax) xa(nmax+1) = xa(nmax) + dx(nmax) xa0(nmax+1)= xa(nmax+1) xa(nmax+2) = xa(nmax+1) + dx(nmax+1) xa0(nmax+2)= xa(nmax+2) C C Set up coefficients for parabola subroutine call paraset( paracoff, dx, xa, nmin, nmax, ngeomx ) C C Now Loop over each row... radius = 1. do 1 k = 1, kmax do 1 j = 1, jmax C C Put state variables into 1D arrays, padding with 2 ghost zones do 10 i = 1,imax n = i + 2 rho(n) = zrho(i,j,k) p (n) = zp (i,j,k) u (n) = zux (i,j,k) v (n) = zuy (i,j,k) w (n) = zuz (i,j,k) xa (n) = zxa(i) dx (n) = zdx(i) p (n) = max(smallp,p(n)) enrg(n) = p(n)/(rho(n)*gamm)+0.5*(u(n)**2+v(n)**2+w(n)**2) 10 continue xa(nmax+1) = xa(nmax) + dx(nmax) C C Calculate volume element for given geometry C if(ngeomx .eq. 0) then do 20 n = nmin, nmax+1 dvol (n) = dx(n) dvol0(n) = dvol(n) 20 continue else if(ngeomx .eq. 1) then do 21 n = nmin, nmax+1 dvol (n) = dx(n) * (xa(n) + .5*dx(n)) dvol0(n) = dvol(n) 21 continue else if(ngeomx .eq. 2) then do 22 n = nmin, nmax+1 dvol (n) = dx(n) * (xa(n)*(xa(n)+dx(n)) + dx(n)*dx(n)/3.) dvol0(n) = dvol(n) 22 continue endif C C First call sweepbc to impose boundary conditions, C then call ppm.f to evolve the flow in the 1D sweep, C then call sweepbc to impose boundary conditions again for remap, C then call remap.f to remap evolved quantities back to Eulerian grid. C call sweepbc( nleftx, nrightx ) call ppm ( nleftx, nrightx, ngeomx, paracoff ) call sweepbc( nleftx, nrightx ) call remap ( nleftx, nrightx, ngeomx ) C C Put updated values back into 2D arrays, dropping ghost zones do 100 i = 1, imax n = i + 2 zrho(i,j,k) = rho(n) zp (i,j,k) = p (n) zux (i,j,k) = u (n) zuy (i,j,k) = v (n) zuz (i,j,k) = w (n) 100 continue C 1 continue C return end