function [ y, j ] = j_carry_common ( y, j )

%*****************************************************************************80
%
%% j_carry_common() carries year-days to years in a Common date.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 February 2013
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer Y, J, the YJ date.
%
%  Output:
%
%    integer Y, J, the YJ date after carrying.
%
  while ( true )

    days = year_length_days_common ( y );

    if ( j < days )
      break
    end

    j = j - days;
    y = y + 1;

  end

  return
end
