function [ k2, k3, sigma2, t0, y0, tstop ] = ozone2_parameters ( k2_user, ...
  k3_user, sigma2_user, t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% ozone2_parameters() returns parameters for ozone2_ode().
%
%  Discussion:
%
%    If input values are specified, this resets the default parameters.
%    Otherwise, the output will be the current defaults.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real K2_USER, K3_USER: rate parameters;
%
%    real SIGMA2_USER, nitrogen oxide source term.
%
%    real T0_USER: the initial time, in seconds.
%
%    real Y0_USER[4]: the initial condition.
%
%    real TSTOP_USER: the final time, in seconds.
%
%  Output:
%
%    real K2, K3: rate parameters;
%
%    real SIGMA2, nitrogen oxide source term.
%
%    real T0: the initial time, in seconds.
%
%    real Y0[4]: the initial condition.
%
%    real TSTOP: the final time, in seconds.
%
  persistent k2_default;
  persistent k3_default;
  persistent sigma2_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( k2_default ) )
    k2_default = 1.0E+5;
  end

  if ( isempty ( k3_default ) )
    k3_default = 1.0E-16;
  end

  if ( isempty ( sigma2_default ) )
    sigma2_default = 1.0E+06;
  end

  if ( isempty ( t0_default ) )
    t0_default = 14400.0;
  end

  if ( isempty ( y0_default ) )
    y0_default = [ 0.0, 1.3E+10, 5.0E+11, 8.0E+11 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 504000.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    k2_default = k2_user;
  end

  if ( 2 <= nargin )
    k3_default = k3_user;
  end

  if ( 3 <= nargin )
    sigma2_default = sigma2_user;
  end

  if ( 4 <= nargin )
    t0_default = t0_user;
  end

  if ( 5 <= nargin )
    y0_default = y0_user;
  end

  if ( 6 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  k2 = k2_default;
  k3 = k3_default;
  sigma2 = sigma2_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;

  return
end

