source: XIOS/dev/dev_olga/src/interface/c/icreduce_to_axis.cpp @ 1612

Last change on this file since 1612 was 1612, checked in by oabramkina, 5 years ago

Dev: adding exception handling.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

File size: 1.6 KB
RevLine 
[891]1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6
[1542]7#include <memory>
8
[891]9#include "xios.hpp"
10
11#include "object_template.hpp"
12#include "group_template.hpp"
13#include "attribute_template.hpp"
14
15#include "icutil.hpp"
16#include "timer.hpp"
[981]17#include "reduce_domain_to_axis.hpp"
[891]18
19extern "C"
20{
21// /////////////////////////////// Définitions ////////////////////////////// //
22
23   // ----------------------- Redéfinition de types ----------------------------
24
[981]25   typedef xios::CReduceDomainToAxis      * XReduceDomainToAxisPtr;
26   
[891]27   // ------------------------ Création des handle -----------------------------
[981]28   void cxios_reduce_domain_to_axis_handle_create(XReduceDomainToAxisPtr * _ret, const char * _id, int _id_len)
[1612]29   TRY
[891]30   {
31      std::string id;
32      if (!cstr2string(_id, _id_len, id)) return;
33      CTimer::get("XIOS").resume() ;
[981]34      *_ret = xios::CReduceDomainToAxis::get(id);
[891]35      CTimer::get("XIOS").suspend() ;
36   }
[1612]37   CATCH_DUMP_STACK
[891]38
39   // -------------------- Vérification des identifiants -----------------------
[981]40   void cxios_reduce_domain_to_axis_valid_id(bool * _ret, const char * _id, int _id_len)
[1612]41   TRY
[891]42   {
43      std::string id;
44      if (!cstr2string(_id, _id_len, id)) return;
45
46      CTimer::get("XIOS").resume() ;
[981]47      *_ret = xios::CReduceDomainToAxis::has(id);
[891]48      CTimer::get("XIOS").suspend() ;
49   }
[1612]50   CATCH_DUMP_STACK
[981]51
[891]52} // extern "C"
Note: See TracBrowser for help on using the repository browser.