Index: /XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.cpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.cpp	(revision 133)
+++ /XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.cpp	(revision 134)
@@ -5,5 +5,5 @@
 /* ********************************************************** */
 
-static inline std::string stringXtoStd(XString _str)
+static inline std::string stringXtoStd(const XString _str)
 {
    char * const temp = new char[_str.len+1]();
@@ -25,9 +25,16 @@
 }
 
+static inline Duration durationXtoXMLIO(const XDuration * const _xdur) // Non testÃ©e
+{
+   Duration __dur= { _xdur->year, _xdur->month , _xdur->day,
+                     _xdur->hour, _xdur->minute, _xdur->second };
+   return (__dur);
+}
+
 /* ********************************************************** */
 /*                      HANDLE INTERFACE                      */
 /* ********************************************************** */
 
-void xios_handle_create_(XHandle * _ret, const XDType * const _dtype, XString _id)
+void xios_handle_create_(XHandle * const _ret, const XDType * const _dtype, const XString _id)
 {
    // Si le handle n'est pas initialisÃ© Ã  0, on ne fait aucun traitement.
@@ -54,5 +61,5 @@
 /* ********************************************************** */
 
-void xios_xml_parse_file_(XString _filename)
+void xios_xml_parse_file_(const XString _filename)
 {
    std::string   __filename = stringXtoStd(_filename);
@@ -67,5 +74,5 @@
 }
 
-void xios_xml_parse_string_(XString _xmlcontent)
+void xios_xml_parse_string_(const XString _xmlcontent)
 {
    std::string        __xmlcontent = stringXtoStd(_xmlcontent);
@@ -94,5 +101,5 @@
 }
 
-void xios_dtreatment_new_(XHandle * _dt, const XHandle * const _hd)
+void xios_dtreatment_new_(XHandle * const _dt, const XHandle * const _hd)
 {
    static bool called = false;
@@ -100,13 +107,17 @@
    // Si le handle de traitement n'est pas initialisÃ© Ã  0, on ne fait aucun traitement.
    if (!isNullHandle(*_dt) || (_hd->data_type != ECONTEXT)) return;
-   Context* const __ctxt = (Context*) _hd->data_ptr;
+   Context       * const __ctxt = (Context*) _hd->data_ptr;
+   DataTreatment * const __dtrt =__ctxt->setDataTreatment<DataTreatment>();
 
-   _dt->data_type = DTREATMENT;
-   _dt->data_ptr  = new DataTreatment(__ctxt);
-
-   if (!called)
+   if (__dtrt != NULL)
    {
-      atexit (&deleteAllDataTreatment);
-      called = true;
+      AllDataTreatment.push_back(__dtrt);
+      _dt->data_type = DTREATMENT;
+      _dt->data_ptr  = __dtrt;
+      if (!called)
+      {
+         atexit (&deleteAllDataTreatment);
+         called = true;
+      }
    }
 }
@@ -116,5 +127,4 @@
    if (isNullHandle(*_hd) || (_hd->data_type != DTREATMENT)) return;
    DataTreatment * const __dt = (DataTreatment*)_hd->data_ptr;
-   AllDataTreatment.push_back (__dt);
    switch(*_ft)
    {
@@ -136,7 +146,41 @@
    bool __wswap = (_wswap == NULL) ? false : *_wswap;
    if (isNullHandle(*_ctxt) || (_ctxt->data_type != ECONTEXT)) return;
-
    Context* const __ctxt = (Context*) _ctxt->data_ptr;
    Context::SetCurrentContext(__ctxt->getId(), __wswap) ;
 }
 
+void xios_context_get_current_ (XHandle * _ctxt)
+{
+   // Si le handle de traitement n'est pas initialisÃ© Ã  0, on ne fait aucun traitement.
+   if ((Context::GetAllListObject().size() == 0) ||
+         !isNullHandle(*_ctxt)) return;
+   _ctxt->data_type = ECONTEXT;
+   _ctxt->data_ptr  = Context::GetCurrentContext();
+}
+
+void xios_context_get_calendar_(const XHandle * const _ctxt, XHandle * _cal)
+{
+   if (!isNullHandle(*_cal)  || isNullHandle(*_ctxt) ||
+      (_ctxt->data_type != ECONTEXT)) return;
+   Context* const __ctxt = (Context*) _ctxt->data_ptr;
+   AbstractCalendar * const __cal  = __ctxt->getCalendar();
+   if (__cal != NULL)
+   {
+      _cal->data_type = CALENDAR;
+      _cal->data_ptr  = __cal;
+   }
+}
+
+/* ********************************************************** */
+/*                      CALENDAR INTERFACE                    */
+/* ********************************************************** */
+
+void xios_calendar_set_timestep_(const XHandle * const _cal, const XDuration * const _dur)
+{
+   if (isNullHandle(*_cal) || (_cal->data_type != CALENDAR)) return;
+   const Duration __dur = durationXtoXMLIO(_dur);
+   AbstractCalendar * const __cal = (AbstractCalendar*) _cal->data_ptr;
+   __cal->setTimeStep(__dur);
+}
+
+#undef isNullHandle
Index: /XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.hpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.hpp	(revision 133)
+++ /XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.hpp	(revision 134)
@@ -13,6 +13,6 @@
 
    typedef long int XInt; // Integer
-   typedef bool XBool;    // Logical
-   typedef void *XPtr;    // Pointeur C non typÃ©
+   typedef bool     XBool;// Logical
+   typedef void    *XPtr; // Pointeur C non typÃ©
 
    typedef enum _datatype
@@ -35,49 +35,34 @@
    { char * str; int len;  } XString;
 
-   typedef struct _ymdhms // DurÃ©e et date.
-   { int year, month, day, hour, minute, second; } XDate, XDuration;
+   typedef struct _ymdhms_int
+   { int year, month, day, hour, minute, second; } XDate;
+
+    typedef struct _ymdhms_double
+   { double year, month, day, hour, minute, second; } XDuration;
 
    const XHandle NULLHANDLE = { NOTYPE, NULL };
 
-#define isNullHandle(hdl) ((hdl).data_type == NOTYPE && (hdl).data_ptr == NULL)
+#define isNullHandle(hdl) \
+   ((hdl).data_type == NOTYPE && (hdl).data_ptr == NULL)
 
    /* ******************** HANDLE INTERFACE ******************** */
-   void xios_handle_create_ (XHandle * _ret, const XDType * const _dtype, XString _id);
-
-   /*
-   void xios_handle_verify_ (XBool   * _ret, const XHandle * const _hd);
-   void xios_handle_getType_(XDType  * _ret, const XHandle * const _hd);
-
-   void xios_handle_isType_   (XBool * _ret, const XHandle * const _hd, const XDType  * const _dtype);
-   void xios_handle_isId_     (XBool * _ret, const XHandle * const _hd, const XString * const _id);
-   void xios_handle_isGroup_  (XBool * _ret, const XHandle * const _hd);
-   void xios_handle_isElement_(XBool * _ret, const XHandle * const _hd);
-   */
+   void xios_handle_create_ (XHandle * const _ret, const XDType * const _dtype, const XString _id);
 
    /* ******************** XML INTERFACE *********************** */
-   void xios_xml_parse_file_  (XString _filename);
-   void xios_xml_parse_string_(XString _xmlcontent);
+   void xios_xml_parse_file_  (const XString _filename);
+   void xios_xml_parse_string_(const XString _xmlcontent);
 
    /* ******************** DATA TREATMENT INTERFACE ************ */
-   void xios_dtreatment_new_(XHandle * _dt, const XHandle * const _hd);
+   void xios_dtreatment_new_(XHandle * const _dt, const XHandle * const _hd);
    void xios_dtreatment_create_files_and_headers_(const XHandle * const _hd, const XFileType * const _ft);
 
    /* ******************** CONTEXT INTERFACE ******************* */
-   void xios_context_set_current_(const XHandle * const _ctxt, const bool * const _wswap);
+   void xios_context_set_current_ (const XHandle * const _ctxt, const bool * const _wswap);
+   void xios_context_get_current_ (XHandle * _ctxt);
+   void xios_context_get_calendar_(const XHandle * const _ctxt, XHandle * _cal);
+   ///  void xios_context_ShowTree_  (void);
 
-
-   /*
-   void xios_context_GetCurrent_(XHandle * _ctxt);
-   void xios_context_ShowTree_  (void);
-
-   void xios_context_getCalendar_(const XHandle * const _ctxt, XHandle* _cal);
-   */
-
-   /* ******************** AXIS INTERFACE ********************** */
-   /* ******************** DOMAIN INTERFACE ******************** */
-   /* ******************** FIELD INTERFACE ********************* */
-   /* ******************** FILE INTERFACE ********************** */
-   /* ******************** GRID INTERFACE ********************** */
-   /* ******************** GROUP INTERFACE ********************* */
+   /* ******************** CALENDAR INTERFACE ****************** */
+   void xios_calendar_set_timestep_(const XHandle * const _cal, const XDuration * const _dur);
 
 #ifdef __cplusplus
Index: /XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp	(revision 133)
+++ /XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp	(revision 134)
@@ -5,4 +5,6 @@
 namespace XMLIOSERVER
 {
+   class DataTreatment;
+
    class Context : public ObjectTemplate<Context>
    {
@@ -10,23 +12,28 @@
 
          Context(void)
-            : ObjectTemplate<Context>(), ccalendar(NULL),
+            : ObjectTemplate<Context>(),
+              dtreatment(NULL), ccalendar(NULL),
               fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL), domainDef(NULL)
-         {/* Ne rien faire de plus */}
+         { /* Ne rien faire de plus */ }
 
          Context(const string& _id)
-            : ObjectTemplate<Context>(_id), ccalendar(NULL),
+            : ObjectTemplate<Context>(_id),
+              dtreatment(NULL), ccalendar(NULL),
               fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL), domainDef(NULL)
-         {/* Ne rien faire de plus */}
-
-         FieldDefinition  * getFieldDefinition (void) const { return (this->fieldDef ); }
-         FileDefinition   * getFileDefinition  (void) const { return (this->fileDef  ); }
-         AxisDefinition   * getAxisDefinition  (void) const { return (this->axisDef  ); }
-         GridDefinition   * getGridDefinition  (void) const { return (this->gridDef  ); }
+         { /* Ne rien faire de plus */ }
+
+          FieldDefinition * getFieldDefinition (void) const { return (this->fieldDef ); }
+           FileDefinition * getFileDefinition  (void) const { return (this->fileDef  ); }
+           AxisDefinition * getAxisDefinition  (void) const { return (this->axisDef  ); }
+           GridDefinition * getGridDefinition  (void) const { return (this->gridDef  ); }
          DomainDefinition * getDomainDefinition(void) const { return (this->domainDef); }
 
-         AbstractCalendar * getCalendar(void) const { return (this->ccalendar ); }
+         AbstractCalendar * getCalendar     (void) const { return (ccalendar ); }
+         DataTreatment    * getDataTreatment(void) const { return (dtreatment); }
 
          AbstractCalendar * setCalendar(const string& _calName, const string& _dateStr)
          {
+            if(ccalendar  !=  NULL) delete ccalendar;
+
             if (_calName.compare("D360")      == 0)
                return (ccalendar = new D360Calendar(_dateStr));
@@ -45,16 +52,21 @@
          }
 
-         ~Context(void)
+         template <class T>
+            DataTreatment * setDataTreatment(void)
+         { return (dtreatment = (ccalendar == NULL)? NULL : new T(this)); }
+
+      public : /* virtual */
+
+         virtual ~Context(void)
          {
             // DÃ©sallocation dynamique de mÃ©moire pour chacun des groupes de dÃ©finition si nÃ©cessaire.
-            if(fieldDef  != NULL) delete fieldDef  ; if(fileDef  != NULL) delete fileDef ;
-            if(axisDef   != NULL) delete axisDef   ; if(gridDef  != NULL) delete gridDef ;
+            if( fieldDef != NULL) delete  fieldDef ; if(fileDef  != NULL) delete fileDef ;
+            if(  axisDef != NULL) delete   axisDef ; if(gridDef  != NULL) delete gridDef ;
             if(domainDef != NULL) delete domainDef ;
 
             // DÃ©sallocation dynamique de mÃ©moire pour le calendrier associÃ© au contexte courant si nÃ©cessaire.
-            if(ccalendar !=  NULL) delete ccalendar;
-         }
-
-      public : /* virtual */
+            if(ccalendar  !=  NULL) delete ccalendar;
+            // INFO La mÃ©moire dÃ©diÃ©e Ã  dtreatment est dÃ©sallouÃ©e ailleurs.
+         }
 
          virtual void parse (XMLNode& _node)
