function [ y, m, d ] = day_carry_english ( y, m, d )

%*****************************************************************************80
%
%% day_carry_english() carries days to months in an English date.
%
%  Discussion:
%
%    While ( number of days in M ) < D:
%      decrease the day D by the number of days in the month M;
%      increase M by 1;
%      if necessary, adjust Y.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 June 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer Y, M, D, the YMD date.
%
%  Output:
%
%    integer Y, M, D, the YMD date after carrying.
%

%
%  If the date is in the transition month, deflate it,
%  so we can perform ordinary arithmetic.
%
  [ y, m, d ] = deflate_english ( y, m, d );

  days = month_length_english ( y, m );

  while ( days < d )

    d = d - days;
    m = m + 1;
    days = month_length_english ( y, m );
%
%  Make sure the month isn't too big.
%
    [ y, m ] = month_carry_english ( y, m );

  end
%
%  If the date is in the transition month, inflate it.
%
  [ y, m, d ] = inflate_english ( y, m, d );

  return
end
