source: XIOS/trunk/src/interface/c/icdate.cpp @ 501

Last change on this file since 501 was 501, checked in by ymipsl, 10 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:eol-style set to native
File size: 1.6 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 "attribute_template.hpp"
11#include "object_template.hpp"
12#include "group_template.hpp"
13
14#include "calendar_type.hpp"
15
16#include "icutil.hpp"
17#include "timer.hpp"
18#include "context.hpp"
19#include "context_client.hpp"
20
21extern "C"
22{
23// /////////////////////////////// Définitions ////////////////////////////// //
24
25   void cxios_set_timestep(double ts_year, double ts_month,  double ts_day,
26                          double ts_hour, double ts_minute, double ts_second)
27   {
28      try
29      {
30         CTimer::get("XIOS").resume() ;
31         CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second, 0};
32         xios::CContext* context = CContext::getCurrent() ;
33         
34            context->timestep.setValue(dur.toString());
35            context->sendAttributToServer("timestep") ;
36          CTimer::get("XIOS").suspend() ;
37      }
38      catch (xios::CException & exc)
39      {
40         std::cerr << exc.getMessage() << std::endl;
41         exit (EXIT_FAILURE);
42      }
43   }
44   
45   void cxios_update_calendar(int step)
46   {
47      CTimer::get("XIOS").resume() ;
48      xios::CContext* context = CContext::getCurrent() ;
49      if (!context->hasServer) context->client->checkBuffers() ;
50      context->updateCalendar(step) ;
51      context->sendUpdateCalendar(step) ;
52      CTimer::get("XIOS").suspend() ;
53     
54   }
55
56} // extern "C"
Note: See TracBrowser for help on using the repository browser.