source: XIOS3/trunk/src/interface/c/iczoom.cpp @ 2418

Last change on this file since 2418 was 2339, checked in by jderouillat, 23 months ago

Forced usage of extract_domain when zoom_domain is specified, added messages to inform users of required modifications.

File size: 3.4 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6
7#include <memory>
8
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"
17#include "extract_axis.hpp"
18#include "extract_domain.hpp"
19
20extern "C"
21{
22// /////////////////////////////// Définitions ////////////////////////////// //
23
24   // ----------------------- Redéfinition de types ----------------------------
25
26   typedef xios::CExtractAxis   * XExtractAxisPtr;
27   typedef xios::CExtractDomain * XExtractDomainPtr;
28   // ------------------------ Création des handle -----------------------------
29   void cxios_zoom_axis_handle_create (XExtractAxisPtr * _ret, const char * _id, int _id_len)
30   TRY
31   {
32      std::string id;
33      if (!cstr2string(_id, _id_len, id)) return;
34      cout << "WARNING : you are using the zoom_axis interface. zoom_domain is deprecated, replace it with extract_axis." << endl;
35      cout << "\t Calls to xios_set/get_zoom_axis_attr must be replaced with xios_set/get_extract_axis_attr in your model." << endl;
36      CTimer::get("XIOS").resume() ;
37      *_ret = xios::CExtractAxis::get(id);
38      CTimer::get("XIOS").suspend() ;
39   }
40   CATCH_DUMP_STACK
41
42   // -------------------- Vérification des identifiants -----------------------
43   void cxios_zoom_axis_valid_id (bool * _ret, const char * _id, int _id_len)
44   TRY
45   {
46      std::string id;
47      if (!cstr2string(_id, _id_len, id)) return;
48      cout << "WARNING : you are using the zoom_axis interface. zoom_domain is deprecated, replace it with extract_axis." << endl;
49      cout << "\t Calls to xios_set/get_zoom_axis_attr must be replaced with xios_set/get_extract_axis_attr in your model." << endl;
50
51      CTimer::get("XIOS").resume() ;
52      *_ret = xios::CExtractAxis::has(id);
53      CTimer::get("XIOS").suspend() ;
54   }
55   CATCH_DUMP_STACK
56
57   // ------------------------ Création des handle -----------------------------
58   void cxios_zoom_domain_handle_create(XExtractDomainPtr * _ret, const char * _id, int _id_len)
59   TRY
60   {
61      std::string id;
62      if (!cstr2string(_id, _id_len, id)) return;
63      cout << "WARNING : you are using the zoom_domain interface. zoom_domain is deprecated, replace it with extract_domain." << endl;
64      cout << "\t Calls to xios_set/get_zoom_domain_attr must be replaced with xios_set/get_extract_domain_attr in your model." << endl;
65      CTimer::get("XIOS").resume() ;
66      *_ret = xios::CExtractDomain::get(id);
67      CTimer::get("XIOS").suspend() ;
68   }
69   CATCH_DUMP_STACK
70
71   // -------------------- Vérification des identifiants -----------------------
72   void cxios_zoom_domain_valid_id(bool * _ret, const char * _id, int _id_len)
73   TRY
74   {
75      std::string id;
76      if (!cstr2string(_id, _id_len, id)) return;
77      cout << "WARNING : you are using the zoom_domain interface. zoom_domain is deprecated, replace it with extract_domain." << endl;
78      cout << "\t Calls to xios_set/get_zoom_domain_attr must be replaced with xios_set/get_extract_domain_attr in your model." << endl;
79      CTimer::get("XIOS").resume() ;
80      *_ret = xios::CExtractDomain::has(id);
81      CTimer::get("XIOS").suspend() ;
82   }
83   CATCH_DUMP_STACK
84} // extern "C"
Note: See TracBrowser for help on using the repository browser.