source: XMLIO_V2/dev/dev_rv/src/xmlio/fortran/icdate.cpp @ 270

Last change on this file since 270 was 270, checked in by hozdoba, 13 years ago

Début nouvelle interface fortran

File size: 1.9 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, XMLIOServer, 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 "attribute_template_impl.hpp"
11#include "object_template_impl.hpp"
12#include "group_template_impl.hpp"
13
14#include "calendar_type.hpp"
15
16#include "icutil.hpp"
17
18extern "C"
19{
20// /////////////////////////////// Définitions ////////////////////////////// //
21
22   void xios_set_timestep(double ts_year, double ts_month,  double ts_day,
23                          double ts_hour, double ts_minute, double ts_second)
24   {
25      try
26      {
27         date::CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second};
28         boost::shared_ptr<xmlioserver::tree::CContext> context =
29         xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
30            (CObjectFactory::GetCurrentContextId());
31         boost::shared_ptr<xmlioserver::data::CDataTreatment> dtreat = context->getDataTreatment();
32         dtreat->set_timestep(dur);
33      }
34      catch (xmlioserver::CException & exc)
35      {
36         std::cerr << exc.getMessage() << std::endl;
37         exit (EXIT_FAILURE);
38      }
39   }
40   
41   void xios_update_calendar(int step)
42   {
43      try
44      {
45         boost::shared_ptr<xmlioserver::tree::CContext> context =
46         xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
47            (CObjectFactory::GetCurrentContextId());
48         boost::shared_ptr<xmlioserver::data::CDataTreatment> dtreat = context->getDataTreatment();
49         dtreat->update_calendar(step);
50      }
51      catch (xmlioserver::CException & exc)
52      {
53         std::cerr << exc.getMessage() << std::endl;
54         exit (EXIT_FAILURE);
55      }
56   }
57
58} // extern "C"
Note: See TracBrowser for help on using the repository browser.