Index: /XIOS/trunk/src/attribute_template_decl.cpp
===================================================================
--- /XIOS/trunk/src/attribute_template_decl.cpp	(revision 536)
+++ /XIOS/trunk/src/attribute_template_decl.cpp	(revision 537)
@@ -11,3 +11,4 @@
   template class CAttributeTemplate<string> ;
   template class CAttributeTemplate<CDate> ;
+  template class CAttributeTemplate<CDuration> ;
 }
Index: /XIOS/trunk/src/config/context_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/context_attribute.conf	(revision 536)
+++ /XIOS/trunk/src/config/context_attribute.conf	(revision 537)
@@ -2,5 +2,5 @@
 DECLARE_ATTRIBUTE(CDate, start_date)
 DECLARE_ATTRIBUTE(CDate, time_origin)
-DECLARE_ATTRIBUTE(StdString, timestep)
+DECLARE_ATTRIBUTE(CDuration, timestep)
 DECLARE_ATTRIBUTE(StdString, output_dir)
 
Index: /XIOS/trunk/src/generate_interface_decl.cpp
===================================================================
--- /XIOS/trunk/src/generate_interface_decl.cpp	(revision 536)
+++ /XIOS/trunk/src/generate_interface_decl.cpp	(revision 537)
@@ -20,3 +20,4 @@
   macro(double)
   macro(CDate)
+  macro(CDuration)
 }
Index: /XIOS/trunk/src/generate_interface_impl.hpp
===================================================================
--- /XIOS/trunk/src/generate_interface_impl.hpp	(revision 536)
+++ /XIOS/trunk/src/generate_interface_impl.hpp	(revision 537)
@@ -17,4 +17,5 @@
   template<> string CInterface::getStrFortranType<float>(void) {return string("REAL") ;}
   template<> string CInterface::getStrFortranType<CDate>(void) {return string("TYPE(txios(date))") ;}
+  template<> string CInterface::getStrFortranType<CDuration>(void) {return string("TYPE(txios(duration))") ;}
 
   template<> string CInterface::getStrFortranKind<int>(void) {return string("") ;}
@@ -23,4 +24,5 @@
   template<> string CInterface::getStrFortranKind<float>(void) {return string("(KIND=4)") ;}
   template<> string CInterface::getStrFortranKind<CDate>(void) {return string("") ;}
+  template<> string CInterface::getStrFortranKind<CDuration>(void) {return string("") ;}
 
   template<> string CInterface::getStrFortranKindC<int>(void) {return string("(KIND=C_INT)") ;}
@@ -29,4 +31,5 @@
   template<> string CInterface::getStrFortranKindC<float>(void) {return string("(KIND=C_FLOAT)") ;}
   template<> string CInterface::getStrFortranKindC<CDate>(void) {return string("") ;}
+  template<> string CInterface::getStrFortranKindC<CDuration>(void) {return string("") ;}
 
   template<> bool CInterface::matchingTypeCFortran<int>(void) { return true ; }
@@ -35,4 +38,5 @@
   template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; }
   template<> bool CInterface::matchingTypeCFortran<CDate>(void) { return true; }
+  template<> bool CInterface::matchingTypeCFortran<CDuration>(void) { return true; }
 
 
@@ -167,4 +171,40 @@
   }
 