@@ -117,8 +129,8 @@
          virtual void printChild(ostream& out) const
          {
-            if(fieldDef  != NULL) out << *(FieldGroup*)       fieldDef  << std::endl;
-            if(fileDef   != NULL) out << *(FileGroup*)        fileDef   << std::endl;
-            if(axisDef   != NULL) out << *(AxisDefinition*)   axisDef   << std::endl;
-            if(gridDef   != NULL) out << *(GridDefinition*)   gridDef   << std::endl;
+            if( fieldDef != NULL) out << *( FieldDefinition*)  fieldDef << std::endl;
+            if(  fileDef != NULL) out << *(  FileDefinition*)   fileDef << std::endl;
+            if(  axisDef != NULL) out << *(  AxisDefinition*)   axisDef << std::endl;
+            if(  gridDef != NULL) out << *(  GridDefinition*)   gridDef << std::endl;
             if(domainDef != NULL) out << *(DomainDefinition*) domainDef << std::endl;
          }
@@ -128,8 +140,8 @@
             if (_parent != 0) return;
             // RÃ©solution des hÃ©ritages descendants pour chacun des groupes de dÃ©finitions.
-            if(fieldDef  != NULL) fieldDef ->solveDescInheritance();
-            if(fileDef   != NULL) fileDef  ->solveDescInheritance();
-            if(axisDef   != NULL) axisDef  ->solveDescInheritance();
-            if(gridDef   != NULL) gridDef  ->solveDescInheritance();
+            if( fieldDef != NULL)  fieldDef->solveDescInheritance();
+            if(  fileDef != NULL)   fileDef->solveDescInheritance();
+            if(  axisDef != NULL)   axisDef->solveDescInheritance();
+            if(  gridDef != NULL)   gridDef->solveDescInheritance();
             if(domainDef != NULL) domainDef->solveDescInheritance();
          }
