% assign values of stage variables to the new time level
rhonew  = rhostage  ;
mxnew   = mxstage   ;
uxnew   = uxstage   ;
rhoEnew = rhoEstage ;
pnew =( rhoEnew-1/2*rhonew.*(				     ...
       (0.5*(uxnew(1:J)+uxnew(2:J+1))).^2 + uynew.^2 + uznew.^2   ...
		       ) -					    ...
		  1/2*( 					   ...
       (Bxleft*ones(size(Bynew))).^2 + Bynew.^2 + Bznew.^2	 ...
		       )					    ...
       )*(gamma-1);
