source: XIOS/trunk/src/interface/c/icinterpolate.cpp @ 786

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

Generating interface for transformations

+) Update Fortran interface for other transformations
+) Remove some redundant files
+) Update test to new interface

Test
+) On Curie
+) test_client and test_complete are correct

File size: 2.3 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <boost/shared_ptr.hpp>
7
8#include "xios.hpp"
9
10#include "object_template.hpp"
11#include "group_template.hpp"
12#include "attribute_template.hpp"
13
14#include "icutil.hpp"
15#include "timer.hpp"
16#include "interpolate_domain.hpp"
17#include "interpolate_axis.hpp"
18
19extern "C"
20{
21// /////////////////////////////// Définitions ////////////////////////////// //
22
23   // ----------------------- Redéfinition de types ----------------------------
24
25   typedef xios::CInterpolateDomain    * XInterpolateDomainPtr;
26   typedef xios::CInterpolateAxis      * XInterpolateAxisPtr;
27
28   // ------------------------ Création des handle -----------------------------
29   void cxios_interpolate_domain_handle_create(XInterpolateDomainPtr * _ret, const char * _id, int _id_len)
30   {
31      std::string id;
32      if (!cstr2string(_id, _id_len, id)) return;
33      CTimer::get("XIOS").resume() ;
34      *_ret = xios::CInterpolateDomain::get(id);
35      CTimer::get("XIOS").suspend() ;
36   }
37
38   // -------------------- Vérification des identifiants -----------------------
39   void cxios_interpolate_domain_valid_id(bool * _ret, const char * _id, int _id_len)
40   {
41      std::string id;
42      if (!cstr2string(_id, _id_len, id)) return;
43
44      CTimer::get("XIOS").resume() ;
45      *_ret = xios::CInterpolateDomain::has(id);
46      CTimer::get("XIOS").suspend() ;
47   }
48
49    // ------------------------ Création des handle -----------------------------
50   void cxios_interpolate_axis_handle_create(XInterpolateAxisPtr * _ret, const char * _id, int _id_len)
51   {
52      std::string id;
53      if (!cstr2string(_id, _id_len, id)) return;
54      CTimer::get("XIOS").resume() ;
55      *_ret = xios::CInterpolateAxis::get(id);
56      CTimer::get("XIOS").suspend() ;
57   }
58
59   // -------------------- Vérification des identifiants -----------------------
60   void cxios_interpolate_axis_valid_id(bool * _ret, const char * _id, int _id_len)
61   {
62      std::string id;
63      if (!cstr2string(_id, _id_len, id)) return;
64
65      CTimer::get("XIOS").resume() ;
66      *_ret = xios::CInterpolateAxis::has(id);
67      CTimer::get("XIOS").suspend() ;
68   }
69} // extern "C"
Note: See TracBrowser for help on using the repository browser.