Changeset 532 for XIOS/trunk/src/node
- Timestamp:
- 12/10/14 14:27:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/context.cpp
r526 r532 74 74 this->calendar = newCalendar; 75 75 calendar_type.fromString(this->calendar->getId()); 76 start_date.setValue(this->calendar->getInitDate() .toString());76 start_date.setValue(this->calendar->getInitDate()); 77 77 } 78 78 … … 87 87 << "Impossible to define a calendar (an attribute is missing)."); 88 88 89 #define DECLARE_CALENDAR(MType, eType) \ 90 if (calendar_type.getValue() == eType) \ 91 { \ 92 if (time_origin.isEmpty()) \ 93 this->calendar = boost::shared_ptr<CCalendar> \ 94 (new C##MType##Calendar(start_date.getValue())); \ 95 else this->calendar = boost::shared_ptr<CCalendar> \ 96 (new C##MType##Calendar(start_date.getValue(),time_origin.getValue())); \ 97 if (!this->timestep.isEmpty()) \ 98 this->calendar->setTimeStep \ 99 (CDuration::FromString(this->timestep.getValue())); \ 100 return; \ 101 } 89 #define DECLARE_CALENDAR(MType, eType) \ 90 if (calendar_type.getValue() == eType) \ 91 { \ 92 if (time_origin.isEmpty()) \ 93 this->calendar = boost::shared_ptr<CCalendar> \ 94 (new C##MType##Calendar(start_date.getValue())); \ 95 else this->calendar = boost::shared_ptr<CCalendar> \ 96 (new C##MType##Calendar(start_date.getValue(), time_origin.getValue())); \ 97 \ 98 if (!start_date.getValue().setRelCalendar(*this->calendar)) \ 99 ERROR("CContext::solveCalendar(void)", \ 100 "start_date: Bad format or date not conform to the calendar"); \ 101 if (!time_origin.getValue().setRelCalendar(*this->calendar)) \ 102 ERROR("CContext::solveCalendar(void)", \ 103 "time_origin: Bad format or date not conform to the calendar"); \ 104 \ 105 if (!this->timestep.isEmpty()) \ 106 this->calendar->setTimeStep \ 107 (CDuration::FromString(this->timestep.getValue())); \ 108 return; \ 109 } 102 110 #include "calendar_type.conf" 103 111 #undef DECLARE_CALENDAR
Note: See TracChangeset
for help on using the changeset viewer.