@@ -176,5 +188,6 @@
             Poco::HashMap<string, StrHashMap<Context> >::Iterator it;
 
-            for ( it = AllListContext.begin(); it != AllListContext.end(); it++)
+            for ( it  = AllListContext.begin();
+                  it != AllListContext.end(); it++)
             {
                // RÃ©solution des hÃ©ritages descendants (cÃ d des hÃ©ritages de groupes) pour chacun des contextes.
@@ -192,12 +205,15 @@
 
          static bool HasContext(const string& id)
-         {
-            Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject();
-            return (AllListContext.find(id) != AllListContext.end());
-         }
+         { return (Context::GetAllListObject().find(id) != Context::GetAllListObject().end()); }
 
          static Context* GetContext(const string& id)
          { return (Context::GetAllListObject()[id][id]); }
 
+         static const std::stack<string>& GetStackContextId(void)
+         { return (Context::Stid); }
+
+         static Context* GetCurrentContext(void)
+         { return (Context::GetObject(Context::GetCurrentContextId())); }
+
          static Context* SwapContext(void)
          {
@@ -210,10 +226,4 @@
             return (Context::GetObject(lastId));
          }
-
-         static const std::stack<string>& GetStackContextId(void)
-         { return (Context::Stid); }
-
-         static Context* GetCurrentContext(void)
-         { return (Context::GetObject(Context::GetCurrentContextId())); }
 
          static void SetCurrentContext(const string& id, bool withSwap = false, bool withcheck = true)
@@ -248,10 +258,11 @@
          static std::stack<string> Stid;
 
+         DataTreatment    * dtreatment;
          AbstractCalendar * ccalendar;
 
-         FieldDefinition  * fieldDef;
-         FileDefinition   * fileDef;
-         AxisDefinition   * axisDef;
-         GridDefinition   * gridDef;
+          FieldDefinition * fieldDef;
+           FileDefinition * fileDef;
+           AxisDefinition * axisDef;
+           GridDefinition * gridDef;
          DomainDefinition * domainDef;
 
Index: /XMLIO_V2/dev/dev_rv/src/XMLIO/data_treatment.hpp
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/XMLIO/data_treatment.hpp	(revision 133)
+++ /XMLIO_V2/dev/dev_rv/src/XMLIO/data_treatment.hpp	(revision 134)
@@ -8,6 +8,6 @@
       public :
 
-         DataTreatment(Context* const _ctxt       =  Context::GetCurrentContext(),
-                      const AbstractCalendar& cal = *Context::GetCurrentContext()->getCalendar())
+         DataTreatment(Context* const _ctxt =  Context::GetCurrentContext(),
+                const AbstractCalendar& cal = *Context::GetCurrentContext()->getCalendar())
             : enabledFiles(), currentContext(_ctxt)
          { this->doTreatment(cal); }
@@ -131,6 +131,8 @@
 
             // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence au niveau des fichiers.
-            const std::vector<CFile*>& allFiles = CFile::GetCurrentListObject().getVector();
-            for (unsigned int i = 0; i < allFiles.size(); i++) allFiles[i]->solveFieldRefInheritance();
+            const std::vector<CFile*>& allFiles =
+                              CFile::GetCurrentListObject().getVector();
+            for (unsigned int i = 0; i < allFiles.size(); i++)
+                  allFiles[i]->solveFieldRefInheritance();
          }
 
