Ignore:
Timestamp:
06/18/18 20:32:55 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with trunk r1544

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/date.cpp

    r1105 r1545  
    235235      void CDate::addMonth(int value) 
    236236      {// Value doit être égale à 1 ou -1. 
     237 
     238        const CCalendar& c = getRelCalendar(); 
     239        int nbMonthsPerYear = c.getYearLength(); 
     240 
    237241        this->month += value; 
    238         if (this->month == 13) { year++; this->month = 1; } 
    239         if (this->month == 0)  { year--; this->month = 12; } 
     242 
     243        if (this->month == nbMonthsPerYear + 1) { year++; this->month = 1; } 
     244        if (this->month == 0)  { year--; this->month = nbMonthsPerYear; } 
    240245      } 
    241246 
Note: See TracChangeset for help on using the changeset viewer.