Changeset 1496 for XIOS/dev/XIOS_DEV_CMIP6/src
- Timestamp:
- 04/27/18 11:00:44 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/date.cpp
r1158 r1496 235 235 void CDate::addMonth(int value) 236 236 {// Value doit être égale à 1 ou -1. 237 238 const CCalendar& c = getRelCalendar(); 239 int nbMonthsPerYear = c.getYearLength(); 240 237 241 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; } 240 245 } 241 246
Note: See TracChangeset
for help on using the changeset viewer.