Index: /XMLIO_V2/dev/dev_rv/src/XMLIO/main.f90
===================================================================
--- /XMLIO_V2/dev/dev_rv/src/XMLIO/main.f90	(revision 133)
+++ /XMLIO_V2/dev/dev_rv/src/XMLIO/main.f90	(revision 134)
@@ -17,5 +17,5 @@
 
    TYPE XDuration
-      REAL(kind = 4) :: year, month, day, hour, minute, second
+      REAL(kind = 8) :: year, month, day, hour, minute, second
    END TYPE XDuration
 
@@ -71,11 +71,36 @@
       SUBROUTINE xios_context_set_current(context, withswap)
          USE XTYPE
-         TYPE(XHandle),     INTENT(IN)  :: context
-         LOGICAL, OPTIONAL, INTENT(IN)  :: withswap
+         TYPE(XHandle),     INTENT(IN) :: context
+         LOGICAL, OPTIONAL, INTENT(IN) :: withswap
       END SUBROUTINE xios_context_set_current
+
+      SUBROUTINE xios_context_get_current(context)
+         USE XTYPE
+         TYPE(XHandle), INTENT(IN) :: context
+      END SUBROUTINE xios_context_get_current
+
+      SUBROUTINE xios_context_get_calendar(context, calend)
+         USE XTYPE
+         TYPE(XHandle), INTENT(IN)  :: context
+         TYPE(XHandle), INTENT(OUT) :: calend
+      END SUBROUTINE xios_context_get_calendar
 
    END INTERFACE
 
 END MODULE ICONTEXT
