5 #include <boost/multi_array.hpp>
21 std::string comment_str;
22 if (!
cstr2string(comment, comment_size, comment_str))
return;
23 CTimer::get(
"XIOS").resume();
24 calendar_wrapper_hdl->comment.setValue(comment_str);
25 CTimer::get(
"XIOS").suspend();
30 CTimer::get(
"XIOS").resume();
31 if (!
string_copy(calendar_wrapper_hdl->comment.getInheritedValue(), comment, comment_size))
32 ERROR(
"void cxios_get_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl, char * comment, int comment_size)", <<
"Input string is too short");
33 CTimer::get(
"XIOS").suspend();
38 CTimer::get(
"XIOS").resume();
39 bool isDefined = calendar_wrapper_hdl->comment.hasInheritedValue();
40 CTimer::get(
"XIOS").suspend();
47 CTimer::get(
"XIOS").resume();
48 calendar_wrapper_hdl->day_length.setValue(day_length);
49 CTimer::get(
"XIOS").suspend();
54 CTimer::get(
"XIOS").resume();
55 *day_length = calendar_wrapper_hdl->day_length.getInheritedValue();
56 CTimer::get(
"XIOS").suspend();
61 CTimer::get(
"XIOS").resume();
62 bool isDefined = calendar_wrapper_hdl->day_length.hasInheritedValue();
63 CTimer::get(
"XIOS").suspend();
70 CTimer::get(
"XIOS").resume();
71 calendar_wrapper_hdl->leap_year_drift.setValue(leap_year_drift);
72 CTimer::get(
"XIOS").suspend();
77 CTimer::get(
"XIOS").resume();
78 *leap_year_drift = calendar_wrapper_hdl->leap_year_drift.getInheritedValue();
79 CTimer::get(
"XIOS").suspend();
84 CTimer::get(
"XIOS").resume();
85 bool isDefined = calendar_wrapper_hdl->leap_year_drift.hasInheritedValue();
86 CTimer::get(
"XIOS").suspend();
93 CTimer::get(
"XIOS").resume();
94 calendar_wrapper_hdl->leap_year_drift_offset.setValue(leap_year_drift_offset);
95 CTimer::get(
"XIOS").suspend();
100 CTimer::get(
"XIOS").resume();
101 *leap_year_drift_offset = calendar_wrapper_hdl->leap_year_drift_offset.getInheritedValue();
102 CTimer::get(
"XIOS").suspend();
107 CTimer::get(
"XIOS").resume();
108 bool isDefined = calendar_wrapper_hdl->leap_year_drift_offset.hasInheritedValue();
109 CTimer::get(
"XIOS").suspend();
116 CTimer::get(
"XIOS").resume();
117 calendar_wrapper_hdl->leap_year_month.setValue(leap_year_month);
118 CTimer::get(
"XIOS").suspend();
123 CTimer::get(
"XIOS").resume();
124 *leap_year_month = calendar_wrapper_hdl->leap_year_month.getInheritedValue();
125 CTimer::get(
"XIOS").suspend();
130 CTimer::get(
"XIOS").resume();
131 bool isDefined = calendar_wrapper_hdl->leap_year_month.hasInheritedValue();
132 CTimer::get(
"XIOS").suspend();
139 CTimer::get(
"XIOS").resume();
140 CArray<int,1> tmp(month_lengths, shape(extent[0]), neverDeleteData);
141 calendar_wrapper_hdl->month_lengths.reference(tmp.
copy());
142 CTimer::get(
"XIOS").suspend();
147 CTimer::get(
"XIOS").resume();
148 CArray<int,1> tmp(month_lengths, shape(extent[0]), neverDeleteData);
149 tmp=calendar_wrapper_hdl->month_lengths.getInheritedValue();
150 CTimer::get(
"XIOS").suspend();
155 CTimer::get(
"XIOS").resume();
156 bool isDefined = calendar_wrapper_hdl->month_lengths.hasInheritedValue();
157 CTimer::get(
"XIOS").suspend();
164 std::string start_date_str;
165 if (!
cstr2string(start_date, start_date_size, start_date_str))
return;
166 CTimer::get(
"XIOS").resume();
167 calendar_wrapper_hdl->start_date.setValue(start_date_str);
168 CTimer::get(
"XIOS").suspend();
173 CTimer::get(
"XIOS").resume();
174 if (!
string_copy(calendar_wrapper_hdl->start_date.getInheritedValue(), start_date, start_date_size))
175 ERROR(
"void cxios_get_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl, char * start_date, int start_date_size)", <<
"Input string is too short");
176 CTimer::get(
"XIOS").suspend();
181 CTimer::get(
"XIOS").resume();
182 bool isDefined = calendar_wrapper_hdl->start_date.hasInheritedValue();
183 CTimer::get(
"XIOS").suspend();
190 std::string time_origin_str;
191 if (!
cstr2string(time_origin, time_origin_size, time_origin_str))
return;
192 CTimer::get(
"XIOS").resume();
193 calendar_wrapper_hdl->time_origin.setValue(time_origin_str);
194 CTimer::get(
"XIOS").suspend();
199 CTimer::get(
"XIOS").resume();
200 if (!
string_copy(calendar_wrapper_hdl->time_origin.getInheritedValue(), time_origin, time_origin_size))
201 ERROR(
"void cxios_get_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl, char * time_origin, int time_origin_size)", <<
"Input string is too short");
202 CTimer::get(
"XIOS").suspend();
207 CTimer::get(
"XIOS").resume();
208 bool isDefined = calendar_wrapper_hdl->time_origin.hasInheritedValue();
209 CTimer::get(
"XIOS").suspend();
216 CTimer::get(
"XIOS").resume();
217 calendar_wrapper_hdl->timestep.allocate();
218 CDuration& timestep = calendar_wrapper_hdl->timestep.
get();
221 timestep.
day = timestep_c.
day;
226 CTimer::get(
"XIOS").suspend();
231 CTimer::get(
"XIOS").resume();
232 CDuration timestep = calendar_wrapper_hdl->timestep.getInheritedValue();
235 timestep_c->
day = timestep.
day;
240 CTimer::get(
"XIOS").suspend();
245 CTimer::get(
"XIOS").resume();
246 bool isDefined = calendar_wrapper_hdl->timestep.hasInheritedValue();
247 CTimer::get(
"XIOS").suspend();
254 std::string type_str;
255 if (!
cstr2string(type, type_size, type_str))
return;
256 CTimer::get(
"XIOS").resume();
257 calendar_wrapper_hdl->type.
fromString(type_str);
258 CTimer::get(
"XIOS").suspend();
263 CTimer::get(
"XIOS").resume();
264 if (!
string_copy(calendar_wrapper_hdl->type.getInheritedStringValue(),
type, type_size))
265 ERROR(
"void cxios_get_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl, char * type, int type_size)", <<
"Input string is too short");
266 CTimer::get(
"XIOS").suspend();
271 CTimer::get(
"XIOS").resume();
272 bool isDefined = calendar_wrapper_hdl->type.hasInheritedValue();
273 CTimer::get(
"XIOS").suspend();
280 CTimer::get(
"XIOS").resume();
281 calendar_wrapper_hdl->year_length.setValue(year_length);
282 CTimer::get(
"XIOS").suspend();
287 CTimer::get(
"XIOS").resume();
288 *year_length = calendar_wrapper_hdl->year_length.getInheritedValue();
289 CTimer::get(
"XIOS").suspend();
294 CTimer::get(
"XIOS").resume();
295 bool isDefined = calendar_wrapper_hdl->year_length.hasInheritedValue();
296 CTimer::get(
"XIOS").suspend();
bool cxios_is_defined_calendar_wrapper_year_length(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_get_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl, char *start_date, int start_date_size)
bool cxios_is_defined_calendar_wrapper_leap_year_month(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_get_calendar_wrapper_timestep(calendar_wrapper_Ptr calendar_wrapper_hdl, cxios_duration *timestep_c)
void cxios_set_calendar_wrapper_leap_year_month(calendar_wrapper_Ptr calendar_wrapper_hdl, int leap_year_month)
bool cxios_is_defined_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl)
bool cxios_is_defined_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_get_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl, char *type, int type_size)
void cxios_set_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl, const char *type, int type_size)
void cxios_get_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl, char *comment, int comment_size)
xios::CCalendarWrapper * calendar_wrapper_Ptr
void cxios_get_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int *day_length)
void cxios_set_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl, const char *start_date, int start_date_size)
static T * get(const string &id)
void cxios_set_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl, const char *comment, int comment_size)
double year
Propriétés publiques ///.
void cxios_get_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl, char *time_origin, int time_origin_size)
bool cxios_is_defined_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_set_calendar_wrapper_timestep(calendar_wrapper_Ptr calendar_wrapper_hdl, cxios_duration timestep_c)
virtual void fromString(const StdString &str)
bool cxios_is_defined_calendar_wrapper_month_lengths(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_set_calendar_wrapper_year_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int year_length)
bool string_copy(const std::string &str, char *cstr, int cstr_size)
void cxios_set_calendar_wrapper_month_lengths(calendar_wrapper_Ptr calendar_wrapper_hdl, int *month_lengths, int *extent)
void cxios_get_calendar_wrapper_month_lengths(calendar_wrapper_Ptr calendar_wrapper_hdl, int *month_lengths, int *extent)
bool cxios_is_defined_calendar_wrapper_timestep(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_get_calendar_wrapper_leap_year_month(calendar_wrapper_Ptr calendar_wrapper_hdl, int *leap_year_month)
void cxios_get_calendar_wrapper_leap_year_drift(calendar_wrapper_Ptr calendar_wrapper_hdl, double *leap_year_drift)
void cxios_get_calendar_wrapper_year_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int *year_length)
bool cxios_is_defined_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_set_calendar_wrapper_leap_year_drift_offset(calendar_wrapper_Ptr calendar_wrapper_hdl, double leap_year_drift_offset)
void cxios_get_calendar_wrapper_leap_year_drift_offset(calendar_wrapper_Ptr calendar_wrapper_hdl, double *leap_year_drift_offset)
bool cxios_is_defined_calendar_wrapper_leap_year_drift_offset(calendar_wrapper_Ptr calendar_wrapper_hdl)
bool cxios_is_defined_calendar_wrapper_leap_year_drift(calendar_wrapper_Ptr calendar_wrapper_hdl)
void cxios_set_calendar_wrapper_leap_year_drift(calendar_wrapper_Ptr calendar_wrapper_hdl, double leap_year_drift)
void cxios_set_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl, const char *time_origin, int time_origin_size)
bool cstr2string(const char *cstr, int cstr_size, std::string &str)
void cxios_set_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int day_length)
CArray< T_numtype, N_rank > copy() const
bool cxios_is_defined_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl)