New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
icdate.cpp in vendors/XIOS/current/src/interface/c – NEMO

source: vendors/XIOS/current/src/interface/c/icdate.cpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 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_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#include "timer.hpp"
18
19extern "C"
20{
21// /////////////////////////////// Définitions ////////////////////////////// //
22
23   void cxios_set_timestep(double ts_year, double ts_month,  double ts_day,
24                          double ts_hour, double ts_minute, double ts_second)
25   {
26      try
27      {
28         CTimer::get("XIOS").resume() ;
29         CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second};
30         xios::CContext* context = CContext::getCurrent() ;
31         
32            context->timestep.setValue(dur.toString());
33            context->sendAttributToServer("timestep") ;
34          CTimer::get("XIOS").suspend() ;
35      }
36      catch (xios::CException & exc)
37      {
38         std::cerr << exc.getMessage() << std::endl;
39         exit (EXIT_FAILURE);
40      }
41   }
42   
43   void cxios_update_calendar(int step)
44   {
45      CTimer::get("XIOS").resume() ;
46      xios::CContext* context = CContext::getCurrent() ;
47      context->updateCalendar(step) ;
48      context->sendUpdateCalendar(step) ;
49      CTimer::get("XIOS").suspend() ;
50     
51   }
52
53} // extern "C"
Note: See TracBrowser for help on using the repository browser.