+  template<>
+  void CInterface::AttributeCInterface<CDuration>(ostream& oss, const string& className,const string& name)
+  {
+    oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, cxios_duration " << name << "_c)" << iendl;
+    oss << "{" << iendl;
+    oss << "  CTimer::get(\"XIOS\").resume();" << iendl;
+    oss << "  " << className << "_hdl->" << name << ".allocate();" << iendl;
+    oss << "  CDuration& " << name <<" = " << className << "_hdl->" << name << ".get();" << iendl;
+    oss << "  " << name << ".year = " << name << "_c.year;" << iendl;
+    oss << "  " << name << ".month = " << name << "_c.month;" << iendl;
+    oss << "  " << name << ".day = " << name << "_c.day;" << iendl;
+    oss << "  " << name << ".hour = " << name << "_c.hour;" << iendl;
+    oss << "  " << name << ".minute = " << name << "_c.minute;" << iendl;
+    oss << "  " << name << ".second = " << name << "_c.second;" << iendl;
+    oss << "  " << name << ".timestep = " << name << "_c.timestep;" << iendl;
+    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
+    oss << "}" << iendl;
+
+    oss << iendl;
+
+    oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, cxios_duration* " << name << "_c)" << iendl;
+    oss << "{" << iendl;
+    oss << "  CTimer::get(\"XIOS\").resume();" << iendl;
+    oss << "  CDuration " << name <<" = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl;
+    oss << "  " << name << "_c->year = " << name << ".year;" << iendl;
+    oss << "  " << name << "_c->month = " << name << ".month;" << iendl;
+    oss << "  " << name << "_c->day = " << name << ".day;" << iendl;
+    oss << "  " << name << "_c->hour = " << name << ".hour;" << iendl;
+    oss << "  " << name << "_c->minute = " << name << ".minute;" << iendl;
+    oss << "  " << name << "_c->second = " << name << ".second;" << iendl;
+    oss << "  " << name << "_c->timestep = " << name << ".timestep;" << iendl;
+    oss << "  CTimer::get(\"XIOS\").suspend();" << iendl;
+    oss << "}" << iendl;
+    oss << iendl;
+  }
+
 /*
 #define macro(T) \
@@ -305,5 +345,5 @@
     oss << "  USE IDATE" << iendl;
     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
-    oss << "  TYPE(xios_date), VALUE :: " << name << iendl;
+    oss << "  TYPE(txios(date)), VALUE :: " << name << iendl;
     oss << "END SUBROUTINE cxios_set_" << className << "_" << name << iendl;
     oss << iendl;
@@ -313,4 +353,23 @@
     oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
     oss << "  TYPE(txios(date)) :: " << name << iendl;
+    oss << "END SUBROUTINE cxios_get_" << className << "_" << name << iendl;
+    oss << iendl;
+  }
+
+  template <>
+  void CInterface::AttributeFortran2003Interface<CDuration>(ostream& oss, const string& className, const string& name)
+  {
+    oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  USE IDATE" << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "  TYPE(txios(duration)), VALUE :: " << name << iendl;
+    oss << "END SUBROUTINE cxios_set_" << className << "_" << name << iendl;
+    oss << iendl;
+    oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl;
+    oss << "  USE ISO_C_BINDING" << iendl;
+    oss << "  USE IDATE" << iendl;
+    oss << "  INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl;
+    oss << "  TYPE(txios(duration)) :: " << name << iendl;
     oss << "END SUBROUTINE cxios_get_" << className << "_" << name << iendl;
     oss << iendl;
Index: /XIOS/trunk/src/interface/c/icdate.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icdate.cpp	(revision 536)
+++ /XIOS/trunk/src/interface/c/icdate.cpp	(revision 537)
@@ -23,22 +23,4 @@
 // /////////////////////////////// DÃ©finitions ////////////////////////////// //
 
-   void cxios_set_timestep(double ts_year, double ts_month,  double ts_day,
-                          double ts_hour, double ts_minute, double ts_second)
-   {
-      try
-      {
-         CTimer::get("XIOS").resume() ;
-         CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second, 0};
-         xios::CContext* context = CContext::getCurrent() ;
-         context->timestep.setValue(dur.toString());
-         CTimer::get("XIOS").suspend() ;
-      }
-      catch (xios::CException & exc)
-      {
-         std::cerr << exc.getMessage() << std::endl;
-         exit (EXIT_FAILURE);
-      }
-   }
-
    void cxios_update_calendar(int step)
    {
Index: /XIOS/trunk/src/interface/c/icdate.hpp
===================================================================
--- /XIOS/trunk/src/interface/c/icdate.hpp	(revision 536)
+++ /XIOS/trunk/src/interface/c/icdate.hpp	(revision 537)
@@ -4,3 +4,4 @@
 
   typedef struct { int year, month, day, hour, minute, second; } cxios_date;
+  typedef struct { double year, month, day, hour, minute, second, timestep; } cxios_duration;
 } // extern "C"
Index: /XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp	(revision 536)
+++ /XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp	(revision 537)
@@ -146,19 +146,31 @@
   
   
-  void cxios_set_context_timestep(context_Ptr context_hdl, const char * timestep, int timestep_size)
+  void cxios_set_context_timestep(context_Ptr context_hdl, cxios_duration timestep_c)
   {
-    std::string timestep_str;
-    if(!cstr2string(timestep, timestep_size, timestep_str)) return;
-     CTimer::get("XIOS").resume();
-    context_hdl->timestep.setValue(timestep_str);
-     CTimer::get("XIOS").suspend();
+    CTimer::get("XIOS").resume();
+    context_hdl->timestep.allocate();
+    CDuration& timestep = context_hdl->timestep.get();
+    timestep.year = timestep_c.year;
+    timestep.month = timestep_c.month;
+    timestep.day = timestep_c.day;
+    timestep.hour = timestep_c.hour;
+    timestep.minute = timestep_c.minute;
+    timestep.second = timestep_c.second;
+    timestep.timestep = timestep_c.timestep;
+    CTimer::get("XIOS").suspend();
   }
   
-  void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)
+  void cxios_get_context_timestep(context_Ptr context_hdl, cxios_duration* timestep_c)
   {
-     CTimer::get("XIOS").resume();
-    if(!string_copy(context_hdl->timestep.getInheritedValue(),timestep , timestep_size))
-      ERROR("void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)", <<"Input string is to short");
-     CTimer::get("XIOS").suspend();
+    CTimer::get("XIOS").resume();
+    CDuration timestep = context_hdl->timestep.getInheritedValue();
+    timestep_c->year = timestep.year;
+    timestep_c->month = timestep.month;
+    timestep_c->day = timestep.day;
+    timestep_c->hour = timestep.hour;
+    timestep_c->minute = timestep.minute;
+    timestep_c->second = timestep.second;
+    timestep_c->timestep = timestep.timestep;
+    CTimer::get("XIOS").suspend();
   }
   
Index: /XIOS/trunk/src/interface/fortran/idate.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/idate.F90	(revision 536)
+++ /XIOS/trunk/src/interface/fortran/idate.F90	(revision 537)
@@ -10,15 +10,9 @@
    END TYPE txios(date)
 
-   TYPE txios(time)
-      REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0
-   END TYPE txios(time)   
+   TYPE, BIND(C) :: txios(duration)
+      REAL(kind = C_DOUBLE) :: year=0, month=0, day=0, hour=0, minute=0, second=0, timestep=0
+   END TYPE txios(duration)
 
    INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
-   
-      SUBROUTINE cxios_set_timestep(ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second) BIND(C)
-         IMPORT C_DOUBLE
-         REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month , ts_day   , &
-                                          ts_hour, ts_minute, ts_second
-      END SUBROUTINE cxios_set_timestep
 
       SUBROUTINE cxios_update_calendar(step) BIND(C)
@@ -26,21 +20,9 @@
          INTEGER (kind = C_INT), VALUE :: step
       END SUBROUTINE cxios_update_calendar
-      
+
    END INTERFACE
    
    CONTAINS ! Fonctions disponibles pour les utilisateurs.
 
-
-   SUBROUTINE xios(set_timestep)(timestep)
-      IMPLICIT NONE
-      TYPE(txios(time)), INTENT(IN):: timestep
-
-      CALL cxios_set_timestep(timestep%year, timestep%month , timestep%day, &
-                             timestep%hour, timestep%minute, timestep%second)
-
-   END SUBROUTINE xios(set_timestep)
-
-
-   
    SUBROUTINE xios(update_calendar)(step)
      IMPLICIT NONE
@@ -52,7 +34,5 @@
       END IF
       CALL cxios_update_calendar(step)
-      
    END SUBROUTINE xios(update_calendar)
 
-   
 END MODULE IDATE
Index: /XIOS/trunk/src/interface/fortran/ixios.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ixios.F90	(revision 536)
+++ /XIOS/trunk/src/interface/fortran/ixios.F90	(revision 537)
@@ -19,5 +19,5 @@
                   xios(setVar_logic), xios(setVar_char)
 
-USE idate, ONLY : txios(date),txios(time), xios(set_timestep),xios(update_calendar)
+USE idate, ONLY : txios(date), txios(duration), xios(update_calendar)
 
 USE idomain, ONLY : txios(domain), txios(domaingroup), xios(get_domain_handle),  &
@@ -158,5 +158,5 @@
  PUBLIC :: txios(domain), txios(domaingroup),txios(field), txios(fieldgroup),txios(file), txios(filegroup), &
           txios(grid), txios(gridgroup), txios(axis), txios(axisgroup),txios(context), txios(date),         &
-          txios(time), txios(variable)
+          txios(duration), txios(variable)
 
  PUBLIC :: xios(set_attr), xios(set_domain_attr), xios(set_domaingroup_attr), xios(set_fieldgroup_attr), &
@@ -184,5 +184,5 @@
 
  PUBLIC :: xios(set_current_context)
- PUBLIC :: xios(set_timestep),xios(update_calendar)
+ PUBLIC :: xios(update_calendar)
  PUBLIC :: xios(initialize), xios(init_server), xios(finalize), xios(context_initialize),xios(context_is_initialized), &
            xios(solve_inheritance), xios(close_context_definition), xios(context_finalize), xios(send_field),          &
Index: /XIOS/trunk/src/interface/fortran_attr/context_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/context_interface_attr.F90	(revision 536)
+++ /XIOS/trunk/src/interface/fortran_attr/context_interface_attr.F90	(revision 537)
@@ -56,5 +56,5 @@
       USE IDATE
       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
-      TYPE(xios_date), VALUE :: start_date
+      TYPE(txios(date)), VALUE :: start_date
     END SUBROUTINE cxios_set_context_start_date
     
@@ -77,5 +77,5 @@
       USE IDATE
       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
-      TYPE(xios_date), VALUE :: time_origin
+      TYPE(txios(date)), VALUE :: time_origin
     END SUBROUTINE cxios_set_context_time_origin
     
@@ -94,16 +94,16 @@
     
     
-    SUBROUTINE cxios_set_context_timestep(context_hdl, timestep, timestep_size) BIND(C)
+    SUBROUTINE cxios_set_context_timestep(context_hdl, timestep) BIND(C)
       USE ISO_C_BINDING
+      USE IDATE
       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: timestep
-      INTEGER  (kind = C_INT)     , VALUE        :: timestep_size
+      TYPE(txios(duration)), VALUE :: timestep
     END SUBROUTINE cxios_set_context_timestep
     
-    SUBROUTINE cxios_get_context_timestep(context_hdl, timestep, timestep_size) BIND(C)
+    SUBROUTINE cxios_get_context_timestep(context_hdl, timestep) BIND(C)
       USE ISO_C_BINDING
+      USE IDATE
       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
-      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: timestep
-      INTEGER  (kind = C_INT)     , VALUE        :: timestep_size
+      TYPE(txios(duration)) :: timestep
     END SUBROUTINE cxios_get_context_timestep
     
Index: /XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90	(revision 536)
+++ /XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90	(revision 537)
@@ -21,5 +21,5 @@
       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: start_date
       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: time_origin
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timestep
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: timestep
       
       CALL xios(get_context_handle)(context_id,context_hdl)
@@ -38,5 +38,5 @@
       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: start_date
       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: time_origin
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timestep
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: timestep
       
       CALL xios(set_context_attr_hdl_)  &
@@ -54,5 +54,5 @@
       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: start_date_
       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: time_origin_
-      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timestep_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: timestep_
       
       IF (PRESENT(calendar_type_)) THEN
@@ -73,5 +73,5 @@
       
       IF (PRESENT(timestep_)) THEN
-        CALL cxios_set_context_timestep(context_hdl%daddr, timestep_, len(timestep_))
+        CALL cxios_set_context_timestep(context_hdl%daddr, timestep_)
       ENDIF
       
@@ -90,5 +90,5 @@
       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: start_date
       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: time_origin
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timestep
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: timestep
       
       CALL xios(get_context_handle)(context_id,context_hdl)
@@ -107,5 +107,5 @@
       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: start_date
       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: time_origin
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timestep
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: timestep
       
       CALL xios(get_context_attr_hdl_)  &
@@ -123,5 +123,5 @@
       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: start_date_
       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: time_origin_
-      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timestep_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: timestep_
       
       IF (PRESENT(calendar_type_)) THEN
@@ -142,5 +142,5 @@
       
       IF (PRESENT(timestep_)) THEN
-        CALL cxios_get_context_timestep(context_hdl%daddr, timestep_, len(timestep_))
+        CALL cxios_get_context_timestep(context_hdl%daddr, timestep_)
       ENDIF
       
Index: /XIOS/trunk/src/node/context.cpp
===================================================================
--- /XIOS/trunk/src/node/context.cpp	(revision 536)
+++ /XIOS/trunk/src/node/context.cpp	(revision 537)
@@ -111,6 +111,6 @@
             "time_origin: Bad format or date not conform to the calendar");        \
                                                                                    \
-    this->calendar->setTimeStep                                                    \
-          (CDuration::FromString(this->timestep.getValue()));                      \
+    this->calendar->setTimeStep(this->timestep.getValue());                        \
+                                                                                   \
     return;                                                                        \
   }
Index: /XIOS/trunk/src/test/test_client.f90
===================================================================
--- /XIOS/trunk/src/test/test_client.f90	(revision 536)
+++ /XIOS/trunk/src/test/test_client.f90	(revision 537)
@@ -11,5 +11,5 @@
   CHARACTER(len=*),PARAMETER :: id="client"
   INTEGER :: comm
-  TYPE(xios_time)      :: dtime
+  TYPE(xios_duration) :: dtime
   TYPE(xios_context) :: ctx_hdl
   INTEGER,PARAMETER :: ni_glo=100
@@ -88,5 +88,5 @@
  
     dtime%second=3600
-    CALL xios_set_timestep(dtime) 
+    CALL xios_set_context_attr("test", timestep=dtime)
     
     ni=0 ; lonvalue(:)=0
Index: /XIOS/trunk/src/test/test_complete.f90
===================================================================
--- /XIOS/trunk/src/test/test_complete.f90	(revision 536)
+++ /XIOS/trunk/src/test/test_complete.f90	(revision 537)
@@ -12,5 +12,5 @@
   INTEGER :: comm
   TYPE(xios_date)      :: start_date, time_origin
-  TYPE(xios_time)      :: dtime
+  TYPE(xios_duration)  :: dtime
   TYPE(xios_context) :: ctx_hdl
   INTEGER,PARAMETER :: ni_glo=100
@@ -122,5 +122,5 @@
 
   dtime%second=3600
-  CALL xios_set_timestep(dtime) 
+  CALL xios_set_context_attr("atmosphere", timestep=dtime)
     
 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalitÃ©)
@@ -204,5 +204,5 @@
 
   dtime%second=1800
-  CALL xios_set_timestep(dtime) 
+  CALL xios_set_context_attr("surface", timestep=dtime)
     
 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalitÃ©)
Index: /XIOS/trunk/src/test/test_cs.f90
===================================================================
--- /XIOS/trunk/src/test/test_cs.f90	(revision 536)
+++ /XIOS/trunk/src/test/test_cs.f90	(revision 537)
@@ -30,5 +30,5 @@
   INTEGER :: size
   INTEGER :: comm
-  TYPE(xios_time)      :: dtime
+  TYPE(xios_duration) :: dtime
   TYPE(xios_context) :: ctx_hdl
   INTEGER,PARAMETER :: ni_glo=100 
@@ -126,5 +126,5 @@
  
     dtime%second=3600
-    CALL xios_set_timestep(dtime) 
+    CALL xios_set_context_attr("test", timestep=dtime)
     
 !    ni=0 ; lonvalue(:)=0
Index: /XIOS/trunk/src/test/test_unstruct_complete.f90
===================================================================
--- /XIOS/trunk/src/test/test_unstruct_complete.f90	(revision 536)
+++ /XIOS/trunk/src/test/test_unstruct_complete.f90	(revision 537)
@@ -11,5 +11,5 @@
   CHARACTER(len=*),PARAMETER :: id="client"
   INTEGER :: comm
-  TYPE(xios_time)      :: dtime
+  TYPE(xios_duration) :: dtime
   TYPE(xios_context) :: ctx_hdl
   INTEGER, PARAMETER :: nlon=60 
@@ -209,5 +209,5 @@
  
   dtime%second=3600
-  CALL xios_set_timestep(dtime) 
+  CALL xios_set_context_attr("surface", timestep=dtime)
   CALL xios_close_context_definition()
     
Index: /XIOS/trunk/src/test/test_xios_interface.f90
===================================================================
--- /XIOS/trunk/src/test/test_xios_interface.f90	(revision 536)
+++ /XIOS/trunk/src/test/test_xios_interface.f90	(revision 537)
@@ -13,5 +13,5 @@
   INTEGER :: comm
   TYPE(xios_date)      :: start_date, time_origin
-  TYPE(xios_time)      :: dtime
+  TYPE(xios_duration)  :: dtime
   TYPE(xios_context) :: ctx_hdl
   INTEGER,PARAMETER :: ni_glo=10
@@ -131,5 +131,5 @@
 
   dtime%second=3600
-  CALL xios_set_timestep(dtime)
+  CALL xios_set_context_attr("atmosphere", timestep=dtime)
 
 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalitÃ©)
@@ -213,5 +213,5 @@
 
   dtime%second=1800
-  CALL xios_set_timestep(dtime)
+  CALL xios_set_context_attr("surface", timestep=dtime)
 
 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalitÃ©)
Index: /XIOS/trunk/src/type/type_decl.cpp
===================================================================
--- /XIOS/trunk/src/type/type_decl.cpp	(revision 536)
+++ /XIOS/trunk/src/type/type_decl.cpp	(revision 537)
@@ -30,3 +30,4 @@
   macro(StdSize)
   macro(CDate)
+  macro(CDuration)
 }
Index: /XIOS/trunk/src/type/type_specialisation.hpp
===================================================================
--- /XIOS/trunk/src/type/type_specialisation.hpp	(revision 536)
+++ /XIOS/trunk/src/type/type_specialisation.hpp	(revision 537)
@@ -287,4 +287,103 @@
       ptrValue->setSecond(sec);
     }
+
+    return ret;
+  }
+
+// template specializations for CDuration
+
+  template <>
+  size_t CType<CDuration>::_size() const
+  {
+    return 7 * sizeof(double);
+  }
+
+  template <>
+  size_t CType_ref<CDuration>::_size() const
+  {
+    return 7 * sizeof(double);
+  }
+
+  template <>
+  bool CType<CDuration>::_toBuffer(CBufferOut& buffer) const
+  {
+    if (buffer.remain() < size()) return false;
+    else
+    {
+      bool ret = true;
+      if (ret) ret &= buffer.put(ptrValue->year);
+      if (ret) ret &= buffer.put(ptrValue->month);
+      if (ret) ret &= buffer.put(ptrValue->day);
+      if (ret) ret &= buffer.put(ptrValue->hour);
+      if (ret) ret &= buffer.put(ptrValue->minute);
+      if (ret) ret &= buffer.put(ptrValue->second);
+      if (ret) ret &= buffer.put(ptrValue->timestep);
+      return ret;
+    }
+  }
+  
+  template <>
+  bool CType_ref<CDuration>::_toBuffer(CBufferOut& buffer) const
+  {
+    if (buffer.remain() < size()) return false;
+    else
+    {
+      bool ret = true;
+      if (ret) ret &= buffer.put(ptrValue->year);
+      if (ret) ret &= buffer.put(ptrValue->month);
+      if (ret) ret &= buffer.put(ptrValue->day);
+      if (ret) ret &= buffer.put(ptrValue->hour);
+      if (ret) ret &= buffer.put(ptrValue->minute);
+      if (ret) ret &= buffer.put(ptrValue->second);
+      if (ret) ret &= buffer.put(ptrValue->timestep);
+      return ret;
+    }
+  }
+
+  template <>
+  bool CType<CDuration>::_fromBuffer(CBufferIn& buffer)
+  {
+    allocate();
+    bool ret = true;
+
+    if (ret) ret &= buffer.get(ptrValue->year);
+    if (ret) ret &= buffer.get(ptrValue->month);
+    if (ret) ret &= buffer.get(ptrValue->day);
+    if (ret) ret &= buffer.get(ptrValue->hour);
+    if (ret) ret &= buffer.get(ptrValue->minute);
+    if (ret) ret &= buffer.get(ptrValue->second);
+    if (ret) ret &= buffer.get(ptrValue->timestep);
+
+    return ret;
+  }
+
+  template <>
+  bool CType_ref<CDuration>::_fromBuffer(CBufferIn& buffer) const
+  {
+    bool ret = true;
+    
+    if (ret) ret &= buffer.get(ptrValue->year);
+    if (ret) ret &= buffer.get(ptrValue->month);
+    if (ret) ret &= buffer.get(ptrValue->day);
+    if (ret) ret &= buffer.get(ptrValue->hour);
+    if (ret) ret &= buffer.get(ptrValue->minute);
+    if (ret) ret &= buffer.get(ptrValue->second);
+    if (ret) ret &= buffer.get(ptrValue->timestep);
+
+    return ret;
+  }
+
+  template <>
+  bool CType_ref<CDuration>::_fromBuffer(CBufferIn& buffer)
+  {
+    bool ret = true;
+    
+    if (ret) ret &= buffer.get(ptrValue->year);
+    if (ret) ret &= buffer.get(ptrValue->month);
+    if (ret) ret &= buffer.get(ptrValue->day);
+    if (ret) ret &= buffer.get(ptrValue->hour);
+    if (ret) ret &= buffer.get(ptrValue->minute);
+    if (ret) ret &= buffer.get(ptrValue->second);
+    if (ret) ret &= buffer.get(ptrValue->timestep);
 
     return ret;
