)
            {
                if ( (nTempDays != 366) || !IsLeapYear( *rYear ) )
                {
                    i--;
                    bCalc = true;
                }
            }
        }
    }
    while ( bCalc );
    barrier(CLK_LOCAL_MEM_FENCE);
    if(nTempDays != 0){
        for (*rMonth = 1; (int)nTempDays > DaysInMonth( *rMonth, *rYear ); *rMonth += 1)
        {
            nTempDays -= DaysInMonth( *rMonth, *rYear ); 
        }
        *rDay = (int)nTempDays;
    }
}
