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

Last change on this file since 532 was 532, checked in by rlacroix, 10 years ago

Add a new attribute type for dates and use it for the context's start_date and time_origin.

The "xios_date" type should now be used to get/set date attributes through the Fortran interface. This avoids using strings to manipulate dates.

  • 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.9 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 "xmlioserver.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_axis_ref(grid_Ptr grid_hdl, const char * axis_ref, int axis_ref_size)
21  {
22    std::string axis_ref_str;
23    if(!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
24     CTimer::get("XIOS").resume();
25    grid_hdl->axis_ref.setValue(axis_ref_str);
26     CTimer::get("XIOS").suspend();
27  }
28 
29  void cxios_get_grid_axis_ref(grid_Ptr grid_hdl, char * axis_ref, int axis_ref_size)
30  {
31     CTimer::get("XIOS").resume();
32    if(!string_copy(grid_hdl->axis_ref.getInheritedValue(),axis_ref , axis_ref_size))
33      ERROR("void cxios_get_grid_axis_ref(grid_Ptr grid_hdl, char * axis_ref, int axis_ref_size)", <<"Input string is to short");
34     CTimer::get("XIOS").suspend();
35  }
36 
37  bool cxios_is_defined_grid_axis_ref(grid_Ptr grid_hdl )
38  {
39     CTimer::get("XIOS").resume();
40    return grid_hdl->axis_ref.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42  }
43 
44 
45 
46  void cxios_set_grid_description(grid_Ptr grid_hdl, const char * description, int description_size)
47  {
48    std::string description_str;
49    if(!cstr2string(description, description_size, description_str)) return;
50     CTimer::get("XIOS").resume();
51    grid_hdl->description.setValue(description_str);
52     CTimer::get("XIOS").suspend();
53  }
54 
55  void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size)
56  {
57     CTimer::get("XIOS").resume();
58    if(!string_copy(grid_hdl->description.getInheritedValue(),description , description_size))
59      ERROR("void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size)", <<"Input string is to short");
60     CTimer::get("XIOS").suspend();
61  }
62 
63  bool cxios_is_defined_grid_description(grid_Ptr grid_hdl )
64  {
65     CTimer::get("XIOS").resume();
66    return grid_hdl->description.hasInheritedValue();
67     CTimer::get("XIOS").suspend();
68  }
69 
70 
71 
72  void cxios_set_grid_domain_ref(grid_Ptr grid_hdl, const char * domain_ref, int domain_ref_size)
73  {
74    std::string domain_ref_str;
75    if(!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return;
76     CTimer::get("XIOS").resume();
77    grid_hdl->domain_ref.setValue(domain_ref_str);
78     CTimer::get("XIOS").suspend();
79  }
80 
81  void cxios_get_grid_domain_ref(grid_Ptr grid_hdl, char * domain_ref, int domain_ref_size)
82  {
83     CTimer::get("XIOS").resume();
84    if(!string_copy(grid_hdl->domain_ref.getInheritedValue(),domain_ref , domain_ref_size))
85      ERROR("void cxios_get_grid_domain_ref(grid_Ptr grid_hdl, char * domain_ref, int domain_ref_size)", <<"Input string is to short");
86     CTimer::get("XIOS").suspend();
87  }
88 
89  bool cxios_is_defined_grid_domain_ref(grid_Ptr grid_hdl )
90  {
91     CTimer::get("XIOS").resume();
92    return grid_hdl->domain_ref.hasInheritedValue();
93     CTimer::get("XIOS").suspend();
94  }
95 
96 
97 
98  void cxios_set_grid_mask(grid_Ptr grid_hdl, bool* mask, int extent1, int extent2, int extent3)
99  {
100    CTimer::get("XIOS").resume();
101    CArray<bool,3> tmp(mask,shape(extent1,extent2,extent3),neverDeleteData) ;
102    grid_hdl->mask.reference(tmp.copy());
103     CTimer::get("XIOS").suspend();
104  }
105 
106  void cxios_get_grid_mask(grid_Ptr grid_hdl, bool* mask, int extent1, int extent2, int extent3)
107  {
108    CTimer::get("XIOS").resume();
109    CArray<bool,3> tmp(mask,shape(extent1,extent2,extent3),neverDeleteData) ;
110    tmp=grid_hdl->mask.getInheritedValue() ;
111     CTimer::get("XIOS").suspend();
112  }
113 
114  bool cxios_is_defined_grid_mask(grid_Ptr grid_hdl )
115  {
116     CTimer::get("XIOS").resume();
117    return grid_hdl->mask.hasInheritedValue();
118     CTimer::get("XIOS").suspend();
119  }
120 
121 
122 
123  void cxios_set_grid_name(grid_Ptr grid_hdl, const char * name, int name_size)
124  {
125    std::string name_str;
126    if(!cstr2string(name, name_size, name_str)) return;
127     CTimer::get("XIOS").resume();
128    grid_hdl->name.setValue(name_str);
129     CTimer::get("XIOS").suspend();
130  }
131 
132  void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size)
133  {
134     CTimer::get("XIOS").resume();
135    if(!string_copy(grid_hdl->name.getInheritedValue(),name , name_size))
136      ERROR("void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size)", <<"Input string is to short");
137     CTimer::get("XIOS").suspend();
138  }
139 
140  bool cxios_is_defined_grid_name(grid_Ptr grid_hdl )
141  {
142     CTimer::get("XIOS").resume();
143    return grid_hdl->name.hasInheritedValue();
144     CTimer::get("XIOS").suspend();
145  }
146 
147 
148 
149 
150}
Note: See TracBrowser for help on using the repository browser.