source: XIOS/trunk/src/interface/c/icreduce_to_scalar.cpp @ 1542

Last change on this file since 1542 was 1542, checked in by oabramkina, 2 years ago

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
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
7#include "xios.hpp"
8
9#include "object_template.hpp"
10#include "group_template.hpp"
11#include "attribute_template.hpp"
12
13#include "icutil.hpp"
14#include "timer.hpp"
15#include "reduce_axis_to_scalar.hpp"
16#include "reduce_domain_to_scalar.hpp"
17
18extern "C"
19{
20// /////////////////////////////// Définitions ////////////////////////////// //
21
22   // ----------------------- Redéfinition de types ----------------------------
23
24   typedef xios::CReduceAxisToScalar      * XReduceAxisToScalarPtr;
25   typedef xios::CReduceDomainToScalar    * XReduceDomainToScalarPtr;
26
27   // ------------------------ Création des handle -----------------------------
28   void cxios_reduce_axis_to_scalar_handle_create(XReduceAxisToScalarPtr * _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::CReduceAxisToScalar::get(id);
34      CTimer::get("XIOS").suspend() ;
35   }
36
37   // -------------------- Vérification des identifiants -----------------------
38   void cxios_reduce_axis_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len)
39   {
40      std::string id;
41      if (!cstr2string(_id, _id_len, id)) return;
42
43      CTimer::get("XIOS").resume() ;
44      *_ret = xios::CReduceAxisToScalar::has(id);
45      CTimer::get("XIOS").suspend() ;
46   }
47
48   void cxios_reduce_domain_to_scalar_handle_create(XReduceDomainToScalarPtr * _ret, const char * _id, int _id_len)
49   {
50      std::string id;
51      if (!cstr2string(_id, _id_len, id)) return;
52      CTimer::get("XIOS").resume() ;
53      *_ret = xios::CReduceDomainToScalar::get(id);
54      CTimer::get("XIOS").suspend() ;
55   }
56
57   // -------------------- Vérification des identifiants -----------------------
58   void cxios_reduce_domain_to_scalar_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::CReduceDomainToScalar::has(id);
65      CTimer::get("XIOS").suspend() ;
66   }
67
68} // extern "C"
Note: See TracBrowser for help on using the repository browser.