source: XIOS3/trunk/src/interface/c_attr/icaxis_attr.cpp @ 2622

Last change on this file since 2622 was 2616, checked in by jderouillat, 4 months ago

Add XIOS3 fortran interfaces (resources management, chunking, compression)

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:eol-style set to native
File size: 23.1 KB
RevLine 
[325]1/* ************************************************************************** *
[581]2 *               Interface auto generated - do not modify                     *
[325]3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
[591]6#include "xios.hpp"
[352]7#include "attribute_template.hpp"
8#include "object_template.hpp"
9#include "group_template.hpp"
[325]10#include "icutil.hpp"
[532]11#include "icdate.hpp"
[347]12#include "timer.hpp"
[369]13#include "node_type.hpp"
[325]14
15extern "C"
16{
[581]17  typedef xios::CAxis* axis_Ptr;
18
[546]19  void cxios_set_axis_axis_ref(axis_Ptr axis_hdl, const char * axis_ref, int axis_ref_size)
20  {
21    std::string axis_ref_str;
[581]22    if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
23    CTimer::get("XIOS").resume();
[546]24    axis_hdl->axis_ref.setValue(axis_ref_str);
[581]25    CTimer::get("XIOS").suspend();
[546]26  }
[581]27
[546]28  void cxios_get_axis_axis_ref(axis_Ptr axis_hdl, char * axis_ref, int axis_ref_size)
29  {
[581]30    CTimer::get("XIOS").resume();
31    if (!string_copy(axis_hdl->axis_ref.getInheritedValue(), axis_ref, axis_ref_size))
32      ERROR("void cxios_get_axis_axis_ref(axis_Ptr axis_hdl, char * axis_ref, int axis_ref_size)", << "Input string is too short");
33    CTimer::get("XIOS").suspend();
[546]34  }
[581]35
36  bool cxios_is_defined_axis_axis_ref(axis_Ptr axis_hdl)
[546]37  {
38     CTimer::get("XIOS").resume();
[581]39     bool isDefined = axis_hdl->axis_ref.hasInheritedValue();
[546]40     CTimer::get("XIOS").suspend();
[581]41     return isDefined;
[546]42  }
[581]43
44
[1492]45  void cxios_set_axis_axis_type(axis_Ptr axis_hdl, const char * axis_type, int axis_type_size)
46  {
47    std::string axis_type_str;
48    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
49    CTimer::get("XIOS").resume();
50    axis_hdl->axis_type.fromString(axis_type_str);
51    CTimer::get("XIOS").suspend();
52  }
53
54  void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)
55  {
56    CTimer::get("XIOS").resume();
57    if (!string_copy(axis_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
58      ERROR("void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
59    CTimer::get("XIOS").suspend();
60  }
61
62  bool cxios_is_defined_axis_axis_type(axis_Ptr axis_hdl)
63  {
64     CTimer::get("XIOS").resume();
65     bool isDefined = axis_hdl->axis_type.hasInheritedValue();
66     CTimer::get("XIOS").suspend();
67     return isDefined;
68  }
69
70
[666]71  void cxios_set_axis_begin(axis_Ptr axis_hdl, int begin)
72  {
73    CTimer::get("XIOS").resume();
74    axis_hdl->begin.setValue(begin);
75    CTimer::get("XIOS").suspend();
76  }
77
78  void cxios_get_axis_begin(axis_Ptr axis_hdl, int* begin)
79  {
80    CTimer::get("XIOS").resume();
81    *begin = axis_hdl->begin.getInheritedValue();
82    CTimer::get("XIOS").suspend();
83  }
84
85  bool cxios_is_defined_axis_begin(axis_Ptr axis_hdl)
86  {
87     CTimer::get("XIOS").resume();
88     bool isDefined = axis_hdl->begin.hasInheritedValue();
89     CTimer::get("XIOS").suspend();
90     return isDefined;
91  }
92
93
[674]94  void cxios_set_axis_bounds(axis_Ptr axis_hdl, double* bounds, int* extent)
[609]95  {
96    CTimer::get("XIOS").resume();
[674]97    CArray<double,2> tmp(bounds, shape(extent[0], extent[1]), neverDeleteData);
[609]98    axis_hdl->bounds.reference(tmp.copy());
99     CTimer::get("XIOS").suspend();
100  }
101
[674]102  void cxios_get_axis_bounds(axis_Ptr axis_hdl, double* bounds, int* extent)
[609]103  {
104    CTimer::get("XIOS").resume();
[674]105    CArray<double,2> tmp(bounds, shape(extent[0], extent[1]), neverDeleteData);
[609]106    tmp=axis_hdl->bounds.getInheritedValue();
107     CTimer::get("XIOS").suspend();
108  }
109
110  bool cxios_is_defined_axis_bounds(axis_Ptr axis_hdl)
111  {
112     CTimer::get("XIOS").resume();
113     bool isDefined = axis_hdl->bounds.hasInheritedValue();
114     CTimer::get("XIOS").suspend();
115     return isDefined;
116  }
117
118
[1492]119  void cxios_set_axis_bounds_name(axis_Ptr axis_hdl, const char * bounds_name, int bounds_name_size)
120  {
121    std::string bounds_name_str;
122    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
123    CTimer::get("XIOS").resume();
124    axis_hdl->bounds_name.setValue(bounds_name_str);
125    CTimer::get("XIOS").suspend();
126  }
127
128  void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)
129  {
130    CTimer::get("XIOS").resume();
131    if (!string_copy(axis_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
132      ERROR("void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
133    CTimer::get("XIOS").suspend();
134  }
135
136  bool cxios_is_defined_axis_bounds_name(axis_Ptr axis_hdl)
137  {
138     CTimer::get("XIOS").resume();
139     bool isDefined = axis_hdl->bounds_name.hasInheritedValue();
140     CTimer::get("XIOS").suspend();
141     return isDefined;
142  }
143
144
[2616]145  void cxios_set_axis_chunking_weight(axis_Ptr axis_hdl, double chunking_weight)
146  {
147    CTimer::get("XIOS").resume();
148    axis_hdl->chunking_weight.setValue(chunking_weight);
149    CTimer::get("XIOS").suspend();
150  }
151
152  void cxios_get_axis_chunking_weight(axis_Ptr axis_hdl, double* chunking_weight)
153  {
154    CTimer::get("XIOS").resume();
155    *chunking_weight = axis_hdl->chunking_weight.getInheritedValue();
156    CTimer::get("XIOS").suspend();
157  }
158
159  bool cxios_is_defined_axis_chunking_weight(axis_Ptr axis_hdl)
160  {
161     CTimer::get("XIOS").resume();
162     bool isDefined = axis_hdl->chunking_weight.hasInheritedValue();
163     CTimer::get("XIOS").suspend();
164     return isDefined;
165  }
166
167
[1492]168  void cxios_set_axis_comment(axis_Ptr axis_hdl, const char * comment, int comment_size)
169  {
170    std::string comment_str;
171    if (!cstr2string(comment, comment_size, comment_str)) return;
172    CTimer::get("XIOS").resume();
173    axis_hdl->comment.setValue(comment_str);
174    CTimer::get("XIOS").suspend();
175  }
176
177  void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)
178  {
179    CTimer::get("XIOS").resume();
180    if (!string_copy(axis_hdl->comment.getInheritedValue(), comment, comment_size))
181      ERROR("void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)", << "Input string is too short");
182    CTimer::get("XIOS").suspend();
183  }
184
185  bool cxios_is_defined_axis_comment(axis_Ptr axis_hdl)
186  {
187     CTimer::get("XIOS").resume();
188     bool isDefined = axis_hdl->comment.hasInheritedValue();
189     CTimer::get("XIOS").suspend();
190     return isDefined;
191  }
192
193
[555]194  void cxios_set_axis_data_begin(axis_Ptr axis_hdl, int data_begin)
195  {
[581]196    CTimer::get("XIOS").resume();
[555]197    axis_hdl->data_begin.setValue(data_begin);
[581]198    CTimer::get("XIOS").suspend();
[555]199  }
[581]200
[555]201  void cxios_get_axis_data_begin(axis_Ptr axis_hdl, int* data_begin)
202  {
[581]203    CTimer::get("XIOS").resume();
[555]204    *data_begin = axis_hdl->data_begin.getInheritedValue();
[581]205    CTimer::get("XIOS").suspend();
[555]206  }
[581]207
208  bool cxios_is_defined_axis_data_begin(axis_Ptr axis_hdl)
[555]209  {
210     CTimer::get("XIOS").resume();
[581]211     bool isDefined = axis_hdl->data_begin.hasInheritedValue();
[555]212     CTimer::get("XIOS").suspend();
[581]213     return isDefined;
[555]214  }
[581]215
216
[674]217  void cxios_set_axis_data_index(axis_Ptr axis_hdl, int* data_index, int* extent)
[555]218  {
219    CTimer::get("XIOS").resume();
[674]220    CArray<int,1> tmp(data_index, shape(extent[0]), neverDeleteData);
[555]221    axis_hdl->data_index.reference(tmp.copy());
222     CTimer::get("XIOS").suspend();
223  }
[581]224
[674]225  void cxios_get_axis_data_index(axis_Ptr axis_hdl, int* data_index, int* extent)
[555]226  {
227    CTimer::get("XIOS").resume();
[674]228    CArray<int,1> tmp(data_index, shape(extent[0]), neverDeleteData);
[581]229    tmp=axis_hdl->data_index.getInheritedValue();
[555]230     CTimer::get("XIOS").suspend();
231  }
[581]232
233  bool cxios_is_defined_axis_data_index(axis_Ptr axis_hdl)
[555]234  {
235     CTimer::get("XIOS").resume();
[581]236     bool isDefined = axis_hdl->data_index.hasInheritedValue();
[555]237     CTimer::get("XIOS").suspend();
[581]238     return isDefined;
[555]239  }
[581]240
241
[555]242  void cxios_set_axis_data_n(axis_Ptr axis_hdl, int data_n)
243  {
[581]244    CTimer::get("XIOS").resume();
[555]245    axis_hdl->data_n.setValue(data_n);
[581]246    CTimer::get("XIOS").suspend();
[555]247  }
[581]248
[555]249  void cxios_get_axis_data_n(axis_Ptr axis_hdl, int* data_n)
250  {
[581]251    CTimer::get("XIOS").resume();
[555]252    *data_n = axis_hdl->data_n.getInheritedValue();
[581]253    CTimer::get("XIOS").suspend();
[555]254  }
[581]255
256  bool cxios_is_defined_axis_data_n(axis_Ptr axis_hdl)
[555]257  {
258     CTimer::get("XIOS").resume();
[581]259     bool isDefined = axis_hdl->data_n.hasInheritedValue();
[555]260     CTimer::get("XIOS").suspend();
[581]261     return isDefined;
[555]262  }
[581]263
264
[1492]265  void cxios_set_axis_dim_name(axis_Ptr axis_hdl, const char * dim_name, int dim_name_size)
266  {
267    std::string dim_name_str;
268    if (!cstr2string(dim_name, dim_name_size, dim_name_str)) return;
269    CTimer::get("XIOS").resume();
270    axis_hdl->dim_name.setValue(dim_name_str);
271    CTimer::get("XIOS").suspend();
272  }
273
274  void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)
275  {
276    CTimer::get("XIOS").resume();
277    if (!string_copy(axis_hdl->dim_name.getInheritedValue(), dim_name, dim_name_size))
278      ERROR("void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)", << "Input string is too short");
279    CTimer::get("XIOS").suspend();
280  }
281
282  bool cxios_is_defined_axis_dim_name(axis_Ptr axis_hdl)
283  {
284     CTimer::get("XIOS").resume();
285     bool isDefined = axis_hdl->dim_name.hasInheritedValue();
286     CTimer::get("XIOS").suspend();
287     return isDefined;
288  }
289
290
291  void cxios_set_axis_formula(axis_Ptr axis_hdl, const char * formula, int formula_size)
292  {
293    std::string formula_str;
294    if (!cstr2string(formula, formula_size, formula_str)) return;
295    CTimer::get("XIOS").resume();
296    axis_hdl->formula.setValue(formula_str);
297    CTimer::get("XIOS").suspend();
298  }
299
300  void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)
301  {
302    CTimer::get("XIOS").resume();
303    if (!string_copy(axis_hdl->formula.getInheritedValue(), formula, formula_size))
304      ERROR("void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)", << "Input string is too short");
305    CTimer::get("XIOS").suspend();
306  }
307
308  bool cxios_is_defined_axis_formula(axis_Ptr axis_hdl)
309  {
310     CTimer::get("XIOS").resume();
311     bool isDefined = axis_hdl->formula.hasInheritedValue();
312     CTimer::get("XIOS").suspend();
313     return isDefined;
314  }
315
316
317  void cxios_set_axis_formula_bounds(axis_Ptr axis_hdl, const char * formula_bounds, int formula_bounds_size)
318  {
319    std::string formula_bounds_str;
320    if (!cstr2string(formula_bounds, formula_bounds_size, formula_bounds_str)) return;
321    CTimer::get("XIOS").resume();
322    axis_hdl->formula_bounds.setValue(formula_bounds_str);
323    CTimer::get("XIOS").suspend();
324  }
325
326  void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)
327  {
328    CTimer::get("XIOS").resume();
329    if (!string_copy(axis_hdl->formula_bounds.getInheritedValue(), formula_bounds, formula_bounds_size))
330      ERROR("void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)", << "Input string is too short");
331    CTimer::get("XIOS").suspend();
332  }
333
334  bool cxios_is_defined_axis_formula_bounds(axis_Ptr axis_hdl)
335  {
336     CTimer::get("XIOS").resume();
337     bool isDefined = axis_hdl->formula_bounds.hasInheritedValue();
338     CTimer::get("XIOS").suspend();
339     return isDefined;
340  }
341
342
343  void cxios_set_axis_formula_term(axis_Ptr axis_hdl, const char * formula_term, int formula_term_size)
344  {
345    std::string formula_term_str;
346    if (!cstr2string(formula_term, formula_term_size, formula_term_str)) return;
347    CTimer::get("XIOS").resume();
348    axis_hdl->formula_term.setValue(formula_term_str);
349    CTimer::get("XIOS").suspend();
350  }
351
352  void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)
353  {
354    CTimer::get("XIOS").resume();
355    if (!string_copy(axis_hdl->formula_term.getInheritedValue(), formula_term, formula_term_size))
356      ERROR("void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)", << "Input string is too short");
357    CTimer::get("XIOS").suspend();
358  }
359
360  bool cxios_is_defined_axis_formula_term(axis_Ptr axis_hdl)
361  {
362     CTimer::get("XIOS").resume();
363     bool isDefined = axis_hdl->formula_term.hasInheritedValue();
364     CTimer::get("XIOS").suspend();
365     return isDefined;
366  }
367
368
369  void cxios_set_axis_formula_term_bounds(axis_Ptr axis_hdl, const char * formula_term_bounds, int formula_term_bounds_size)
370  {
371    std::string formula_term_bounds_str;
372    if (!cstr2string(formula_term_bounds, formula_term_bounds_size, formula_term_bounds_str)) return;
373    CTimer::get("XIOS").resume();
374    axis_hdl->formula_term_bounds.setValue(formula_term_bounds_str);
375    CTimer::get("XIOS").suspend();
376  }
377
378  void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)
379  {
380    CTimer::get("XIOS").resume();
381    if (!string_copy(axis_hdl->formula_term_bounds.getInheritedValue(), formula_term_bounds, formula_term_bounds_size))
382      ERROR("void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)", << "Input string is too short");
383    CTimer::get("XIOS").suspend();
384  }
385
386  bool cxios_is_defined_axis_formula_term_bounds(axis_Ptr axis_hdl)
387  {
388     CTimer::get("XIOS").resume();
389     bool isDefined = axis_hdl->formula_term_bounds.hasInheritedValue();
390     CTimer::get("XIOS").suspend();
391     return isDefined;
392  }
393
394
[817]395  void cxios_set_axis_index(axis_Ptr axis_hdl, int* index, int* extent)
396  {
397    CTimer::get("XIOS").resume();
398    CArray<int,1> tmp(index, shape(extent[0]), neverDeleteData);
399    axis_hdl->index.reference(tmp.copy());
400     CTimer::get("XIOS").suspend();
401  }
402
403  void cxios_get_axis_index(axis_Ptr axis_hdl, int* index, int* extent)
404  {
405    CTimer::get("XIOS").resume();
406    CArray<int,1> tmp(index, shape(extent[0]), neverDeleteData);
407    tmp=axis_hdl->index.getInheritedValue();
408     CTimer::get("XIOS").suspend();
409  }
410
411  bool cxios_is_defined_axis_index(axis_Ptr axis_hdl)
412  {
413     CTimer::get("XIOS").resume();
414     bool isDefined = axis_hdl->index.hasInheritedValue();
415     CTimer::get("XIOS").suspend();
416     return isDefined;
417  }
418
419
[1158]420  void cxios_set_axis_label(axis_Ptr axis_hdl, char* label, int str_len, int* str_size, int* extent)
421  {
422    CTimer::get("XIOS").resume();
423    axis_hdl->label.resize(shape(extent[0]));
424    Array<StdString,1>::iterator it, itb=axis_hdl->label.begin(), ite=axis_hdl->label.end() ;
425    int i, n ;
426    for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&label[n],str_size[i]) ;
427    CTimer::get("XIOS").suspend();
428  }
429
430  void cxios_get_axis_label(axis_Ptr axis_hdl, char* label, int str_size, int* extent)
431  {
432    CTimer::get("XIOS").resume();
433    Array<StdString,1>::const_iterator it, itb=axis_hdl->label.getInheritedValue().begin(), ite=axis_hdl->label.getInheritedValue().end() ;
434    int n ;
435    for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&label[n],it->size()) ; 
436    CTimer::get("XIOS").suspend();
437  }
438
439  bool cxios_is_defined_axis_label(axis_Ptr axis_hdl)
440  {
441     CTimer::get("XIOS").resume();
442     bool isDefined = axis_hdl->label.hasInheritedValue();
443     CTimer::get("XIOS").suspend();
444     return isDefined;
445  }
446
447
[325]448  void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size)
449  {
450    std::string long_name_str;
[581]451    if (!cstr2string(long_name, long_name_size, long_name_str)) return;
452    CTimer::get("XIOS").resume();
[325]453    axis_hdl->long_name.setValue(long_name_str);
[581]454    CTimer::get("XIOS").suspend();
[325]455  }
[581]456
[325]457  void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)
458  {
[581]459    CTimer::get("XIOS").resume();
460    if (!string_copy(axis_hdl->long_name.getInheritedValue(), long_name, long_name_size))
461      ERROR("void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)", << "Input string is too short");
462    CTimer::get("XIOS").suspend();
[325]463  }
[581]464
465  bool cxios_is_defined_axis_long_name(axis_Ptr axis_hdl)
[432]466  {
467     CTimer::get("XIOS").resume();
[581]468     bool isDefined = axis_hdl->long_name.hasInheritedValue();
[432]469     CTimer::get("XIOS").suspend();
[581]470     return isDefined;
[432]471  }
[581]472
473
[674]474  void cxios_set_axis_mask(axis_Ptr axis_hdl, bool* mask, int* extent)
[555]475  {
476    CTimer::get("XIOS").resume();
[674]477    CArray<bool,1> tmp(mask, shape(extent[0]), neverDeleteData);
[555]478    axis_hdl->mask.reference(tmp.copy());
479     CTimer::get("XIOS").suspend();
480  }
[581]481
[674]482  void cxios_get_axis_mask(axis_Ptr axis_hdl, bool* mask, int* extent)
[555]483  {
484    CTimer::get("XIOS").resume();
[674]485    CArray<bool,1> tmp(mask, shape(extent[0]), neverDeleteData);
[581]486    tmp=axis_hdl->mask.getInheritedValue();
[555]487     CTimer::get("XIOS").suspend();
488  }
[581]489
490  bool cxios_is_defined_axis_mask(axis_Ptr axis_hdl)
[555]491  {
492     CTimer::get("XIOS").resume();
[581]493     bool isDefined = axis_hdl->mask.hasInheritedValue();
[555]494     CTimer::get("XIOS").suspend();
[581]495     return isDefined;
[555]496  }
[581]497
498
[666]499  void cxios_set_axis_n(axis_Ptr axis_hdl, int n)
[325]500  {
[581]501    CTimer::get("XIOS").resume();
[666]502    axis_hdl->n.setValue(n);
[581]503    CTimer::get("XIOS").suspend();
[325]504  }
[581]505
[666]506  void cxios_get_axis_n(axis_Ptr axis_hdl, int* n)
[325]507  {
[581]508    CTimer::get("XIOS").resume();
[666]509    *n = axis_hdl->n.getInheritedValue();
[581]510    CTimer::get("XIOS").suspend();
[325]511  }
[581]512
[666]513  bool cxios_is_defined_axis_n(axis_Ptr axis_hdl)
[432]514  {
515     CTimer::get("XIOS").resume();
[666]516     bool isDefined = axis_hdl->n.hasInheritedValue();
[432]517     CTimer::get("XIOS").suspend();
[581]518     return isDefined;
[432]519  }
[581]520
521
[779]522  void cxios_set_axis_n_distributed_partition(axis_Ptr axis_hdl, int n_distributed_partition)
523  {
524    CTimer::get("XIOS").resume();
525    axis_hdl->n_distributed_partition.setValue(n_distributed_partition);
526    CTimer::get("XIOS").suspend();
527  }
528
529  void cxios_get_axis_n_distributed_partition(axis_Ptr axis_hdl, int* n_distributed_partition)
530  {
531    CTimer::get("XIOS").resume();
532    *n_distributed_partition = axis_hdl->n_distributed_partition.getInheritedValue();
533    CTimer::get("XIOS").suspend();
534  }
535
536  bool cxios_is_defined_axis_n_distributed_partition(axis_Ptr axis_hdl)
537  {
538     CTimer::get("XIOS").resume();
539     bool isDefined = axis_hdl->n_distributed_partition.hasInheritedValue();
540     CTimer::get("XIOS").suspend();
541     return isDefined;
542  }
543
544
[666]545  void cxios_set_axis_n_glo(axis_Ptr axis_hdl, int n_glo)
[555]546  {
[581]547    CTimer::get("XIOS").resume();
[666]548    axis_hdl->n_glo.setValue(n_glo);
[581]549    CTimer::get("XIOS").suspend();
[555]550  }
[581]551
[666]552  void cxios_get_axis_n_glo(axis_Ptr axis_hdl, int* n_glo)
[555]553  {
[581]554    CTimer::get("XIOS").resume();
[666]555    *n_glo = axis_hdl->n_glo.getInheritedValue();
[581]556    CTimer::get("XIOS").suspend();
[555]557  }
[581]558
[666]559  bool cxios_is_defined_axis_n_glo(axis_Ptr axis_hdl)
[555]560  {
561     CTimer::get("XIOS").resume();
[666]562     bool isDefined = axis_hdl->n_glo.hasInheritedValue();
[555]563     CTimer::get("XIOS").suspend();
[581]564     return isDefined;
[555]565  }
[581]566
567
[666]568  void cxios_set_axis_name(axis_Ptr axis_hdl, const char * name, int name_size)
[415]569  {
[666]570    std::string name_str;
571    if (!cstr2string(name, name_size, name_str)) return;
[581]572    CTimer::get("XIOS").resume();
[666]573    axis_hdl->name.setValue(name_str);
[581]574    CTimer::get("XIOS").suspend();
[415]575  }
[581]576
[666]577  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
[415]578  {
[581]579    CTimer::get("XIOS").resume();
[666]580    if (!string_copy(axis_hdl->name.getInheritedValue(), name, name_size))
581      ERROR("void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)", << "Input string is too short");
[581]582    CTimer::get("XIOS").suspend();
[415]583  }
[581]584
[666]585  bool cxios_is_defined_axis_name(axis_Ptr axis_hdl)
[432]586  {
587     CTimer::get("XIOS").resume();
[666]588     bool isDefined = axis_hdl->name.hasInheritedValue();
[432]589     CTimer::get("XIOS").suspend();
[581]590     return isDefined;
[432]591  }
[581]592
593
[666]594  void cxios_set_axis_positive(axis_Ptr axis_hdl, const char * positive, int positive_size)
[325]595  {
[666]596    std::string positive_str;
597    if (!cstr2string(positive, positive_size, positive_str)) return;
[581]598    CTimer::get("XIOS").resume();
[666]599    axis_hdl->positive.fromString(positive_str);
[581]600    CTimer::get("XIOS").suspend();
[325]601  }
[581]602
[666]603  void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)
[325]604  {
[581]605    CTimer::get("XIOS").resume();
[666]606    if (!string_copy(axis_hdl->positive.getInheritedStringValue(), positive, positive_size))
607      ERROR("void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)", << "Input string is too short");
[581]608    CTimer::get("XIOS").suspend();
[325]609  }
[581]610
[666]611  bool cxios_is_defined_axis_positive(axis_Ptr axis_hdl)
[432]612  {
613     CTimer::get("XIOS").resume();
[666]614     bool isDefined = axis_hdl->positive.hasInheritedValue();
[432]615     CTimer::get("XIOS").suspend();
[581]616     return isDefined;
[432]617  }
[581]618
619
[1158]620  void cxios_set_axis_prec(axis_Ptr axis_hdl, int prec)
621  {
622    CTimer::get("XIOS").resume();
623    axis_hdl->prec.setValue(prec);
624    CTimer::get("XIOS").suspend();
625  }
626
627  void cxios_get_axis_prec(axis_Ptr axis_hdl, int* prec)
628  {
629    CTimer::get("XIOS").resume();
630    *prec = axis_hdl->prec.getInheritedValue();
631    CTimer::get("XIOS").suspend();
632  }
633
634  bool cxios_is_defined_axis_prec(axis_Ptr axis_hdl)
635  {
636     CTimer::get("XIOS").resume();
637     bool isDefined = axis_hdl->prec.hasInheritedValue();
638     CTimer::get("XIOS").suspend();
639     return isDefined;
640  }
641
642
[325]643  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size)
644  {
645    std::string standard_name_str;
[581]646    if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
647    CTimer::get("XIOS").resume();
[325]648    axis_hdl->standard_name.setValue(standard_name_str);
[581]649    CTimer::get("XIOS").suspend();
[325]650  }
[581]651
[325]652  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
653  {
[581]654    CTimer::get("XIOS").resume();
655    if (!string_copy(axis_hdl->standard_name.getInheritedValue(), standard_name, standard_name_size))
656      ERROR("void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)", << "Input string is too short");
657    CTimer::get("XIOS").suspend();
[325]658  }
[581]659
660  bool cxios_is_defined_axis_standard_name(axis_Ptr axis_hdl)
[432]661  {
662     CTimer::get("XIOS").resume();
[581]663     bool isDefined = axis_hdl->standard_name.hasInheritedValue();
[432]664     CTimer::get("XIOS").suspend();
[581]665     return isDefined;
[432]666  }
[581]667
668
[325]669  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
670  {
671    std::string unit_str;
[581]672    if (!cstr2string(unit, unit_size, unit_str)) return;
673    CTimer::get("XIOS").resume();
[325]674    axis_hdl->unit.setValue(unit_str);
[581]675    CTimer::get("XIOS").suspend();
[325]676  }
[581]677
[325]678  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
679  {
[581]680    CTimer::get("XIOS").resume();
681    if (!string_copy(axis_hdl->unit.getInheritedValue(), unit, unit_size))
682      ERROR("void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)", << "Input string is too short");
683    CTimer::get("XIOS").suspend();
[325]684  }
[581]685
686  bool cxios_is_defined_axis_unit(axis_Ptr axis_hdl)
[432]687  {
688     CTimer::get("XIOS").resume();
[581]689     bool isDefined = axis_hdl->unit.hasInheritedValue();
[432]690     CTimer::get("XIOS").suspend();
[581]691     return isDefined;
[432]692  }
[581]693
694
[674]695  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int* extent)
[325]696  {
[369]697    CTimer::get("XIOS").resume();
[674]698    CArray<double,1> tmp(value, shape(extent[0]), neverDeleteData);
[369]699    axis_hdl->value.reference(tmp.copy());
[416]700     CTimer::get("XIOS").suspend();
[325]701  }
[581]702
[674]703  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int* extent)
[325]704  {
[416]705    CTimer::get("XIOS").resume();
[674]706    CArray<double,1> tmp(value, shape(extent[0]), neverDeleteData);
[581]707    tmp=axis_hdl->value.getInheritedValue();
[347]708     CTimer::get("XIOS").suspend();
[325]709  }
[581]710
711  bool cxios_is_defined_axis_value(axis_Ptr axis_hdl)
[432]712  {
713     CTimer::get("XIOS").resume();
[581]714     bool isDefined = axis_hdl->value.hasInheritedValue();
[432]715     CTimer::get("XIOS").suspend();
[581]716     return isDefined;
[432]717  }
[325]718}
Note: See TracBrowser for help on using the repository browser.