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

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