+
+MODULE ICALENDAR
+   IMPLICIT NONE
+   INTERFACE
+
+      SUBROUTINE xios_calendar_set_timestep(calend, dur)
+         USE XTYPE
+         TYPE(XHandle)  , INTENT(IN) :: calend
+         TYPE(XDuration), INTENT(IN) :: dur
+      END SUBROUTINE xios_calendar_set_timestep
+
+   END INTERFACE
+
+END MODULE ICALENDAR
 
 MODULE IDATATREATMENT
@@ -104,12 +129,18 @@
    USE ICONTEXT
    USE IDATATREATMENT
+   USE ICALENDAR
 
    IMPLICIT NONE
 
-   TYPE(XHandle) :: context1 = NULLHANDLE
-   TYPE(XHandle) :: dtreat   = NULLHANDLE
+   INTEGER         :: compt
+   TYPE(XHandle)   :: context1    = NULLHANDLE
+   TYPE(XHandle)   :: dtreat      = NULLHANDLE
+   TYPE(XHandle)   :: calend      = NULLHANDLE
+   TYPE(XDuration) :: timestep_1h = XDuration(0., 0., 0., 1., 0., 0.)
 
    ! Parsing du document xml depuis un fichier situÃ© sur le disque.
    CALL xios_xml_Parse_File("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_simple_test.xml")
+
+   ! Le calendrier doit Ãªtre initialisÃ© ici s'il ne l'a pas dÃ©jÃ  Ã©tÃ© depuis le document xml.
 
    ! CrÃ©ation d'un handle sur le contexte dans lequel on souhaite travailler, cÃ d 'context1' ici.
@@ -134,3 +165,18 @@
    CALL xios_dtreatment_create_files_and_headers(dtreat, NETCDF4)
 
+   ! On rÃ©cupÃ©re le calendrier associÃ© au contexte en cours de traitement.
+   CALL xios_context_get_calendar(context1, calend)
+   iF ((calend%dtype == 0) .AND. (calend%daddr == 0)) THEN
+      PRINT *, "Impossible de rÃ©cupÃ©rer le calendrier !"
+      STOP
+   END IF
+
+   ! On change la durÃ©e du timestep.
+   CALL xios_calendar_set_timestep(calend, timestep_1h)
+
+   ! ExÃ©cution de la boucle de calcul-Ã©criture.
+   DO compt = 0, 9
+
+   END DO
+
 END PROGRAM MAIN
