function shallow_water_1d_display ( h_array, uh_array, x, t )

%*****************************************************************************80
%
%% shallow_water_1d_display displays solutions of the 1D shallow water equations.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 June 2012
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Cleve Moler,
%    "The Shallow Water Equations",
%    Experiments with MATLAB.
%
%  Input:
%
%    real H_ARRAY(NX,NT), the height for all space and time points.
%
%    real UH_ARRAY(NX,NT), the mass velocity for all space and time points.
%
%    real X(NX), the coordinates of the nodes.
%
%    real T(NT), the time at each timestep.
%
  x_min = min ( x );
  x_max = max ( x );
  
  h_min = 0.0;
  h_max = max ( max ( h_array ) );

  uh_max = max ( max ( uh_array ) );
  uh_min = min ( min ( uh_array ) );

  [ nx, nt ] = size ( uh_array );
%
%  For each time step, plot H.
%
  for it = 1 : nt

    figure ( 1 );
    clf ( );

    subplot ( 2, 1, 1 );
    axis ( [ x_min, x_max, h_min, h_max ] );
    area ( x, h_array (:,it) );
    title_string = sprintf ( 'H(T), Step %3d, Time = %f', it, t(it) );
    title ( title_string );
    xlabel ( 'X' );
    ylabel ( 'H(X,T)' );
    grid ( 'on' );

    subplot ( 2, 1, 2 );
    axis ( [ x_min, x_max, uh_min, uh_max ] );
    area ( x, uh_array(:,it), 0.0, 'FaceColor', [ 0.6, 0.1, 0.1 ] );
    title_string = sprintf ( 'UH(T), Step %3d, Time = %f', it, t(it) );
    title ( title_string );
    xlabel ( 'X' );
    ylabel ( 'UH(X,T)' );
    grid ( 'on' );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'shallow_water_1d_display:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
