function skeleton3 ( )

%*****************************************************************************80
%
%% skeleton3 uses the uv_square() velocities to advect a temperature field.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    25 June 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'skeleton3:\n' );
  fprintf ( 1, '  Generate a fixed velocity field from uv_square.\n' );
  fprintf ( 1, '  Initialize a few nodes to have a very high temperature\n' );
  fprintf ( 1, '  while the rest are zero.\n' );
  fprintf ( 1, '  Use the advection equation to model temperature changes.\n' );
  fprintf ( 1, '  We will hope to see the hot water swirling around.\n' );

  nr = 251;
  nc = 251;
%
%  Set up geometry.
%
  [ X, Y ] = xy_square ( nr, nc );
  dy = 1.0 / ( nr - 1 );
  dx = 1.0 / ( nc - 1 );
%
%  Time discretization.
%
  nt = 1001;
  tmin = 0.0;
  tmax = 200.0;
  t = linspace ( tmin, tmax, nt );
  dt = ( tmax - tmin ) / ( nt - 1 );
%
%  Set the velocity field.
%  Since it doesn't change, we can do this once, outside the time loop.
%
  [ U, V ] = uv_square ( X, Y );
%
%  Time loop
%  
  for k = 1 : nt
%
%  Initial temperature distribution is zero, except for a "hot blob".
%
    if ( k == 1 )
      TN = zeros ( nr, nc );
      i = floor ( nr / 5 );
      j = floor ( nr / 2 );
      TN(i-2:i+2,j-2:j+2) = 200.0;
%
%  Update the temperature distribution using a version of
%  the advection equation.  We assume T=0 on all the boundary
%  nodes, and we only apply the advection equation to the
%  interior nodes:
%
    else
      TO = TN;
      for i = 2 : nr - 1
        for j = 2 : nc - 1
          TN(i,j) = ?
        end
      end
    end

    contourf ( X, Y, TN, 20, 'edgecolor', 'none' );
    axis ( 'equal' );
    label = sprintf ( 'Temperature field, k = %d, t = %g\n', k, t(k) );
    title ( label );
    pause ( 0.05 );

  end
%
%  Save the last plot.
%
  filename = 'exercise3.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end

