function jed2 = jed_to_noon_nearest ( jed1 )

%*****************************************************************************80
%
%% jed_to_noon_nearest() converts a JED to the JED of the nearest noon.
%
%  Discussion:
%
%    This is primarily to make a fair test of the weekday routines,
%    which have trouble when the JED is at midnight.
%
%    Note that noon corresponds to an integral JED value.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 June 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real JED1, the Julian Ephemeris Date.
%
%  Output:
%
%    real JED2, the Julian Ephemeris Date
%    of the nearest noon.  If JED1 was at midnight, JED2 is
%    advanced to the NEXT noon, not the previous one.
%
  jed2 = round ( jed1 );

  return
end
