New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
icaxis.cpp in vendors/XIOS/current/src/interface/c – NEMO

source: vendors/XIOS/current/src/interface/c/icaxis.cpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 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 "xmlioserver.hpp"
9
10#include "object_template_impl.hpp"
11#include "group_template_impl.hpp"
12#include "attribute_template_impl.hpp"
13
14#include "icutil.hpp"
15#include "timer.hpp"
16
17extern "C"
18{
19// /////////////////////////////// Définitions ////////////////////////////// //
20
21   // ----------------------- Redéfinition de types ----------------------------
22   
23   typedef xios::CAxis      * XAxisPtr;
24   typedef xios::CAxisGroup * XAxisGroupPtr;
25
26   // ------------------------ Création des handle -----------------------------
27   
28   void cxios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len)
29   {
30      std::string id; 
31      if (!cstr2string(_id, _id_len, id)) return;
32      CTimer::get("XIOS").resume() ;
33      *_ret = xios::CAxis::get(id);
34      CTimer::get("XIOS").suspend() ;
35   }
36   
37   void cxios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len)
38   {
39      std::string id; 
40      if (!cstr2string(_id, _id_len, id)) return;
41      CTimer::get("XIOS").resume() ;
42      *_ret = xios::CAxisGroup::get(id);
43      CTimer::get("XIOS").suspend() ;
44    }
45
46   // -------------------- Vérification des identifiants -----------------------
47
48   void cxios_axis_valid_id (bool * _ret, const char * _id, int _id_len)
49   {
50      std::string id;
51      if (!cstr2string(_id, _id_len, id)) return;
52
53      CTimer::get("XIOS").resume() ;
54      *_ret = xios::CAxis::has(id);
55      CTimer::get("XIOS").suspend() ;
56   }
57
58   void cxios_axisgroup_valid_id (bool * _ret, const char * _id, int _id_len)
59   {
60      std::string id;
61      if (!cstr2string(_id, _id_len, id)) return;
62
63      CTimer::get("XIOS").resume() ;
64      *_ret = xios::CAxisGroup::has(id);
65      CTimer::get("XIOS").suspend() ;
66
67   }
68   
69} // extern "C"
Note: See TracBrowser for help on using the repository browser.