source: XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp @ 817

Last change on this file since 817 was 817, checked in by mhnguyen, 8 years ago

Adding some attributes for axis and grid (ticket 71, 78)

+) Add index attribute for axis
+) Change mask?d to mask_?d for grid

Test
+) On Curie
+) Test passes

  • 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: 4.6 KB
Line 
1/* ************************************************************************** *
2 *               Interface auto generated - do not modify                     *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <boost/shared_ptr.hpp>
7#include "xios.hpp"
8#include "attribute_template.hpp"
9#include "object_template.hpp"
10#include "group_template.hpp"
11#include "icutil.hpp"
12#include "icdate.hpp"
13#include "timer.hpp"
14#include "node_type.hpp"
15
16extern "C"
17{
18  typedef xios::CGrid* grid_Ptr;
19
20  void cxios_set_grid_description(grid_Ptr grid_hdl, const char * description, int description_size)
21  {
22    std::string description_str;
23    if (!cstr2string(description, description_size, description_str)) return;
24    CTimer::get("XIOS").resume();
25    grid_hdl->description.setValue(description_str);
26    CTimer::get("XIOS").suspend();
27  }
28
29  void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size)
30  {
31    CTimer::get("XIOS").resume();
32    if (!string_copy(grid_hdl->description.getInheritedValue(), description, description_size))
33      ERROR("void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size)", << "Input string is too short");
34    CTimer::get("XIOS").suspend();
35  }
36
37  bool cxios_is_defined_grid_description(grid_Ptr grid_hdl)
38  {
39     CTimer::get("XIOS").resume();
40     bool isDefined = grid_hdl->description.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42     return isDefined;
43  }
44
45
46  void cxios_set_grid_mask_1d(grid_Ptr grid_hdl, bool* mask_1d, int* extent)
47  {
48    CTimer::get("XIOS").resume();
49    CArray<bool,1> tmp(mask_1d, shape(extent[0]), neverDeleteData);
50    grid_hdl->mask_1d.reference(tmp.copy());
51     CTimer::get("XIOS").suspend();
52  }
53
54  void cxios_get_grid_mask_1d(grid_Ptr grid_hdl, bool* mask_1d, int* extent)
55  {
56    CTimer::get("XIOS").resume();
57    CArray<bool,1> tmp(mask_1d, shape(extent[0]), neverDeleteData);
58    tmp=grid_hdl->mask_1d.getInheritedValue();
59     CTimer::get("XIOS").suspend();
60  }
61
62  bool cxios_is_defined_grid_mask_1d(grid_Ptr grid_hdl)
63  {
64     CTimer::get("XIOS").resume();
65     bool isDefined = grid_hdl->mask_1d.hasInheritedValue();
66     CTimer::get("XIOS").suspend();
67     return isDefined;
68  }
69
70
71  void cxios_set_grid_mask_2d(grid_Ptr grid_hdl, bool* mask_2d, int* extent)
72  {
73    CTimer::get("XIOS").resume();
74    CArray<bool,2> tmp(mask_2d, shape(extent[0], extent[1]), neverDeleteData);
75    grid_hdl->mask_2d.reference(tmp.copy());
76     CTimer::get("XIOS").suspend();
77  }
78
79  void cxios_get_grid_mask_2d(grid_Ptr grid_hdl, bool* mask_2d, int* extent)
80  {
81    CTimer::get("XIOS").resume();
82    CArray<bool,2> tmp(mask_2d, shape(extent[0], extent[1]), neverDeleteData);
83    tmp=grid_hdl->mask_2d.getInheritedValue();
84     CTimer::get("XIOS").suspend();
85  }
86
87  bool cxios_is_defined_grid_mask_2d(grid_Ptr grid_hdl)
88  {
89     CTimer::get("XIOS").resume();
90     bool isDefined = grid_hdl->mask_2d.hasInheritedValue();
91     CTimer::get("XIOS").suspend();
92     return isDefined;
93  }
94
95
96  void cxios_set_grid_mask_3d(grid_Ptr grid_hdl, bool* mask_3d, int* extent)
97  {
98    CTimer::get("XIOS").resume();
99    CArray<bool,3> tmp(mask_3d, shape(extent[0], extent[1], extent[2]), neverDeleteData);
100    grid_hdl->mask_3d.reference(tmp.copy());
101     CTimer::get("XIOS").suspend();
102  }
103
104  void cxios_get_grid_mask_3d(grid_Ptr grid_hdl, bool* mask_3d, int* extent)
105  {
106    CTimer::get("XIOS").resume();
107    CArray<bool,3> tmp(mask_3d, shape(extent[0], extent[1], extent[2]), neverDeleteData);
108    tmp=grid_hdl->mask_3d.getInheritedValue();
109     CTimer::get("XIOS").suspend();
110  }
111
112  bool cxios_is_defined_grid_mask_3d(grid_Ptr grid_hdl)
113  {
114     CTimer::get("XIOS").resume();
115     bool isDefined = grid_hdl->mask_3d.hasInheritedValue();
116     CTimer::get("XIOS").suspend();
117     return isDefined;
118  }
119
120
121  void cxios_set_grid_name(grid_Ptr grid_hdl, const char * name, int name_size)
122  {
123    std::string name_str;
124    if (!cstr2string(name, name_size, name_str)) return;
125    CTimer::get("XIOS").resume();
126    grid_hdl->name.setValue(name_str);
127    CTimer::get("XIOS").suspend();
128  }
129
130  void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size)
131  {
132    CTimer::get("XIOS").resume();
133    if (!string_copy(grid_hdl->name.getInheritedValue(), name, name_size))
134      ERROR("void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size)", << "Input string is too short");
135    CTimer::get("XIOS").suspend();
136  }
137
138  bool cxios_is_defined_grid_name(grid_Ptr grid_hdl)
139  {
140     CTimer::get("XIOS").resume();
141     bool isDefined = grid_hdl->name.hasInheritedValue();
142     CTimer::get("XIOS").suspend();
143     return isDefined;
144  }
145}
Note: See TracBrowser for help on using the repository browser.