Index: XIOS/trunk/src/attribute_array_decl.cpp
===================================================================
--- XIOS/trunk/src/attribute_array_decl.cpp	(revision 448)
+++ XIOS/trunk/src/attribute_array_decl.cpp	(revision 449)
@@ -6,4 +6,5 @@
 {
   template class CAttributeArray<double,1> ;
+  template class CAttributeArray<double,2> ;
   template class CAttributeArray<int,1> ;
   template class CAttributeArray<bool,2> ;
Index: XIOS/trunk/src/config/domain_attribute.conf
===================================================================
--- XIOS/trunk/src/config/domain_attribute.conf	(revision 448)
+++ XIOS/trunk/src/config/domain_attribute.conf	(revision 449)
@@ -53,3 +53,8 @@
 DECLARE_ARRAY(double, 1, lonvalue)
 DECLARE_ARRAY(double, 1, latvalue)
+DECLARE_ATTRIBUTE(int, nvertex)
+DECLARE_ARRAY(double, 2, bounds_lon)
+DECLARE_ARRAY(double, 2, bounds_lat)
 
+DECLARE_ENUM3(type,regular,curvilinear,unstructured)
+
Index: XIOS/trunk/src/functor.hpp
===================================================================
--- XIOS/trunk/src/functor.hpp	(revision 448)
+++ XIOS/trunk/src/functor.hpp	(revision 449)
@@ -16,6 +16,6 @@
          /// DÃ©finition de type ///
          typedef CObject SuperClass;
-
          public :
+         enum ETimeType { once, instant, centered } ;
 
             /// Accesseurs ///
@@ -23,4 +23,5 @@
             /// OpÃ©rateur ///
             CArray<double,1> operator ()(const CArray<double,1>& dinput);
+            virtual ETimeType timeType(void) = 0 ;
 
             /// Destructeur ///
@@ -44,5 +45,4 @@
             CFunctor(const CFunctor & functor);         // Not implemented.
             CFunctor(const CFunctor * const functor);   // Not implemented.
-
          protected :
             /// PropriÃ©tÃ©s privÃ©es ///
Index: XIOS/trunk/src/functor/accumulate.hpp
===================================================================
--- XIOS/trunk/src/functor/accumulate.hpp	(revision 448)
+++ XIOS/trunk/src/functor/accumulate.hpp	(revision 449)
@@ -28,4 +28,5 @@
             virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
             virtual void final(void) ;
+            virtual ETimeType timeType(void) { return centered ; }
             
             /// Destructeur ///
Index: XIOS/trunk/src/functor/average.hpp
===================================================================
--- XIOS/trunk/src/functor/average.hpp	(revision 448)
+++ XIOS/trunk/src/functor/average.hpp	(revision 449)
@@ -28,5 +28,6 @@
             virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
             virtual void final(void) ;
-            
+            virtual ETimeType timeType(void) { return centered ; }
+
             /// Destructeur ///
             virtual ~CAverage(void);
Index: XIOS/trunk/src/functor/instant.hpp
===================================================================
--- XIOS/trunk/src/functor/instant.hpp	(revision 448)
+++ XIOS/trunk/src/functor/instant.hpp	(revision 449)
@@ -27,4 +27,5 @@
             /// Traitement ///
             virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
+            virtual ETimeType timeType(void) { return instant ; }
 
             /// Destructeur ///
Index: XIOS/trunk/src/functor/maximum.hpp
===================================================================
--- XIOS/trunk/src/functor/maximum.hpp	(revision 448)
+++ XIOS/trunk/src/functor/maximum.hpp	(revision 449)
@@ -27,4 +27,5 @@
             /// Traitement ///
             virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
+            virtual ETimeType timeType(void) { return centered ; }
 
             /// Destructeur ///
Index: XIOS/trunk/src/functor/minimum.hpp
===================================================================
--- XIOS/trunk/src/functor/minimum.hpp	(revision 448)
+++ XIOS/trunk/src/functor/minimum.hpp	(revision 449)
@@ -27,4 +27,5 @@
             /// Traitement ///
             virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
+            virtual ETimeType timeType(void) { return centered ; }
 
             /// Destructeur ///
Index: XIOS/trunk/src/functor/once.hpp
===================================================================
--- XIOS/trunk/src/functor/once.hpp	(revision 448)
+++ XIOS/trunk/src/functor/once.hpp	(revision 449)
@@ -26,4 +26,5 @@
             /// Traitement ///
             virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
+            virtual ETimeType timeType(void) { return once ; }
 
             /// Destructeur ///
Index: XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 448)
+++ XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 449)
@@ -17,4 +17,56 @@
   typedef xios::CDomain*  domain_Ptr;
   
+  void cxios_set_domain_bounds_lat(domain_Ptr domain_hdl, double* bounds_lat, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lat,shape(extent1,extent2),neverDeleteData) ;
+    domain_hdl->bounds_lat.reference(tmp.copy());
+    domain_hdl->sendAttributToServer(domain_hdl->bounds_lat);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domain_bounds_lat(domain_Ptr domain_hdl, double* bounds_lat, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lat,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domain_hdl->bounds_lat.getInheritedValue() ;
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_domain_bounds_lat(domain_Ptr domain_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domain_hdl->bounds_lat.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  void cxios_set_domain_bounds_lon(domain_Ptr domain_hdl, double* bounds_lon, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lon,shape(extent1,extent2),neverDeleteData) ;
+    domain_hdl->bounds_lon.reference(tmp.copy());
+    domain_hdl->sendAttributToServer(domain_hdl->bounds_lon);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domain_bounds_lon(domain_Ptr domain_hdl, double* bounds_lon, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lon,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domain_hdl->bounds_lon.getInheritedValue() ;
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_domain_bounds_lon(domain_Ptr domain_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domain_hdl->bounds_lon.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_domain_data_dim(domain_Ptr domain_hdl, int data_dim)
   {
@@ -536,4 +588,26 @@
   
   
+  void cxios_set_domain_nvertex(domain_Ptr domain_hdl, int nvertex)
+  {
+     CTimer::get("XIOS").resume();
+    domain_hdl->nvertex.setValue(nvertex);
+    domain_hdl->sendAttributToServer(domain_hdl->nvertex);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domain_nvertex(domain_Ptr domain_hdl, int* nvertex)
+  {
+    *nvertex = domain_hdl->nvertex.getInheritedValue();
+  }
+  
+  bool cxios_is_defined_domain_nvertex(domain_Ptr domain_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domain_hdl->nvertex.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_domain_standard_name(domain_Ptr domain_hdl, const char * standard_name, int standard_name_size)
   {
@@ -563,4 +637,31 @@
   
   
+  void cxios_set_domain_type(domain_Ptr domain_hdl, const char * type, int type_size)
+  {
+    std::string type_str;
+    if(!cstr2string(type, type_size, type_str)) return;
+     CTimer::get("XIOS").resume();
+    domain_hdl->type.fromString(type_str);
+    domain_hdl->sendAttributToServer(domain_hdl->type);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domain_type(domain_Ptr domain_hdl, char * type, int type_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(domain_hdl->type.getInheritedStringValue(),type , type_size))
+      ERROR("void cxios_get_domain_type(domain_Ptr domain_hdl, char * type, int type_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_domain_type(domain_Ptr domain_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domain_hdl->type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_domain_zoom_ibegin(domain_Ptr domain_hdl, int zoom_ibegin)
   {
Index: XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 448)
+++ XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 449)
@@ -17,4 +17,56 @@
   typedef xios::CDomainGroup*  domaingroup_Ptr;
   
+  void cxios_set_domaingroup_bounds_lat(domaingroup_Ptr domaingroup_hdl, double* bounds_lat, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lat,shape(extent1,extent2),neverDeleteData) ;
+    domaingroup_hdl->bounds_lat.reference(tmp.copy());
+    domaingroup_hdl->sendAttributToServer(domaingroup_hdl->bounds_lat);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domaingroup_bounds_lat(domaingroup_Ptr domaingroup_hdl, double* bounds_lat, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lat,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domaingroup_hdl->bounds_lat.getInheritedValue() ;
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_domaingroup_bounds_lat(domaingroup_Ptr domaingroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domaingroup_hdl->bounds_lat.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  void cxios_set_domaingroup_bounds_lon(domaingroup_Ptr domaingroup_hdl, double* bounds_lon, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lon,shape(extent1,extent2),neverDeleteData) ;
+    domaingroup_hdl->bounds_lon.reference(tmp.copy());
+    domaingroup_hdl->sendAttributToServer(domaingroup_hdl->bounds_lon);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domaingroup_bounds_lon(domaingroup_Ptr domaingroup_hdl, double* bounds_lon, int extent1, int extent2)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,2> tmp(bounds_lon,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domaingroup_hdl->bounds_lon.getInheritedValue() ;
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_domaingroup_bounds_lon(domaingroup_Ptr domaingroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domaingroup_hdl->bounds_lon.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_domaingroup_data_dim(domaingroup_Ptr domaingroup_hdl, int data_dim)
   {
@@ -563,4 +615,26 @@
   
   
+  void cxios_set_domaingroup_nvertex(domaingroup_Ptr domaingroup_hdl, int nvertex)
+  {
+     CTimer::get("XIOS").resume();
+    domaingroup_hdl->nvertex.setValue(nvertex);
+    domaingroup_hdl->sendAttributToServer(domaingroup_hdl->nvertex);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domaingroup_nvertex(domaingroup_Ptr domaingroup_hdl, int* nvertex)
+  {
+    *nvertex = domaingroup_hdl->nvertex.getInheritedValue();
+  }
+  
+  bool cxios_is_defined_domaingroup_nvertex(domaingroup_Ptr domaingroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domaingroup_hdl->nvertex.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_domaingroup_standard_name(domaingroup_Ptr domaingroup_hdl, const char * standard_name, int standard_name_size)
   {
@@ -590,4 +664,31 @@
   
   
+  void cxios_set_domaingroup_type(domaingroup_Ptr domaingroup_hdl, const char * type, int type_size)
+  {
+    std::string type_str;
+    if(!cstr2string(type, type_size, type_str)) return;
+     CTimer::get("XIOS").resume();
+    domaingroup_hdl->type.fromString(type_str);
+    domaingroup_hdl->sendAttributToServer(domaingroup_hdl->type);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_domaingroup_type(domaingroup_Ptr domaingroup_hdl, char * type, int type_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(domaingroup_hdl->type.getInheritedStringValue(),type , type_size))
+      ERROR("void cxios_get_domaingroup_type(domaingroup_Ptr domaingroup_hdl, char * type, int type_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_domaingroup_type(domaingroup_Ptr domaingroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return domaingroup_hdl->type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_domaingroup_zoom_ibegin(domaingroup_Ptr domaingroup_hdl, int zoom_ibegin)
   {
Index: XIOS/trunk/src/interface/fortran_attr/domain_interface_attr.f90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/domain_interface_attr.f90	(revision 448)
+++ XIOS/trunk/src/interface/fortran_attr/domain_interface_attr.f90	(revision 449)
@@ -9,4 +9,50 @@
     
     
+    SUBROUTINE cxios_set_domain_bounds_lat(domain_hdl, bounds_lat, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domain_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lat
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_set_domain_bounds_lat
+    
+    SUBROUTINE cxios_get_domain_bounds_lat(domain_hdl, bounds_lat, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domain_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lat
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_get_domain_bounds_lat
+    
+    FUNCTION cxios_is_defined_domain_bounds_lat(domain_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_bounds_lat
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_bounds_lat
+    
+    
+    SUBROUTINE cxios_set_domain_bounds_lon(domain_hdl, bounds_lon, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domain_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lon
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_set_domain_bounds_lon
+    
+    SUBROUTINE cxios_get_domain_bounds_lon(domain_hdl, bounds_lon, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domain_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lon
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_get_domain_bounds_lon
+    
+    FUNCTION cxios_is_defined_domain_bounds_lon(domain_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_bounds_lon
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_bounds_lon
+    
+    
     SUBROUTINE cxios_set_domain_data_dim(domain_hdl, data_dim) BIND(C)
       USE ISO_C_BINDING
@@ -445,4 +491,23 @@
     
     
+    SUBROUTINE cxios_set_domain_nvertex(domain_hdl, nvertex) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: nvertex
+    END SUBROUTINE cxios_set_domain_nvertex
+    
+    SUBROUTINE cxios_get_domain_nvertex(domain_hdl, nvertex) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      INTEGER (KIND=C_INT)             :: nvertex
+    END SUBROUTINE cxios_get_domain_nvertex
+    
+    FUNCTION cxios_is_defined_domain_nvertex(domain_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_nvertex
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_nvertex
+    
+    
     SUBROUTINE cxios_set_domain_standard_name(domain_hdl, standard_name, standard_name_size) BIND(C)
       USE ISO_C_BINDING
@@ -466,4 +531,25 @@
     
     
+    SUBROUTINE cxios_set_domain_type(domain_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_set_domain_type
+    
+    SUBROUTINE cxios_get_domain_type(domain_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_get_domain_type
+    
+    FUNCTION cxios_is_defined_domain_type(domain_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_type
+    
+    
     SUBROUTINE cxios_set_domain_zoom_ibegin(domain_hdl, zoom_ibegin) BIND(C)
       USE ISO_C_BINDING
Index: XIOS/trunk/src/interface/fortran_attr/domaingroup_interface_attr.f90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/domaingroup_interface_attr.f90	(revision 448)
+++ XIOS/trunk/src/interface/fortran_attr/domaingroup_interface_attr.f90	(revision 449)
@@ -9,4 +9,50 @@
     
     
+    SUBROUTINE cxios_set_domaingroup_bounds_lat(domaingroup_hdl, bounds_lat, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domaingroup_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lat
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_set_domaingroup_bounds_lat
+    
+    SUBROUTINE cxios_get_domaingroup_bounds_lat(domaingroup_hdl, bounds_lat, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domaingroup_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lat
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_get_domaingroup_bounds_lat
+    
+    FUNCTION cxios_is_defined_domaingroup_bounds_lat(domaingroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_bounds_lat
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_bounds_lat
+    
+    
+    SUBROUTINE cxios_set_domaingroup_bounds_lon(domaingroup_hdl, bounds_lon, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domaingroup_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lon
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_set_domaingroup_bounds_lon
+    
+    SUBROUTINE cxios_get_domaingroup_bounds_lon(domaingroup_hdl, bounds_lon, extent1, extent2) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: domaingroup_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds_lon
+      INTEGER (kind = C_INT), VALUE  :: extent1
+      INTEGER (kind = C_INT), VALUE  :: extent2
+    END SUBROUTINE cxios_get_domaingroup_bounds_lon
+    
+    FUNCTION cxios_is_defined_domaingroup_bounds_lon(domaingroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_bounds_lon
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_bounds_lon
+    
+    
     SUBROUTINE cxios_set_domaingroup_data_dim(domaingroup_hdl, data_dim) BIND(C)
       USE ISO_C_BINDING
@@ -466,4 +512,23 @@
     
     
+    SUBROUTINE cxios_set_domaingroup_nvertex(domaingroup_hdl, nvertex) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: nvertex
+    END SUBROUTINE cxios_set_domaingroup_nvertex
+    
+    SUBROUTINE cxios_get_domaingroup_nvertex(domaingroup_hdl, nvertex) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      INTEGER (KIND=C_INT)             :: nvertex
+    END SUBROUTINE cxios_get_domaingroup_nvertex
+    
+    FUNCTION cxios_is_defined_domaingroup_nvertex(domaingroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_nvertex
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_nvertex
+    
+    
     SUBROUTINE cxios_set_domaingroup_standard_name(domaingroup_hdl, standard_name, standard_name_size) BIND(C)
       USE ISO_C_BINDING
@@ -487,4 +552,25 @@
     
     
+    SUBROUTINE cxios_set_domaingroup_type(domaingroup_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_set_domaingroup_type
+    
+    SUBROUTINE cxios_get_domaingroup_type(domaingroup_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_get_domaingroup_type
+    
+    FUNCTION cxios_is_defined_domaingroup_type(domaingroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_type
+    
+    
     SUBROUTINE cxios_set_domaingroup_zoom_ibegin(domaingroup_hdl, zoom_ibegin) BIND(C)
       USE ISO_C_BINDING
Index: XIOS/trunk/src/interface/fortran_attr/idomain_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/idomain_attr.F90	(revision 448)
+++ XIOS/trunk/src/interface/fortran_attr/idomain_attr.F90	(revision 449)
@@ -12,12 +12,14 @@
   
   SUBROUTINE xios(set_domain_attr)  &
-    ( domain_id, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-    , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-    , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-    , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domain_id, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+    , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domain))  :: domain_hdl
       CHARACTER(LEN=*), INTENT(IN) ::domain_id
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -43,5 +45,7 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: nj
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
@@ -55,19 +59,21 @@
       CALL xios(get_domain_handle)(domain_id,domain_hdl)
       CALL xios(set_domain_attr_hdl_)   &
-      ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-      , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-      , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-      , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+      , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
   END SUBROUTINE xios(set_domain_attr)
   
   SUBROUTINE xios(set_domain_attr_hdl)  &
-    ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-    , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-    , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-    , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+    , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domain)) , INTENT(IN) :: domain_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -93,5 +99,7 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: nj
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
@@ -104,19 +112,22 @@
       
       CALL xios(set_domain_attr_hdl_)  &
-      ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-      , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-      , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-      , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+      , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
   END SUBROUTINE xios(set_domain_attr_hdl)
   
   SUBROUTINE xios(set_domain_attr_hdl_)   &
-    ( domain_hdl, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_n_index_  &
-    , data_ni_, data_nj_, domain_group_ref_, ibegin_, iend_, jbegin_, jend_, latvalue_, long_name_  &
-    , lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, standard_name_, zoom_ibegin_, zoom_ibegin_loc_  &
-    , zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
+    ( domain_hdl, bounds_lat_, bounds_lon_, data_dim_, data_i_index_, data_ibegin_, data_j_index_  &
+    , data_jbegin_, data_n_index_, data_ni_, data_nj_, domain_group_ref_, ibegin_, iend_, jbegin_  &
+    , jend_, latvalue_, long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_  &
+    , standard_name_, type_, zoom_ibegin_, zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_  &
+    , zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
     
     IMPLICIT NONE
       TYPE(txios(domain)) , INTENT(IN) :: domain_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_(:,:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index_(:)
@@ -142,5 +153,7 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
@@ -152,4 +165,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
       
+      IF (PRESENT(bounds_lat_)) THEN
+        CALL cxios_set_domain_bounds_lat(domain_hdl%daddr, bounds_lat_,size(bounds_lat_,1),size(bounds_lat_,2))
+      ENDIF
+      
+      IF (PRESENT(bounds_lon_)) THEN
+        CALL cxios_set_domain_bounds_lon(domain_hdl%daddr, bounds_lon_,size(bounds_lon_,1),size(bounds_lon_,2))
+      ENDIF
+      
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_set_domain_data_dim(domain_hdl%daddr, data_dim_)
@@ -242,6 +263,14 @@
       ENDIF
       
+      IF (PRESENT(nvertex_)) THEN
+        CALL cxios_set_domain_nvertex(domain_hdl%daddr, nvertex_)
+      ENDIF
+      
       IF (PRESENT(standard_name_)) THEN
         CALL cxios_set_domain_standard_name(domain_hdl%daddr, standard_name_, len(standard_name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_set_domain_type(domain_hdl%daddr, type_, len(type_))
       ENDIF
       
@@ -283,12 +312,14 @@
   
   SUBROUTINE xios(get_domain_attr)  &
-    ( domain_id, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-    , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-    , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-    , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domain_id, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+    , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domain))  :: domain_hdl
       CHARACTER(LEN=*), INTENT(IN) ::domain_id
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -314,5 +345,7 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_loc
@@ -326,19 +359,21 @@
       CALL xios(get_domain_handle)(domain_id,domain_hdl)
       CALL xios(get_domain_attr_hdl_)   &
-      ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-      , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-      , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-      , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+      , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
   END SUBROUTINE xios(get_domain_attr)
   
   SUBROUTINE xios(get_domain_attr_hdl)  &
-    ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-    , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-    , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-    , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+    , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domain)) , INTENT(IN) :: domain_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -364,5 +399,7 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_loc
@@ -375,19 +412,22 @@
       
       CALL xios(get_domain_attr_hdl_)  &
-      ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-      , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-      , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-      , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+      , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
   END SUBROUTINE xios(get_domain_attr_hdl)
   
   SUBROUTINE xios(get_domain_attr_hdl_)   &
-    ( domain_hdl, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_n_index_  &
-    , data_ni_, data_nj_, domain_group_ref_, ibegin_, iend_, jbegin_, jend_, latvalue_, long_name_  &
-    , lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, standard_name_, zoom_ibegin_, zoom_ibegin_loc_  &
-    , zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
+    ( domain_hdl, bounds_lat_, bounds_lon_, data_dim_, data_i_index_, data_ibegin_, data_j_index_  &
+    , data_jbegin_, data_n_index_, data_ni_, data_nj_, domain_group_ref_, ibegin_, iend_, jbegin_  &
+    , jend_, latvalue_, long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_  &
+    , standard_name_, type_, zoom_ibegin_, zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_  &
+    , zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
     
     IMPLICIT NONE
       TYPE(txios(domain)) , INTENT(IN) :: domain_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_(:,:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index_(:)
@@ -413,5 +453,7 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo_
+      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_loc_
@@ -423,4 +465,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_nj_loc_
       
+      IF (PRESENT(bounds_lat_)) THEN
+        CALL cxios_get_domain_bounds_lat(domain_hdl%daddr, bounds_lat_,size(bounds_lat_,1),size(bounds_lat_,2))
+      ENDIF
+      
+      IF (PRESENT(bounds_lon_)) THEN
+        CALL cxios_get_domain_bounds_lon(domain_hdl%daddr, bounds_lon_,size(bounds_lon_,1),size(bounds_lon_,2))
+      ENDIF
+      
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_get_domain_data_dim(domain_hdl%daddr, data_dim_)
@@ -513,6 +563,14 @@
       ENDIF
       
+      IF (PRESENT(nvertex_)) THEN
+        CALL cxios_get_domain_nvertex(domain_hdl%daddr, nvertex_)
+      ENDIF
+      
       IF (PRESENT(standard_name_)) THEN
         CALL cxios_get_domain_standard_name(domain_hdl%daddr, standard_name_, len(standard_name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_get_domain_type(domain_hdl%daddr, type_, len(type_))
       ENDIF
       
@@ -554,12 +612,16 @@
   
   SUBROUTINE xios(is_defined_domain_attr)  &
-    ( domain_id, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-    , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-    , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-    , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domain_id, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+    , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domain))  :: domain_hdl
       CHARACTER(LEN=*), INTENT(IN) ::domain_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -606,6 +668,10 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: nj_glo
       LOGICAL(KIND=C_BOOL) :: nj_glo_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex
+      LOGICAL(KIND=C_BOOL) :: nvertex_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name
       LOGICAL(KIND=C_BOOL) :: standard_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: zoom_ibegin
       LOGICAL(KIND=C_BOOL) :: zoom_ibegin_tmp
@@ -627,19 +693,23 @@
       CALL xios(get_domain_handle)(domain_id,domain_hdl)
       CALL xios(is_defined_domain_attr_hdl_)   &
-      ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-      , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-      , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-      , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+      , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
   END SUBROUTINE xios(is_defined_domain_attr)
   
   SUBROUTINE xios(is_defined_domain_attr_hdl)  &
-    ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-    , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-    , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-    , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+    , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domain)) , INTENT(IN) :: domain_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -686,6 +756,10 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: nj_glo
       LOGICAL(KIND=C_BOOL) :: nj_glo_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex
+      LOGICAL(KIND=C_BOOL) :: nvertex_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name
       LOGICAL(KIND=C_BOOL) :: standard_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: zoom_ibegin
       LOGICAL(KIND=C_BOOL) :: zoom_ibegin_tmp
@@ -706,19 +780,24 @@
       
       CALL xios(is_defined_domain_attr_hdl_)  &
-      ( domain_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index, data_ni  &
-      , data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name, lonvalue, mask  &
-      , name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc  &
-      , zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domain_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin  &
+      , data_n_index, data_ni, data_nj, domain_group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
+      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type, zoom_ibegin, zoom_ibegin_loc  &
+      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
     
   END SUBROUTINE xios(is_defined_domain_attr_hdl)
   
   SUBROUTINE xios(is_defined_domain_attr_hdl_)   &
-    ( domain_hdl, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_n_index_  &
-    , data_ni_, data_nj_, domain_group_ref_, ibegin_, iend_, jbegin_, jend_, latvalue_, long_name_  &
-    , lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, standard_name_, zoom_ibegin_, zoom_ibegin_loc_  &
-    , zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
+    ( domain_hdl, bounds_lat_, bounds_lon_, data_dim_, data_i_index_, data_ibegin_, data_j_index_  &
+    , data_jbegin_, data_n_index_, data_ni_, data_nj_, domain_group_ref_, ibegin_, iend_, jbegin_  &
+    , jend_, latvalue_, long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_  &
+    , standard_name_, type_, zoom_ibegin_, zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_  &
+    , zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
     
     IMPLICIT NONE
       TYPE(txios(domain)) , INTENT(IN) :: domain_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_
+      LOGICAL(KIND=C_BOOL) :: bounds_lat__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_
+      LOGICAL(KIND=C_BOOL) :: bounds_lon__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim_
       LOGICAL(KIND=C_BOOL) :: data_dim__tmp
@@ -765,6 +844,10 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: nj_glo_
       LOGICAL(KIND=C_BOOL) :: nj_glo__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex_
+      LOGICAL(KIND=C_BOOL) :: nvertex__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_
       LOGICAL(KIND=C_BOOL) :: standard_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type_
+      LOGICAL(KIND=C_BOOL) :: type__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: zoom_ibegin_
       LOGICAL(KIND=C_BOOL) :: zoom_ibegin__tmp
@@ -784,4 +867,14 @@
       LOGICAL(KIND=C_BOOL) :: zoom_nj_loc__tmp
       
+      IF (PRESENT(bounds_lat_)) THEN
+        bounds_lat__tmp=cxios_is_defined_domain_bounds_lat(domain_hdl%daddr)
+        bounds_lat_=bounds_lat__tmp
+      ENDIF
+      
+      IF (PRESENT(bounds_lon_)) THEN
+        bounds_lon__tmp=cxios_is_defined_domain_bounds_lon(domain_hdl%daddr)
+        bounds_lon_=bounds_lon__tmp
+      ENDIF
+      
       IF (PRESENT(data_dim_)) THEN
         data_dim__tmp=cxios_is_defined_domain_data_dim(domain_hdl%daddr)
@@ -894,4 +987,9 @@
       ENDIF
       
+      IF (PRESENT(nvertex_)) THEN
+        nvertex__tmp=cxios_is_defined_domain_nvertex(domain_hdl%daddr)
+        nvertex_=nvertex__tmp
+      ENDIF
+      
       IF (PRESENT(standard_name_)) THEN
         standard_name__tmp=cxios_is_defined_domain_standard_name(domain_hdl%daddr)
@@ -899,4 +997,9 @@
       ENDIF
       
+      IF (PRESENT(type_)) THEN
+        type__tmp=cxios_is_defined_domain_type(domain_hdl%daddr)
+        type_=type__tmp
+      ENDIF
+      
       IF (PRESENT(zoom_ibegin_)) THEN
         zoom_ibegin__tmp=cxios_is_defined_domain_zoom_ibegin(domain_hdl%daddr)
Index: XIOS/trunk/src/interface/fortran_attr/idomaingroup_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/idomaingroup_attr.F90	(revision 448)
+++ XIOS/trunk/src/interface/fortran_attr/idomaingroup_attr.F90	(revision 449)
@@ -12,12 +12,15 @@
   
   SUBROUTINE xios(set_domaingroup_attr)  &
-    ( domaingroup_id, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-    , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domaingroup_id, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+    , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+    , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+    , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+    , zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup))  :: domaingroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::domaingroup_id
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -44,5 +47,7 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: nj
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
@@ -56,19 +61,23 @@
       CALL xios(get_domaingroup_handle)(domaingroup_id,domaingroup_hdl)
       CALL xios(set_domaingroup_attr_hdl_)   &
-      ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-      , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+      , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+      , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+      , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+      , zoom_nj_loc )
     
   END SUBROUTINE xios(set_domaingroup_attr)
   
   SUBROUTINE xios(set_domaingroup_attr_hdl)  &
-    ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-    , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+    , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+    , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+    , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+    , zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup)) , INTENT(IN) :: domaingroup_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -95,5 +104,7 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: nj
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
@@ -106,20 +117,23 @@
       
       CALL xios(set_domaingroup_attr_hdl_)  &
-      ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-      , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+      , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+      , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+      , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+      , zoom_nj_loc )
     
   END SUBROUTINE xios(set_domaingroup_attr_hdl)
   
   SUBROUTINE xios(set_domaingroup_attr_hdl_)   &
-    ( domaingroup_hdl, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_n_index_  &
-    , data_ni_, data_nj_, domain_group_ref_, group_ref_, ibegin_, iend_, jbegin_, jend_, latvalue_  &
-    , long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, standard_name_, zoom_ibegin_  &
-    , zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_  &
-     )
+    ( domaingroup_hdl, bounds_lat_, bounds_lon_, data_dim_, data_i_index_, data_ibegin_, data_j_index_  &
+    , data_jbegin_, data_n_index_, data_ni_, data_nj_, domain_group_ref_, group_ref_, ibegin_, iend_  &
+    , jbegin_, jend_, latvalue_, long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_  &
+    , nvertex_, standard_name_, type_, zoom_ibegin_, zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_  &
+    , zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup)) , INTENT(IN) :: domaingroup_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_(:,:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index_(:)
@@ -146,5 +160,7 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_
       INTEGER  , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER  , OPTIONAL, INTENT(IN) :: nvertex_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
@@ -156,4 +172,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
       
+      IF (PRESENT(bounds_lat_)) THEN
+        CALL cxios_set_domaingroup_bounds_lat(domaingroup_hdl%daddr, bounds_lat_,size(bounds_lat_,1),size(bounds_lat_,2))
+      ENDIF
+      
+      IF (PRESENT(bounds_lon_)) THEN
+        CALL cxios_set_domaingroup_bounds_lon(domaingroup_hdl%daddr, bounds_lon_,size(bounds_lon_,1),size(bounds_lon_,2))
+      ENDIF
+      
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_set_domaingroup_data_dim(domaingroup_hdl%daddr, data_dim_)
@@ -250,6 +274,14 @@
       ENDIF
       
+      IF (PRESENT(nvertex_)) THEN
+        CALL cxios_set_domaingroup_nvertex(domaingroup_hdl%daddr, nvertex_)
+      ENDIF
+      
       IF (PRESENT(standard_name_)) THEN
         CALL cxios_set_domaingroup_standard_name(domaingroup_hdl%daddr, standard_name_, len(standard_name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_set_domaingroup_type(domaingroup_hdl%daddr, type_, len(type_))
       ENDIF
       
@@ -291,12 +323,15 @@
   
   SUBROUTINE xios(get_domaingroup_attr)  &
-    ( domaingroup_id, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-    , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domaingroup_id, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+    , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+    , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+    , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+    , zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup))  :: domaingroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::domaingroup_id
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -323,5 +358,7 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_loc
@@ -335,19 +372,23 @@
       CALL xios(get_domaingroup_handle)(domaingroup_id,domaingroup_hdl)
       CALL xios(get_domaingroup_attr_hdl_)   &
-      ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-      , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+      , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+      , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+      , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+      , zoom_nj_loc )
     
   END SUBROUTINE xios(get_domaingroup_attr)
   
   SUBROUTINE xios(get_domaingroup_attr_hdl)  &
-    ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-    , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+    , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+    , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+    , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+    , zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup)) , INTENT(IN) :: domaingroup_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon(:,:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -374,5 +415,7 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo
+      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_loc
@@ -385,20 +428,23 @@
       
       CALL xios(get_domaingroup_attr_hdl_)  &
-      ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-      , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+      , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+      , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+      , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+      , zoom_nj_loc )
     
   END SUBROUTINE xios(get_domaingroup_attr_hdl)
   
   SUBROUTINE xios(get_domaingroup_attr_hdl_)   &
-    ( domaingroup_hdl, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_n_index_  &
-    , data_ni_, data_nj_, domain_group_ref_, group_ref_, ibegin_, iend_, jbegin_, jend_, latvalue_  &
-    , long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, standard_name_, zoom_ibegin_  &
-    , zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_  &
-     )
+    ( domaingroup_hdl, bounds_lat_, bounds_lon_, data_dim_, data_i_index_, data_ibegin_, data_j_index_  &
+    , data_jbegin_, data_n_index_, data_ni_, data_nj_, domain_group_ref_, group_ref_, ibegin_, iend_  &
+    , jbegin_, jend_, latvalue_, long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_  &
+    , nvertex_, standard_name_, type_, zoom_ibegin_, zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_  &
+    , zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup)) , INTENT(IN) :: domaingroup_hdl
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_(:,:)
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_(:,:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index_(:)
@@ -425,5 +471,7 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_
       INTEGER  , OPTIONAL, INTENT(OUT) :: nj_glo_
+      INTEGER  , OPTIONAL, INTENT(OUT) :: nvertex_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_ibegin_loc_
@@ -435,4 +483,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_nj_loc_
       
+      IF (PRESENT(bounds_lat_)) THEN
+        CALL cxios_get_domaingroup_bounds_lat(domaingroup_hdl%daddr, bounds_lat_,size(bounds_lat_,1),size(bounds_lat_,2))
+      ENDIF
+      
+      IF (PRESENT(bounds_lon_)) THEN
+        CALL cxios_get_domaingroup_bounds_lon(domaingroup_hdl%daddr, bounds_lon_,size(bounds_lon_,1),size(bounds_lon_,2))
+      ENDIF
+      
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_get_domaingroup_data_dim(domaingroup_hdl%daddr, data_dim_)
@@ -529,6 +585,14 @@
       ENDIF
       
+      IF (PRESENT(nvertex_)) THEN
+        CALL cxios_get_domaingroup_nvertex(domaingroup_hdl%daddr, nvertex_)
+      ENDIF
+      
       IF (PRESENT(standard_name_)) THEN
         CALL cxios_get_domaingroup_standard_name(domaingroup_hdl%daddr, standard_name_, len(standard_name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_get_domaingroup_type(domaingroup_hdl%daddr, type_, len(type_))
       ENDIF
       
@@ -570,12 +634,17 @@
   
   SUBROUTINE xios(is_defined_domaingroup_attr)  &
-    ( domaingroup_id, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-    , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domaingroup_id, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+    , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+    , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+    , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+    , zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup))  :: domaingroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::domaingroup_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -624,6 +693,10 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: nj_glo
       LOGICAL(KIND=C_BOOL) :: nj_glo_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex
+      LOGICAL(KIND=C_BOOL) :: nvertex_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name
       LOGICAL(KIND=C_BOOL) :: standard_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: zoom_ibegin
       LOGICAL(KIND=C_BOOL) :: zoom_ibegin_tmp
@@ -645,19 +718,25 @@
       CALL xios(get_domaingroup_handle)(domaingroup_id,domaingroup_hdl)
       CALL xios(is_defined_domaingroup_attr_hdl_)   &
-      ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-      , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+      , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+      , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+      , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+      , zoom_nj_loc )
     
   END SUBROUTINE xios(is_defined_domaingroup_attr)
   
   SUBROUTINE xios(is_defined_domaingroup_attr_hdl)  &
-    ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-    , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-    , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-    , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+    ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+    , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+    , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+    , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+    , zoom_nj_loc )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup)) , INTENT(IN) :: domaingroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -706,6 +785,10 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: nj_glo
       LOGICAL(KIND=C_BOOL) :: nj_glo_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex
+      LOGICAL(KIND=C_BOOL) :: nvertex_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name
       LOGICAL(KIND=C_BOOL) :: standard_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: zoom_ibegin
       LOGICAL(KIND=C_BOOL) :: zoom_ibegin_tmp
@@ -726,20 +809,25 @@
       
       CALL xios(is_defined_domaingroup_attr_hdl_)  &
-      ( domaingroup_hdl, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_n_index  &
-      , data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin, jend, latvalue, long_name  &
-      , lonvalue, mask, name, ni, ni_glo, nj, nj_glo, standard_name, zoom_ibegin, zoom_ibegin_loc  &
-      , zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj, zoom_nj_loc )
+      ( domaingroup_hdl, bounds_lat, bounds_lon, data_dim, data_i_index, data_ibegin, data_j_index  &
+      , data_jbegin, data_n_index, data_ni, data_nj, domain_group_ref, group_ref, ibegin, iend, jbegin  &
+      , jend, latvalue, long_name, lonvalue, mask, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name  &
+      , type, zoom_ibegin, zoom_ibegin_loc, zoom_jbegin, zoom_jbegin_loc, zoom_ni, zoom_ni_loc, zoom_nj  &
+      , zoom_nj_loc )
     
   END SUBROUTINE xios(is_defined_domaingroup_attr_hdl)
   
   SUBROUTINE xios(is_defined_domaingroup_attr_hdl_)   &
-    ( domaingroup_hdl, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_n_index_  &
-    , data_ni_, data_nj_, domain_group_ref_, group_ref_, ibegin_, iend_, jbegin_, jend_, latvalue_  &
-    , long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_, standard_name_, zoom_ibegin_  &
-    , zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_, zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_  &
-     )
+    ( domaingroup_hdl, bounds_lat_, bounds_lon_, data_dim_, data_i_index_, data_ibegin_, data_j_index_  &
+    , data_jbegin_, data_n_index_, data_ni_, data_nj_, domain_group_ref_, group_ref_, ibegin_, iend_  &
+    , jbegin_, jend_, latvalue_, long_name_, lonvalue_, mask_, name_, ni_, ni_glo_, nj_, nj_glo_  &
+    , nvertex_, standard_name_, type_, zoom_ibegin_, zoom_ibegin_loc_, zoom_jbegin_, zoom_jbegin_loc_  &
+    , zoom_ni_, zoom_ni_loc_, zoom_nj_, zoom_nj_loc_ )
     
     IMPLICIT NONE
       TYPE(txios(domaingroup)) , INTENT(IN) :: domaingroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_
+      LOGICAL(KIND=C_BOOL) :: bounds_lat__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_
+      LOGICAL(KIND=C_BOOL) :: bounds_lon__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim_
       LOGICAL(KIND=C_BOOL) :: data_dim__tmp
@@ -788,6 +876,10 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: nj_glo_
       LOGICAL(KIND=C_BOOL) :: nj_glo__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex_
+      LOGICAL(KIND=C_BOOL) :: nvertex__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_
       LOGICAL(KIND=C_BOOL) :: standard_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type_
+      LOGICAL(KIND=C_BOOL) :: type__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: zoom_ibegin_
       LOGICAL(KIND=C_BOOL) :: zoom_ibegin__tmp
@@ -807,4 +899,14 @@
       LOGICAL(KIND=C_BOOL) :: zoom_nj_loc__tmp
       
+      IF (PRESENT(bounds_lat_)) THEN
+        bounds_lat__tmp=cxios_is_defined_domaingroup_bounds_lat(domaingroup_hdl%daddr)
+        bounds_lat_=bounds_lat__tmp
+      ENDIF
+      
+      IF (PRESENT(bounds_lon_)) THEN
+        bounds_lon__tmp=cxios_is_defined_domaingroup_bounds_lon(domaingroup_hdl%daddr)
+        bounds_lon_=bounds_lon__tmp
+      ENDIF
+      
       IF (PRESENT(data_dim_)) THEN
         data_dim__tmp=cxios_is_defined_domaingroup_data_dim(domaingroup_hdl%daddr)
@@ -922,4 +1024,9 @@
       ENDIF
       
+      IF (PRESENT(nvertex_)) THEN
+        nvertex__tmp=cxios_is_defined_domaingroup_nvertex(domaingroup_hdl%daddr)
+        nvertex_=nvertex__tmp
+      ENDIF
+      
       IF (PRESENT(standard_name_)) THEN
         standard_name__tmp=cxios_is_defined_domaingroup_standard_name(domaingroup_hdl%daddr)
@@ -927,4 +1034,9 @@
       ENDIF
       
+      IF (PRESENT(type_)) THEN
+        type__tmp=cxios_is_defined_domaingroup_type(domaingroup_hdl%daddr)
+        type_=type__tmp
+      ENDIF
+      
       IF (PRESENT(zoom_ibegin_)) THEN
         zoom_ibegin__tmp=cxios_is_defined_domaingroup_zoom_ibegin(domaingroup_hdl%daddr)
Index: XIOS/trunk/src/node/domain.cpp
===================================================================
--- XIOS/trunk/src/node/domain.cpp	(revision 448)
+++ XIOS/trunk/src/node/domain.cpp	(revision 449)
@@ -22,7 +22,4 @@
       : CObjectTemplate<CDomain>(), CDomainAttributes()
       , isChecked(false),  relFiles()
-      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
-      , ibegin_zoom_sub(), jbegin_zoom_sub(), ni_zoom_sub(), nj_zoom_sub()
-      , lonvalue_sub(), latvalue_sub()
    { /* Ne rien faire de plus */ }
 
@@ -30,14 +27,8 @@
       : CObjectTemplate<CDomain>(id), CDomainAttributes()
       , isChecked(false), relFiles()
-      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
-      , ibegin_zoom_sub(), jbegin_zoom_sub(),ni_zoom_sub(), nj_zoom_sub()
-      , lonvalue_sub(), latvalue_sub()
-   { /* Ne rien faire de plus */ }
+         { /* Ne rien faire de plus */ }
 
    CDomain::~CDomain(void)
    { 
-     vector<CArray<double,1>* >::iterator it;
-     for(it=lonvalue_sub.begin();it<lonvalue_sub.end();it++) delete *it;
-     for(it=latvalue_sub.begin();it<latvalue_sub.end();it++) delete *it;
    }
 
@@ -46,5 +37,5 @@
    const std::set<StdString> & CDomain::getRelFiles(void) const
    {
-      return (this->relFiles);
+      return (this->relFiles); 
    }
 
@@ -79,65 +70,4 @@
    }
 
-   //----------------------------------------------------------------
-/*
-   void CDomain::fromBinary(StdIStream & is)
-   {
-      SuperClass::fromBinary(is);
-      
-      if ( !this->ibegin.isEmpty()   &&
-           !this->jbegin.isEmpty()   &&
-           !this->iend.isEmpty()     &&
-           !this->jend.isEmpty()     &&
-           !this->latvalue.isEmpty() &&
-           !this->lonvalue.isEmpty())
-      {
-      
-         this->ibegin_sub.push_back(this->ibegin.getValue());
-         this->jbegin_sub.push_back(this->jbegin.getValue());
-         this->iend_sub.push_back(this->iend.getValue());
-         this->jend_sub.push_back(this->jend.getValue()); 
-         
-         this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue());
-         this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue());
-         this->ni_zoom_sub.push_back(this->zoom_ni_loc.getValue());
-         this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue());
-      
-         this->latvalue_sub.push_back(this->latvalue.getValue());
-         this->lonvalue_sub.push_back(this->lonvalue.getValue());
-      }
-      
-#define CLEAR_ATT(name_)\
-      SuperClassAttribute::operator[](#name_)->reset()
-
-         CLEAR_ATT(mask);
-         CLEAR_ATT(data_n_index);
-         CLEAR_ATT(data_i_index);
-         CLEAR_ATT(data_j_index);
-         
-         CLEAR_ATT(data_ni);
-         CLEAR_ATT(data_nj);
-         CLEAR_ATT(data_ibegin);
-         CLEAR_ATT(data_jbegin);
-         
-         CLEAR_ATT(ni);
-         CLEAR_ATT(nj);
-         
-#undef CLEAR_ATT
-
-      if ( !this->ibegin.isEmpty()   &&
-           !this->jbegin.isEmpty()   &&
-           !this->iend.isEmpty()     &&
-           !this->jend.isEmpty()     &&
-           !this->latvalue.isEmpty() &&
-           !this->lonvalue.isEmpty())
-      {
-
-         this->ibegin.setValue(*std::min_element(this->ibegin_sub.begin(),this->ibegin_sub.end()));
-         this->jbegin.setValue(*std::min_element(this->jbegin_sub.begin(),this->jbegin_sub.end()));
-         this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end()));
-         this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end()));
-      }
-   }
-*/
    //----------------------------------------------------------------
 
@@ -150,5 +80,23 @@
    void CDomain::checkGlobalDomain(void)
    {
-      if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) ||
+      if (!type.isEmpty() && type==type_attr::unstructured)
+      {
+         if (ni_glo.isEmpty() || ni_glo <= 0 )
+         {
+            ERROR("CDomain::checkAttributes(void)",
+               << "[ Id = " << this->getId() << " ] "
+               << "The global domain is badly defined,"
+               << " check the \'ni_glo\'  value !") 
+         }
+         nj_glo=ni_glo ;
+         ni_glo=1 ;
+         if (!ni.isEmpty()) nj=ni ;
+         if (!ibegin.isEmpty()) jbegin=ibegin ;
+         if (!iend.isEmpty()) jend=iend ;
+         ni=1 ;
+         ibegin=1 ;
+         iend=1 ;
+      }
+      else if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) ||
           (nj_glo.isEmpty() || nj_glo.getValue() <= 0 ))
       {
@@ -173,10 +121,10 @@
          ni.setValue(iend.getValue() - ibegin.getValue() + 1) ;
 
-      else if (!ibegin.isEmpty() && !iend.isEmpty() &&
-               !ni.isEmpty() && (iend.getValue() != ibegin.getValue() + ni.getValue() - 1))
-      {
-         ERROR("CDomain::checkAttributes(void)",
-               << "The domain si wrong defined,"
-               << " iend is different of (ibegin + ni - 1) !") ;
+      else if (!ibegin.isEmpty() && !iend.isEmpty() && !ni.isEmpty() )
+      {
+         if (iend.getValue() != ibegin.getValue() + ni.getValue() - 1)
+           ERROR("CDomain::checkAttributes(void)",
+                 << "The domain si wrong defined,"
+                 << " iend is different of (ibegin + ni - 1) !") ;
       }
       else
@@ -190,9 +138,12 @@
       if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() ||
           ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue())
+          {
+                  cout<<ni_glo<<"  "<<ni<<"  "<<ibegin<<"  "<<iend<<endl;
+
          ERROR("CDomain::checkAttributes(void)",
                << "[ Id = " << this->getId() << " ] "
                << "Local domain is wrong defined,"
                << " Check the value : ni, ni_glo, ibegin, iend") ;
-
+        }
    }
 
@@ -210,10 +161,10 @@
          nj.setValue(jend.getValue() - jbegin.getValue() + 1) ;
 
-      else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty() &&
-               (jend.getValue() != jbegin.getValue() + nj.getValue() - 1))
-      {
-         ERROR("CDomain::checkAttributes(void)",
-               << "The domain is wrong defined,"
-               << " iend is different of (jbegin + nj - 1) !") ;
+      else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty() )
+      {
+          if  (jend.getValue() != jbegin.getValue() + nj.getValue() - 1)
+             ERROR("CDomain::checkAttributes(void)",
+                 << "The domain is wrong defined,"
+                 << " iend is different of (jbegin + nj - 1) !") ;
       }
       else
@@ -229,4 +180,7 @@
                << "Domain is wrong defined,"
                << " Check the values : nj, nj_glo, jbegin, jend") ;
+               
+     ibegin_client=ibegin ; iend_client=iend ; ni_client=ni ;
+     jbegin_client=jbegin ; jend_client=jend ; nj_client=nj ;
    }
 
@@ -416,14 +370,29 @@
       CArray<double,1> lonvalue_temp(ni*nj) ;
       CArray<double,1> latvalue_temp(ni*nj) ;
-      
-      if ( lonvalue.numElements() == ni*nj && latvalue.numElements() == ni*nj ) isCurvilinear=true ;
-      else if ( lonvalue.numElements() == ni && latvalue.numElements() == nj ) isCurvilinear=false ;
-      else ERROR("void CDomain::completeLonLatClient(void)",<<"the grid is nor curvilinear, nor cartesian, because the size of longitude and latitude array is not coherent with the domain size"<<endl
-                                                            <<"lonvalue size = " << lonvalue.numElements() << "different of ni or ni*nj"<<endl
-                                                            <<"latvalue size = " << latvalue.numElements() << "different of nj or ni*nj" ) ;
-      if (isCurvilinear)
+      CArray<double,2> bounds_lon_temp(nvertex,ni*nj) ;
+      CArray<double,2> bounds_lat_temp(nvertex,ni*nj) ;
+      
+      if (type.isEmpty())
+      {
+        if ( lonvalue.numElements() == ni*nj && latvalue.numElements() == ni*nj ) 
+        {
+          type.setValue(type_attr::curvilinear) ;
+          isCurvilinear=true ;
+        }
+        else if ( lonvalue.numElements() == ni && latvalue.numElements() == nj ) 
+        {
+          type.setValue(type_attr::regular) ;
+          isCurvilinear=false ;
+        }
+        else ERROR("void CDomain::completeLonLatClient(void)",<<"the grid is nor curvilinear, nor cartesian, because the size of longitude and latitude array is not coherent with the domain size"<<endl
+                                                              <<"lonvalue size = " << lonvalue.numElements() << "different of ni or ni*nj"<<endl
+                                                              <<"latvalue size = " << latvalue.numElements() << "different of nj or ni*nj" ) ;
+      }
+      if (type==type_attr::curvilinear || type==type_attr::unstructured)
       {
         lonvalue_temp=lonvalue ;
         latvalue_temp=latvalue ;
+        if (hasBounds) bounds_lon_temp=bounds_lon ;
+        if (hasBounds) bounds_lat_temp=bounds_lat ;
       }
       else
@@ -435,13 +404,15 @@
             lonvalue_temp(k)=lonvalue(i) ;
             latvalue_temp(k)=latvalue(j) ;
+            if (hasBounds)
+            {
+              for(int n=0;n<nvertex;n++) 
+              {
+                bounds_lon_temp(n,k)=bounds_lon(n,i) ;
+                bounds_lat_temp(n,k)=bounds_lat(n,j) ;
+              }
+            }
           }
       }
          
-        
-      const int zoom_ibegin_client  = zoom_ibegin_loc.getValue(),
-                zoom_jbegin_client  = zoom_jbegin_loc.getValue(),
-                zoom_ni_client      = zoom_ni_loc.getValue(),
-                zoom_nj_client      = zoom_nj_loc.getValue();
-                
       StdSize dm = zoom_ni_client * zoom_nj_client;
 
@@ -453,81 +424,22 @@
         for (int j = 0; j < zoom_nj_client; j++)
         {
-          lonvalue(i + j * zoom_ni_client) = lonvalue_temp( (i + zoom_ibegin_client -1) + (j + zoom_jbegin_client -1)*ni.getValue() ); 
-          latvalue(i + j * zoom_ni_client) = latvalue_temp( (i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni.getValue() );
+//          lonvalue(i + j * zoom_ni_client) = lonvalue_temp( (i + zoom_ibegin_client -1) + (j + zoom_jbegin_client -1)*ni ); 
+//          latvalue(i + j * zoom_ni_client) = latvalue_temp( (i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni );
+          lonvalue(i + j * zoom_ni_client) = lonvalue_temp( (i + zoom_ibegin_client-ibegin) + (j + zoom_jbegin_client -jbegin)*ni ); 
+          latvalue(i + j * zoom_ni_client) = latvalue_temp( (i + zoom_ibegin_client - ibegin)+(j + zoom_jbegin_client - jbegin)*ni );
+          if (hasBounds)
+          {
+            for(int n=0;n<nvertex;n++) 
+            {
+//              bounds_lon(n,i + j * zoom_ni_client) = bounds_lon_temp( n, (i + zoom_ibegin_client -1) + (j + zoom_jbegin_client -1)*ni ); 
+//              bounds_lat(n,i + j * zoom_ni_client) = bounds_lat_temp( n, (i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni );
+              bounds_lon(n,i + j * zoom_ni_client) = bounds_lon_temp( n, (i + zoom_ibegin_client - ibegin) + (j + zoom_jbegin_client -jbegin)*ni ); 
+              bounds_lat(n,i + j * zoom_ni_client) = bounds_lat_temp( n, (i + zoom_ibegin_client - ibegin)+(j + zoom_jbegin_client -jbegin)*ni );
+            }
+          }
         }
       }
-   }
+    }
  
-   //----------------------------------------------------------------
-      
-   void CDomain::completeLonLatServer(void)
-   {
-      CArray<double,1> lonvalue_temp ;
-      CArray<double,1> latvalue_temp ;
-      
-      const int ibegin_serv     = ibegin.getValue(),
-                jbegin_serv     = jbegin.getValue(),
-                zoom_ni_serv    = zoom_ni_loc.getValue(),
-                zoom_nj_serv    = zoom_nj_loc.getValue(),
-                ibegin_zoom_srv = zoom_ibegin_loc.getValue(),
-                jbegin_zoom_srv = zoom_jbegin_loc.getValue();
-                      
-                       
-      if (this->data_dim.getValue() == 2)
-      {
-         StdSize dm = zoom_ni_serv * zoom_nj_serv;      
-         
-         lonvalue_temp.resize(dm);
-         latvalue_temp.resize(dm);
-         
-         for (StdSize k = 0; k < lonvalue_sub.size(); k++)
-         {
-            CArray<double,1> lonvalue_loc(*(lonvalue_sub[k])) ;
-            CArray<double,1> latvalue_loc (*(latvalue_sub[k]));
-            
-            const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
-                      zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k],
-                      ibegin_cl = ibegin_sub[k] ,
-                      jbegin_cl = jbegin_sub[k] ,
-                      ni_cl = iend_sub[k] - ibegin_sub[k] + 1;
-                      
-            for (int i = 0; i < zoom_ni_cl; i++)
-            {
-               for (int j = 0; j < zoom_nj_cl; j++)
-               {
-                  int ii = i + (ibegin_cl-1) - (ibegin_serv - 1) + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1);
-                  int jj = j + (jbegin_cl-1) - (jbegin_serv - 1) + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1);
-                  lonvalue_temp(ii + jj * zoom_ni_serv) = lonvalue_loc(i + j * zoom_ni_cl);
-                  latvalue_temp(ii + jj * zoom_ni_serv) = latvalue_loc(i + j * zoom_ni_cl);
-               }
-            }
-         }
-         
-         lonvalue.reference(lonvalue_temp.copy()) ;
-         latvalue.reference(latvalue_temp.copy()) ;
-      }
-      else
-      {
-         lonvalue_temp.resize(zoom_ni_serv);
-         latvalue_temp.resize(zoom_nj_serv);
-         
-         for (StdSize k = 0; k < lonvalue_sub.size(); k++)
-         {
-            CArray<double,1> lonvalue_loc(*(lonvalue_sub[k]));
-            CArray<double,1> latvalue_loc(*(latvalue_sub[k]));
-            
-            const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
-                      zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k];
-                      
-            for (int i = 0; i < zoom_ni_cl; i++)
-              lonvalue_temp(i /*- (ibegin_serv - 1)*/ + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1)) = lonvalue_loc(i);
-               
-            for (int j = 0; j < zoom_nj_cl; j++)
-              latvalue_temp(j /*- (jbegin_serv - 1)*/ + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1)) = latvalue_loc(j);
-         }       
-         lonvalue.reference(lonvalue_temp.copy()) ;
-         latvalue.reference(latvalue_temp.copy()) ;
-      }
-   }
 
    //----------------------------------------------------------------
@@ -547,9 +459,8 @@
          else
          {
-            int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
-            int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
+            int zoom_iend = zoom_ibegin + zoom_ni - 1;
+            int zoom_jend = zoom_jbegin + zoom_nj - 1;
                 
-            if (zoom_ibegin.getValue() < 1  || zoom_jbegin.getValue() < 1 ||
-                zoom_iend > ni_glo.getValue() || zoom_jend > nj_glo.getValue())
+            if (zoom_ibegin < 1  || zoom_jbegin < 1 || zoom_iend > ni_glo || zoom_jend > nj_glo)
                ERROR("CDomain::checkZoom(void)",
                      << "Zoom is wrong defined,"
@@ -559,56 +470,80 @@
       else
       {
-         this->zoom_ni.setValue(this->ni_glo.getValue()); 
-         this->zoom_nj.setValue(this->nj_glo.getValue());
-         this->zoom_ibegin.setValue(1);
-         this->zoom_jbegin.setValue(1);
-      }
-      // RÃ©solution des donnÃ©es locales de zoom.
-      {
-         int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
-         int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
+         zoom_ni = ni_glo; 
+         zoom_nj = nj_glo;
+         zoom_ibegin = 1;
+         zoom_jbegin = 1;
+      }
+      
+      // compute client zoom indices
+
+      int zoom_iend=zoom_ibegin+zoom_ni-1 ;
+      zoom_ibegin_client = ibegin_client > zoom_ibegin ? ibegin_client : zoom_ibegin ;
+      zoom_iend_client = iend_client < zoom_iend ? iend_client : zoom_iend ;
+      zoom_ni_client=zoom_iend_client-zoom_ibegin_client+1 ;
+      if (zoom_ni_client<0) zoom_ni_client=0 ;
+
+    
+      int zoom_jend=zoom_jbegin+zoom_nj-1 ;
+      zoom_jbegin_client = jbegin_client > zoom_jbegin ? jbegin_client : zoom_jbegin ;
+      zoom_jend_client = jend_client < zoom_jend ? jend_client : zoom_jend ;
+      zoom_nj_client=zoom_jend_client-zoom_jbegin_client+1 ;
+      if (zoom_nj_client<0) zoom_nj_client=0 ;
+      
+      cout << zoom_ibegin<<"  "<<zoom_ni <<"  "<< zoom_jbegin<<"  "<<zoom_nj<<endl ;
+      cout << zoom_ibegin_client<<"  "<<zoom_ni_client <<"  "<< zoom_jbegin_client<<"  "<<zoom_nj_client<<endl ;
+      cout << ibegin_client<<"  "<<iend_client <<"  "<< jbegin_client<<"  "<<jend_client<<endl ;
+/*    
+      {
+         int zoom_iend = zoom_ibegin + zoom_ni - 1;
+         int zoom_jend = zoom_jbegin + zoom_nj - 1;
          
-         if ((zoom_ibegin.getValue() > iend.getValue()) || 
-             (zoom_iend < ibegin.getValue()))
-         {
-            zoom_ni_loc.setValue(0);
-            zoom_ibegin_loc.setValue(zoom_ibegin.getValue());
+         if ( zoom_ibegin > iend || zoom_iend < ibegin )
+         {
+            zoom_ni_loc = 0 ;
+            zoom_ibegin_loc = zoom_ibegin ;
          }
          else
          {
-            int zoom_ibegin_loc_ = (zoom_ibegin.getValue() > ibegin.getValue()) 
-                                 ? zoom_ibegin.getValue()
-                                 : ibegin.getValue();
-            int zoom_iend_loc_  = (zoom_iend < iend.getValue()) 
-                                 ? zoom_iend
-                                 : iend.getValue();
+            int zoom_ibegin_loc_ = (zoom_ibegin > ibegin) ? zoom_ibegin : ibegin ;
+            int zoom_iend_loc_  = (zoom_iend < iend) ? zoom_iend : iend ;
             int zoom_ni_loc_ = zoom_iend_loc_ - zoom_ibegin_loc_ + 1;
             
-            zoom_ni_loc.setValue(zoom_ni_loc_);
-            zoom_ibegin_loc.setValue(zoom_ibegin_loc_-ibegin.getValue()+1);
+            zoom_ni_loc = zoom_ni_loc_;
+            zoom_ibegin_loc = zoom_ibegin_loc_-ibegin.getValue()+1;
          }
          
-         if ((zoom_jbegin.getValue() > jend.getValue()) || 
-             (zoom_jend < jbegin.getValue()))
-         {
-            zoom_nj_loc.setValue(0);
-            zoom_jbegin_loc.setValue(zoom_jbegin.getValue());
+         if ( zoom_jbegin > jend || zoom_jend < jbegin )
+         {
+            zoom_nj_loc = 0 ;
+            zoom_jbegin_loc = zoom_jbegin ;
          }
          else
          {
-            int zoom_jbegin_loc_ = (zoom_jbegin.getValue() > jbegin.getValue()) 
-                                 ? zoom_jbegin.getValue()
-                                 : jbegin.getValue();
-            int zoom_jend_loc_  = (zoom_jend < jend.getValue()) 
-                                 ? zoom_jend
-                                 : jend.getValue();
+            int zoom_jbegin_loc_ = ( zoom_jbegin > jbegin ) ? zoom_jbegin : jbegin ;
+            int zoom_jend_loc_  = (zoom_jend < jend) ? zoom_jend : jend ;
             int zoom_nj_loc_ = zoom_jend_loc_ - zoom_jbegin_loc_ + 1;
             
-            zoom_nj_loc.setValue(zoom_nj_loc_);
-            zoom_jbegin_loc.setValue(zoom_jbegin_loc_-jbegin.getValue()+1);
-         }
-      }
-   }
-
+            zoom_nj_loc = zoom_nj_loc_;
+            zoom_jbegin_loc = zoom_jbegin_loc_-jbegin.getValue()+1;
+         }
+      }
+*/
+   }
+   
+   void CDomain::checkBounds(void)
+   {
+     if (!nvertex.isEmpty() && !bounds_lon.isEmpty() && !bounds_lat.isEmpty())
+     {
+       hasBounds=true ;
+       
+     }
+     else 
+     {
+       hasBounds=false;
+       nvertex=0 ;
+     }
+   }
+            
    //----------------------------------------------------------------
 
@@ -623,4 +558,5 @@
       
       this->checkZoom();
+      this->checkBounds();
       
       if (context->hasClient)
@@ -629,25 +565,5 @@
          this->checkDomainData();
          this->checkCompression();
-         
-         this->ibegin_sub.push_back(this->ibegin.getValue());
-         this->jbegin_sub.push_back(this->jbegin.getValue());
-         this->iend_sub.push_back(this->iend.getValue());
-         this->jend_sub.push_back(this->jend.getValue()); 
-
-         this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue());
-         this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue());
-         this->ni_zoom_sub.push_back(this->zoom_ni_loc.getValue());
-         this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue());
-      
-         this->latvalue_sub.push_back(new CArray<double,1>(latvalue.copy()));
-         this->lonvalue_sub.push_back(new CArray<double,1>(lonvalue.copy()));  
-
-
-//         if (!this->isEmpty())
-//         {
-            this->completeLonLatClient();
-//         }
-         this->completeMask();
-
+         this->completeLonLatClient();
       }
       else
@@ -722,5 +638,6 @@
     CContextClient* client=context->client ;
     int nbServer=client->serverSize ;
-    
+
+/*    
     // compute client zoom indices
     int zoom_iend=zoom_ibegin.getValue()+zoom_ni.getValue()-1 ;
@@ -735,6 +652,9 @@
     zoom_nj_client=zoom_jend_client-zoom_jbegin_client+1 ;
     if (zoom_nj_client<0) zoom_nj_client=0 ;
- 
+*/ 
     // find how much client are connected to a server
+    int zoom_iend=zoom_ibegin+zoom_ni-1 ;
+    int zoom_jend=zoom_jbegin+zoom_nj-1 ;
+    
     jend_srv=0 ;
     for(int ns=0;ns<nbServer;ns++)
@@ -747,5 +667,5 @@
       ib = ibegin_client>ibegin_srv ? ibegin_client : ibegin_srv ;
       ie=  iend_client< iend_srv? iend_client : iend_srv ;
-      in=ie-ib+1 ;
+      in=ie-ib+1 ; 
       if (in<0) in=0 ;
       
@@ -837,5 +757,7 @@
   
     list<shared_ptr<CMessage> > list_msg ;    
-    list<CArray<double,1>* > list_indi,list_indj,list_lon,list_lat ;
+    list< CArray<int,1>* > list_indi,list_indj ;
+    list< CArray<double,1>* >list_lon,list_lat ;
+    list< CArray<double,2>* >list_boundslon,list_boundslat ;
 
     for(int ns=0;ns<connectedServer.size();ns++)
@@ -844,8 +766,10 @@
       jb=jb_srv[ns] ; je=je_srv[ns] ; jn=jn_srv[ns] ;
       
-      CArray<double,1> indi(in*jn) ;
-      CArray<double,1> indj(in*jn) ;
+      CArray<int,1> indi(in*jn) ;
+      CArray<int,1> indj(in*jn) ;
       CArray<double,1> lon(in*jn) ;
       CArray<double,1> lat(in*jn) ;
+      CArray<double,2> boundslon(nvertex,in*jn) ;
+      CArray<double,2> boundslat(nvertex,in*jn) ;
 
           
@@ -859,17 +783,29 @@
           lon(ind_loc)=lonvalue(ind_client) ;
           lat(ind_loc)=latvalue(ind_client) ;
+          if (hasBounds)
+          {
+            for(int n=0;n<nvertex;n++)
+            {
+              boundslon(n,ind_loc)=bounds_lon(n,ind_client);
+              boundslat(n,ind_loc)=bounds_lat(n,ind_client);
+            }
+          }
           indi(ind_loc)=i ;
           indj(ind_loc)=j ;
         }
       
-      list_indi.push_back(new CArray<double,1>(indi.copy())) ;
-      list_indj.push_back(new CArray<double,1>(indj.copy())) ;
+      list_indi.push_back(new CArray<int,1>(indi.copy())) ;
+      list_indj.push_back(new CArray<int,1>(indj.copy())) ;
       list_lon.push_back(new CArray<double,1>(lon.copy())) ;
       list_lat.push_back(new CArray<double,1>(lat.copy())) ;
+      if (hasBounds) list_boundslon.push_back(new CArray<double,2>(boundslon.copy())) ;
+      if (hasBounds) list_boundslat.push_back(new CArray<double,2>(boundslat.copy())) ;
 
       list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
 
-      *list_msg.back()<<this->getId()<<isCurvilinear ;
+      *list_msg.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix
+      *list_msg.back()<<isCurvilinear ;
       *list_msg.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back()<<*list_lat.back() ;
+      if (hasBounds) *list_msg.back()<<*list_boundslon.back()<<*list_boundslat.back();
       event.push(connectedServer[ns],nbSenders[ns],*list_msg.back()) ;
     }
@@ -877,9 +813,11 @@
     client->sendEvent(event) ;
     
-    list<CArray<double,1>* >::iterator it;
-    for(it=list_indi.begin();it!=list_indi.end();it++) delete *it;
-    for(it=list_indj.begin();it!=list_indj.end();it++) delete *it;
-    for(it=list_lon.begin();it!=list_lon.end();it++)   delete *it;
-    for(it=list_lat.begin();it!=list_lat.end();it++)   delete *it;
+    
+    for(list<CArray<int,1>* >::iterator it=list_indi.begin();it!=list_indi.end();it++) delete *it;
+    for(list<CArray<int,1>* >::iterator it=list_indj.begin();it!=list_indj.end();it++) delete *it;
+    for(list<CArray<double,1>* >::iterator it=list_lon.begin();it!=list_lon.end();it++)   delete *it;
+    for(list<CArray<double,1>* >::iterator it=list_lat.begin();it!=list_lat.end();it++)   delete *it;
+    if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslon.begin();it!=list_boundslon.end();it++)   delete *it;
+    if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslat.begin();it!=list_boundslat.end();it++)   delete *it;
     
   }
@@ -940,4 +878,6 @@
     lonvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
     latvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
+    if (hasBounds) bounds_lon_srv.resize(nvertex,zoom_ni_srv*zoom_nj_srv) ;
+    if (hasBounds) bounds_lat_srv.resize(nvertex,zoom_ni_srv*zoom_nj_srv) ;
   }
     
@@ -956,10 +896,15 @@
   void CDomain::recvLonLat(CBufferIn& buffer)
   {
-    CArray<double,1> indi ;
-    CArray<double,1> indj ;
+    CArray<int,1> indi ;
+    CArray<int,1> indj ;
     CArray<double,1> lon ;
     CArray<double,1> lat ;
-     
-    buffer>>isCurvilinear>>indi>>indj>>lon>>lat ;
+    CArray<double,2> boundslon ;
+    CArray<double,2> boundslat ;
+
+    int type_int ;
+    buffer>>type_int>>isCurvilinear>>indi>>indj>>lon>>lat ;
+    if (hasBounds) buffer>>boundslon>>boundslat ;
+    type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix
 
     int i,j,ind_srv ;
@@ -971,86 +916,17 @@
       lonvalue_srv(ind_srv)=lon(ind) ;
       latvalue_srv(ind_srv)=lat(ind) ;
+      if (hasBounds) 
+      {
+        for(int n=0;n<nvertex;n++) 
+        {
+          bounds_lon_srv(n,ind_srv)=boundslon(n,ind) ;
+          bounds_lat_srv(n,ind_srv)=boundslat(n,ind) ;
+        }
+      }
     }
   }
    //----------------------------------------------------------------
    
-   void CDomain::completeMask(void)
-   {
-      this->local_mask.resize(zoom_ni_loc,zoom_nj_loc);
-   }
-
-   //----------------------------------------------------------------
-
-   CArray<int,2> CDomain::getLocalMask(void) const
-   {
-      return (this->local_mask);
-   }
-   
-   //----------------------------------------------------------------
-   
-   const std::vector<int> & CDomain::getIBeginSub(void) const
-   {
-      return (this->ibegin_sub);
-   }
-   
-   //----------------------------------------------------------------
-   
-   const std::vector<int> & CDomain::getIBeginZoomSub(void) const
-   {
-      return (this->ibegin_zoom_sub);
-   }
-
-   const std::vector<int> & CDomain::getNiZoomSub(void) const
-   {
-      return (this->ni_zoom_sub);
-   }
-               
-   //----------------------------------------------------------------
-                     
-   const std::vector<int> & CDomain::getIEndSub(void) const
-   {
-      return (this->iend_sub);
-   }
-   
-   //----------------------------------------------------------------
-   
-   const std::vector<int> & CDomain::getJBeginSub(void) const
-   {
-      return (this->jbegin_sub);
-   }
-   
-   //----------------------------------------------------------------
-      
-   const std::vector<int> & CDomain::getJBeginZoomSub(void) const
-   {
-      return (this->jbegin_zoom_sub);
-   }
-
-   const std::vector<int> & CDomain::getNjZoomSub(void) const
-   {
-      return (this->nj_zoom_sub);
-   }
-                  
-   
-   //----------------------------------------------------------------
-   
-   const std::vector<int> & CDomain::getJEndSub(void) const
-   {
-      return (this->jend_sub);
-   }
-   
-   //----------------------------------------------------------------
-   
-   const std::vector<CArray<double, 1>* > & CDomain::getLonValueSub(void) const
-   {
-      return (this->lonvalue_sub);
-   }
-   
-   //----------------------------------------------------------------
-   
-   const std::vector<CArray<double,1>*> & CDomain::getLatValueSub(void) const
-   {
-      return (this->latvalue_sub);
-   }   
+   
    
    ///---------------------------------------------------------------
Index: XIOS/trunk/src/node/domain.hpp
===================================================================
--- XIOS/trunk/src/node/domain.hpp	(revision 448)
+++ XIOS/trunk/src/node/domain.hpp	(revision 449)
@@ -12,4 +12,5 @@
 #include "array_new.hpp"
 #include "attribute_array.hpp"
+#include "attribute_enum.hpp"
 
 namespace xios {
@@ -69,29 +70,13 @@
          
          void checkZoom(void);
+         void checkBounds(void);
 
-         void completeMask(void);
 
       public :
       
          /// Autres ///
-//         virtual void fromBinary(StdIStream & is);
 
-         /// Accesseurs ///
-         CArray<int, 2> getLocalMask(void) const;
-         
          const std::set<StdString> & getRelFiles(void) const;
 
-         const std::vector<int> & getIBeginSub(void) const;
-         const std::vector<int> & getIEndSub(void) const;
-         const std::vector<int> & getJBeginSub(void) const;
-         const std::vector<int> & getJEndSub(void) const;
-
-         const std::vector<int> & getIBeginZoomSub(void) const;
-         const std::vector<int> & getJBeginZoomSub(void) const;
-         const std::vector<int> & getNiZoomSub(void) const;
-         const std::vector<int> & getNjZoomSub(void) const;
-         
-         const std::vector<CArray<double,1>* > & getLonValueSub(void) const;
-         const std::vector<CArray<double,1>* > & getLatValueSub(void) const;
 
          /// Test ///
@@ -114,4 +99,5 @@
 
          CArray<double, 1> lonvalue_srv, latvalue_srv ;
+         CArray<double, 2> bounds_lon_srv, bounds_lat_srv ;
          
          
@@ -124,5 +110,4 @@
          /// Mutateur ///
          void addRelFile(const StdString & filename);
-         void completeLonLatServer(void);
          void completeLonLatClient(void);
          void sendServerAttribut(void) ;
@@ -146,4 +131,5 @@
          CArray<int, 2> local_mask;
          bool isCurvilinear ;
+         bool hasBounds ;
        private :
 
@@ -151,9 +137,4 @@
          bool isChecked;
          std::set<StdString> relFiles;
-
-         std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub;
-         std::vector<int> ibegin_zoom_sub, jbegin_zoom_sub, ni_zoom_sub, nj_zoom_sub;
-         std::vector<CArray<double,1>* > lonvalue_sub, latvalue_sub;
-         
 
    }; // class CDomain
Index: XIOS/trunk/src/node/field.cpp
===================================================================
--- XIOS/trunk/src/node/field.cpp	(revision 448)
+++ XIOS/trunk/src/node/field.cpp	(revision 449)
@@ -402,6 +402,6 @@
       }
       
-      if (context->hasClient)
-      {                  
+//      if (context->hasClient)
+//      {                  
          this->freq_operation = CDuration::FromString(freq_op.getValue());
          this->freq_write     = CDuration::FromString(this->file->output_freq.getValue());
@@ -432,5 +432,5 @@
                << "[ operation = " << operation.getValue() << "]"
                << "The operation is not defined !");
-      }
+//      }
       
 
Index: XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.cpp	(revision 448)
+++ XIOS/trunk/src/output/nc4_data_output.cpp	(revision 449)
@@ -57,4 +57,10 @@
       void CNc4DataOutput::writeDomain_(CDomain* domain)
       {
+         if (domain->type == CDomain::type_attr::unstructured)
+         {
+           writeUnstructuredDomain(domain) ;
+           return ;
+         }
+         
          CContext* context = CContext::getCurrent() ;
          CContextServer* server=context->server ;
@@ -70,19 +76,24 @@
                              ? domain->name.getValue() : domain->getId();
          StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
-         
-         bool isCurvilinear = domain->isCurvilinear ;
+
+
          StdString dimXid, dimYid ;
-         if (isCurvilinear)
-         {
-           dimXid     = StdString("x").append(appendDomid);
-           dimYid     = StdString("y").append(appendDomid);
-         }
-         else
-         {
-           dimXid     = StdString("lon").append(appendDomid);
-           dimYid     = StdString("lat").append(appendDomid);
+         
+         switch (domain->type)
+         {
+           case CDomain::type_attr::curvilinear :
+             dimXid     = StdString("x").append(appendDomid);
+             dimYid     = StdString("y").append(appendDomid);
+             break ;
+           case CDomain::type_attr::regular :
+             dimXid     = StdString("lon").append(appendDomid);
+             dimYid     = StdString("lat").append(appendDomid);
+             break;
+           case CDomain::type_attr::unstructured :
+             dimXid     = StdString("cell").append(appendDomid);
+             break;
          }            
          
-         string lonid,latid ;
+         string lonid,latid,bounds_lonid,bounds_latid ;
 /*
          StdString lonid_loc = (server->intraCommSize > 1)
@@ -106,53 +117,75 @@
                }
 
-               if (isCurvilinear)
-               {
-                 dim0.push_back(dimYid); dim0.push_back(dimXid);
-                 lonid = StdString("nav_lon").append(appendDomid);
-                 latid = StdString("nav_lat").append(appendDomid);
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear :
+                   dim0.push_back(dimYid); dim0.push_back(dimXid);
+                   lonid = StdString("nav_lon").append(appendDomid);
+                   latid = StdString("nav_lat").append(appendDomid);
+                   break ;
+                 case CDomain::type_attr::regular :
+                   lonid = StdString("lon").append(appendDomid);
+                   latid = StdString("lat").append(appendDomid);
+                   dim0.push_back(dimYid);
+                   dim1.push_back(dimXid);
+                   break;
+                 case CDomain::type_attr::unstructured :
+                   lonid = StdString("lon").append(appendDomid);
+                   latid = StdString("lat").append(appendDomid);
+                   bounds_lonid=string("bounds_lon").append(appendDomid);
+                   bounds_latid=string("bounds_lat").append(appendDomid);
+                   dim0.push_back(dimXid);
+                   break;
+               }
+                
+               if (domain->type == CDomain::type_attr::unstructured)
+               {
+                 SuperClassWriter::addDimension(dimXid, domain->nj_glo);
                }
                else
                {
-                 lonid = StdString("lon").append(appendDomid);
-                 latid = StdString("lat").append(appendDomid);
-                 dim0.push_back(dimYid);
-                 dim1.push_back(dimXid);
-               }
-
-               SuperClassWriter::addDimension(dimXid, domain->zoom_ni_srv);
-               SuperClassWriter::addDimension(dimYid, domain->zoom_nj_srv);
+                 SuperClassWriter::addDimension(dimXid, domain->zoom_ni_srv);
+                 SuperClassWriter::addDimension(dimYid, domain->zoom_nj_srv);
+               }
+               
                if (server->intraCommSize > 1)
                {
-                  this->writeLocalAttributes(domain->zoom_ibegin_srv,
-                                             domain->zoom_ni_srv,
-                                             domain->zoom_jbegin_srv,
-                                             domain->zoom_nj_srv,
-                                             appendDomid);
+                  if (domain->type != CDomain::type_attr::unstructured)
+                  {
+                    this->writeLocalAttributes(domain->zoom_ibegin_srv,
+                                               domain->zoom_ni_srv,
+                                               domain->zoom_jbegin_srv,
+                                               domain->zoom_nj_srv,
+                                               appendDomid);
                   
-                  if (singleDomain) this->writeLocalAttributes_IOIPSL(domain->zoom_ibegin_srv,
-                                             domain->zoom_ni_srv,
-                                             domain->zoom_jbegin_srv,
-                                             domain->zoom_nj_srv,
-                                             domain->ni_glo,domain->nj_glo,
-                                             server->intraCommRank,server->intraCommSize);
-               }
-               
-               if (isCurvilinear)
-               {
-                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
-                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
-               }
-               else
-               {
-                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
-                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
-               }
-               this->writeAxisAttributes
-                  (lonid, "X", "longitude", "Longitude", "degrees_east", domid);
-               this->writeAxisAttributes
-                  (latid, "Y", "latitude", "Latitude", "degrees_north", domid);
+                    if (singleDomain) this->writeLocalAttributes_IOIPSL(domain->zoom_ibegin_srv,
+                                               domain->zoom_ni_srv,
+                                               domain->zoom_jbegin_srv,
+                                               domain->zoom_nj_srv,
+                                               domain->ni_glo,domain->nj_glo,
+                                               server->intraCommRank,server->intraCommSize);
+                 }
+               }
+               
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear :
+                   SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                   SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+                   break ;
+                  case CDomain::type_attr::regular :
+                    SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                    SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
+                    break ;
+                  case CDomain::type_attr::unstructured :
+                    SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                    SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+               }
+               
+               this->writeAxisAttributes(lonid, "X", "longitude", "Longitude", "degrees_east", domid);
+               this->writeAxisAttributes(latid, "Y", "latitude", "Latitude", "degrees_north", domid);
 
                dim0.clear();
-               dim0.push_back(dimYid);
+               if (domain->type != CDomain::type_attr::unstructured) dim0.push_back(dimYid);
                dim0.push_back(dimXid);
 
@@ -173,17 +206,17 @@
 
                SuperClassWriter::definition_end();
-               if (isCurvilinear)
-               {
- 
-                 SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0);
-                 SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0);
-// supress mask               if (server->intraCommSize > 1) SuperClassWriter::writeData(mask, maskid);
-               }
-               else
-               {
-                  CArray<double,1> lat = domain->latvalue_srv(Range(fromStart,toEnd,domain->zoom_ni_srv)) ;
-                  SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0);
-                  CArray<double,1> lon=domain->lonvalue_srv(Range(0,domain->zoom_ni_srv-1)) ;
-                  SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0);
+
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear :
+                   SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0);
+                   SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0);
+                   break; 
+                 case CDomain::type_attr::regular :
+                   CArray<double,1> lat = domain->latvalue_srv(Range(fromStart,toEnd,domain->zoom_ni_srv)) ;
+                   SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0);
+                   CArray<double,1> lon=domain->lonvalue_srv(Range(0,domain->zoom_ni_srv-1)) ;
+                   SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0);
+                   break;
                }
                SuperClassWriter::definition_start();
@@ -197,20 +230,22 @@
 
                
-               if (isCurvilinear)
-               {
-                  dim0.push_back(dimYid); dim0.push_back(dimXid);
-                  lonid = StdString("nav_lon").append(appendDomid);
-                  latid = StdString("nav_lat").append(appendDomid);
-                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
-                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
-               }
-               else
-               {
-                  dim0.push_back(dimYid);
-                  dim1.push_back(dimXid);
-                  lonid = StdString("lon").append(appendDomid);
-                  latid = StdString("lat").append(appendDomid);
-                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
-                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear :
+                   dim0.push_back(dimYid); dim0.push_back(dimXid);
+                   lonid = StdString("nav_lon").append(appendDomid);
+                   latid = StdString("nav_lat").append(appendDomid);
+                   SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                   SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+                   break;
+
+                 case CDomain::type_attr::regular :
+                   dim0.push_back(dimYid);
+                   dim1.push_back(dimXid);
+                   lonid = StdString("lon").append(appendDomid);
+                   latid = StdString("lat").append(appendDomid);
+                   SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                   SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
+                   break;
                }
                this->writeAxisAttributes
@@ -221,43 +256,48 @@
 
                SuperClassWriter::definition_end();
-               if (isCurvilinear)
-               {
-                 std::vector<StdSize> start(2) ; 
-                 std::vector<StdSize> count(2) ;
-                 if (domain->isEmpty())
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear :
                  {
-                   start[0]=0 ; start [1]=0 ; 
-                   count[0]=0 ; count[1]=0 ; 
+                   std::vector<StdSize> start(2) ; 
+                   std::vector<StdSize> count(2) ;
+                   if (domain->isEmpty())
+                   {
+                     start[0]=0 ; start [1]=0 ; 
+                     count[0]=0 ; count[1]=0 ; 
+                   }
+                   else
+                   {
+                     start[1]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; start [0]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; 
+                     count[1]=domain->zoom_ni_srv ; count[0]=domain->zoom_nj_srv ; 
+                   }
+                 
+                   SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
+                   SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);
+                   break;
                  }
-                 else
+                 case CDomain::type_attr::regular :
                  {
-                   start[1]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; start [0]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; 
-                   count[1]=domain->zoom_ni_srv ; count[0]=domain->zoom_nj_srv ; 
-                 }
-                 
-                 SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
-                 SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);
-               }
-               else
-               {
-                 std::vector<StdSize> start(1) ; 
-                 std::vector<StdSize> count(1) ;
-                 if (domain->isEmpty())
-                 {
-                   start[0]=0 ;  
-                   count[0]=0 ;  
-                   SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
-                   SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);                 }
-                 else
-                 {
-                   start[0]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; 
-                   count[0]=domain->zoom_nj_srv ; 
-                   CArray<double,1> lat = domain->latvalue_srv(Range(fromStart,toEnd,domain->zoom_ni_srv)) ;
-                   SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0,&start,&count);
-
-                   start[0]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; 
-                   count[0]=domain->zoom_ni_srv ; 
-                   CArray<double,1> lon=domain->lonvalue_srv(Range(0,domain->zoom_ni_srv-1)) ;
-                   SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0,&start,&count);
+                   std::vector<StdSize> start(1) ; 
+                   std::vector<StdSize> count(1) ;
+                   if (domain->isEmpty())
+                   {
+                     start[0]=0 ;  
+                     count[0]=0 ;  
+                     SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
+                     SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);                 }
+                   else
+                   {
+                     start[0]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; 
+                     count[0]=domain->zoom_nj_srv ; 
+                     CArray<double,1> lat = domain->latvalue_srv(Range(fromStart,toEnd,domain->zoom_ni_srv)) ;
+                     SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0,&start,&count);
+
+                     start[0]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; 
+                     count[0]=domain->zoom_ni_srv ; 
+                     CArray<double,1> lon=domain->lonvalue_srv(Range(0,domain->zoom_ni_srv-1)) ;
+                     SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0,&start,&count);
+                   }
+                   break;
                  }
                }
@@ -273,4 +313,140 @@
       }
 
+      void CNc4DataOutput::writeUnstructuredDomain(CDomain* domain)
+      {
+         CContext* context = CContext::getCurrent() ;
+         CContextServer* server=context->server ;
+         
+         if (domain->IsWritten(this->filename)) return;
+         domain->checkAttributes();
+         
+         if (domain->isEmpty()) 
+           if (SuperClass::type==MULTI_FILE) return ;
+
+         std::vector<StdString> dim0, dim1;
+         StdString domid     = (!domain->name.isEmpty())
+                             ? domain->name.getValue() : domain->getId();
+         StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
+
+
+         StdString dimXid = StdString("cell").append(appendDomid);
+         StdString dimVertId = StdString("nvertex").append(appendDomid);
+        
+         string lonid,latid,bounds_lonid,bounds_latid ;
+
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE) :
+            {
+               lonid = StdString("lon").append(appendDomid);
+               latid = StdString("lat").append(appendDomid);
+               dim0.push_back(dimXid);
+
+               SuperClassWriter::addDimension(dimXid, domain->zoom_nj_srv);
+               SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+               SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+               
+               bounds_lonid = StdString("bounds_lon").append(appendDomid);
+               bounds_latid = StdString("bounds_lat").append(appendDomid);
+              
+               
+               this->writeAxisAttributes(lonid, "X", "longitude", "Longitude", "degrees_east", domid);
+               if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_lonid, &lonid);
+               this->writeAxisAttributes(latid, "Y", "latitude", "Latitude", "degrees_north", domid);
+               if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_latid, &latid);
+               if (domain->hasBounds) SuperClassWriter::addDimension(dimVertId, domain->nvertex);
+               dim0.clear();
+               if (domain->hasBounds)
+               { 
+                 dim0.push_back(dimXid);
+                 dim0.push_back(dimVertId);
+                 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0);
+                 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0);
+               }
+               
+               dim0.clear();
+               dim0.push_back(dimXid);
+
+               SuperClassWriter::definition_end();
+
+               SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0);
+               SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0);
+               
+               if (domain->hasBounds)
+               { 
+                 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0);
+                 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0);
+               }
+               SuperClassWriter::definition_start();
+               break ;
+            }
+
+            case (ONE_FILE) :
+            {
+               lonid = StdString("lon").append(appendDomid);
+               latid = StdString("lat").append(appendDomid);
+               bounds_lonid = StdString("bounds_lon").append(appendDomid);
+               bounds_latid = StdString("bounds_lat").append(appendDomid);
+               dim0.push_back(dimXid);
+               SuperClassWriter::addDimension(dimXid, domain->nj_glo);
+               SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+               SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+               this->writeAxisAttributes(lonid, "X", "longitude", "Longitude", "degrees_east", domid);
+               if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_lonid, &lonid);
+               this->writeAxisAttributes(latid, "Y", "latitude", "Latitude", "degrees_north", domid);                                           
+               if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_latid, &latid);
+               if (domain->hasBounds) SuperClassWriter::addDimension(dimVertId, domain->nvertex);
+               dim0.clear();
+               
+               if (domain->hasBounds) 
+               {
+                 dim0.push_back(dimXid);
+                 dim0.push_back(dimVertId);
+                 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0);
+                 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0);
+               }
+               
+               SuperClassWriter::definition_end();
+               
+               std::vector<StdSize> start(1), startBounds(2) ; 
+               std::vector<StdSize> count(1), countBounds(2) ;
+               if (domain->isEmpty())
+               {
+                 start[0]=0 ;  
+                 count[0]=0 ;  
+                 startBounds[0]=0 ;  
+                 countBounds[0]=domain->nvertex ;
+                 startBounds[1]=0 ;  
+                 countBounds[1]=0 ;  
+               }
+               else
+               {
+                 start[0]=domain->zoom_jbegin_srv-domain->zoom_jbegin ; 
+                 count[0]=domain->zoom_nj_srv ; 
+                 startBounds[0]=0 ;  
+                 countBounds[0]=domain->nvertex ;
+                 startBounds[1]=domain->zoom_jbegin_srv-domain->zoom_jbegin ; 
+                 countBounds[1]=domain->zoom_nj_srv ;   
+               }
+               SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
+               SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);
+               if (domain->hasBounds) 
+               {
+                 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0,&start,&count);
+                 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0,&startBounds,&countBounds);
+               }
+ 
+               
+               SuperClassWriter::definition_start();
+
+               break;
+            }           
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+         domain->addRelFile(this->filename);
+      }
       //--------------------------------------------------------------
 
@@ -334,5 +510,5 @@
      void CNc4DataOutput::writeTimeDimension_(void)
      {
-       SuperClassWriter::addDimension(string("time_counter"));
+       SuperClassWriter::addDimension("time_counter");
      }
       //--------------------------------------------------------------
@@ -355,18 +531,23 @@
          StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
  
-         bool isCurvilinear = domain->isCurvilinear ; 
+//         bool isCurvilinear = domain->isCurvilinear ; 
+//         bool isCurvilinear = (domain->type == CDomain::type_attr::curvilinear) ;
          
          StdString dimXid,dimYid ;
         
-         if (isCurvilinear)
-         {
-           dimXid     = StdString("x").append(appendDomid);
-           dimYid     = StdString("y").append(appendDomid);
-         }
-         else
-         {
-           dimXid     = StdString("lon").append(appendDomid);
-           dimYid     = StdString("lat").append(appendDomid);
-         }
+         switch (domain->type)
+         {
+           case CDomain::type_attr::curvilinear :
+             dimXid     = StdString("x").append(appendDomid);
+             dimYid     = StdString("y").append(appendDomid);
+             break ;
+           case CDomain::type_attr::regular :
+             dimXid     = StdString("lon").append(appendDomid);
+             dimYid     = StdString("lat").append(appendDomid);
+             break ;
+           case CDomain::type_attr::unstructured :
+             dimXid     = StdString("cell").append(appendDomid);
+             break ;
+        }
          
 /* 
@@ -388,14 +569,15 @@
                         ( field->prec.getValue() == 4))
                         ? NC_FLOAT : NC_DOUBLE;
-         bool wtime   = !(!field->operation.isEmpty() &&
-                         ( field->operation.getValue().compare("once") == 0));
+         bool wtime   = !(!field->operation.isEmpty() && field->foperation->timeType() == func::CFunctor::once);
                          
          if (wtime)
          {
-            StdOStringStream oss;
-            oss << "time_" << field->operation.getValue()
-                << "_" << field->getRelFile()->output_freq.getValue();
-
-            coodinates.push_back(oss.str());
+            
+            //StdOStringStream oss;
+           // oss << "time_" << field->operation.getValue()
+           //     << "_" << field->getRelFile()->output_freq.getValue();
+          //oss 
+            if (field->foperation->timeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant"));
+            else if (field->foperation->timeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered"));
             dims.push_back(timeid);
          }
@@ -409,34 +591,19 @@
          }
 
-         if (isCurvilinear)
-         {
-            coodinates.push_back(StdString("nav_lat").append(appendDomid));
-            coodinates.push_back(StdString("nav_lon").append(appendDomid));
-         }
-         else
-         {
+         switch (domain->type)
+         {
+           case CDomain::type_attr::curvilinear :
+             coodinates.push_back(StdString("nav_lon").append(appendDomid));
+             coodinates.push_back(StdString("nav_lat").append(appendDomid));
+             break;
+           case CDomain::type_attr::regular :             
+           case CDomain::type_attr::unstructured :   
+            coodinates.push_back(StdString("lon").append(appendDomid));
             coodinates.push_back(StdString("lat").append(appendDomid));
-            coodinates.push_back(StdString("lon").append(appendDomid));
-         }
-
-         switch (SuperClass::type)
-         {
-            case (MULTI_FILE) :
-            {
-               dims.push_back(dimYid);
-               dims.push_back(dimXid);
-               break ;
-            }
-            case (ONE_FILE) :
-            {
-               dims.push_back(dimYid);
-               dims.push_back(dimXid);
-               break;
-            }
-            default :
-               ERROR("CNc4DataOutput::writeDomain(domain)",
-                     << "[ type = " << SuperClass::type << "]"
-                     << " not implemented yet !");
-         }
+             break;
+         }
+
+         if ( domain->type == CDomain::type_attr::curvilinear || type == CDomain::type_attr::regular)dims.push_back(dimYid);
+         dims.push_back(dimXid);
           
          SuperClassWriter::addVariable(fieldid, type, dims);
@@ -567,18 +734,21 @@
                              
          StdOStringStream oss;
-         oss << "time_" << field->operation.getValue()
-             << "_" << field->getRelFile()->output_freq.getValue();
+         string timeAxisId ;
+         if (field->foperation->timeType() == func::CFunctor::instant)  timeAxisId="time_instant" ;
+         else if (field->foperation->timeType() == func::CFunctor::centered)  timeAxisId="time_centered" ;
+
              
          CArray<double,1> time_data(1) ;
-        
-        bool wtime   = !(!field->operation.isEmpty() &&
-                         ( field->operation.getValue().compare("once") == 0));
+         CArray<double,1> time_counter(1) ;
+                
+        bool wtime   = !(!field->operation.isEmpty() && (field->foperation->timeType() == func::CFunctor::once));
                                  
         if (wtime)
         {
-          if (field->operation.getValue()=="instant") time_data(0) = Time(*field->last_Write_srv)
-                                                                      -Time(context->calendar->getTimeOrigin());
-          else time_data(0) = (Time(*field->last_Write_srv)+Time(*field->lastlast_Write_srv))/2
-                                -Time(context->calendar->getTimeOrigin());
+          time_counter(0)= (Time(*field->last_Write_srv)+Time(*field->lastlast_Write_srv))/2 -Time(context->calendar->getTimeOrigin());
+          if (field->foperation->timeType() == func::CFunctor::instant) 
+            time_data(0) = Time(*field->last_Write_srv)-Time(context->calendar->getTimeOrigin());
+          else if (field->foperation->timeType() == func::CFunctor::centered) time_data(0) = time_counter(0);
+          
          }
          
@@ -599,5 +769,9 @@
               {
                  SuperClassWriter::writeData(field_data3D, fieldid, isCollective, field->getNStep()-1);
-                 if (wtime) SuperClassWriter::writeData(time_data, oss.str(), isCollective, field->getNStep()-1);
+                 if (wtime) 
+                 {
+                   SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep()-1);
+                   SuperClassWriter::writeData(time_counter, string("time_counter"), isCollective, field->getNStep()-1);
+                 }
                  break ;
               }
@@ -618,5 +792,9 @@
                  }
                  SuperClassWriter::writeData(field_data3D, fieldid, isCollective, field->getNStep()-1,&start,&count );
-                 if (wtime) SuperClassWriter::writeTimeAxisData(time_data, oss.str(), isCollective, field->getNStep()-1,isRoot );
+                 if (wtime) 
+                 {
+                   SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep()-1,isRoot );
+                   SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep()-1,isRoot );
+                 }
                  break;
               }
@@ -634,5 +812,9 @@
               {
                 SuperClassWriter::writeData(field_data2D, fieldid, isCollective, field->getNStep()-1);
-                if (wtime) SuperClassWriter::writeData(time_data, oss.str(), isCollective, field->getNStep()-1);
+                if (wtime) 
+                {
+                  SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep()-1);
+                  SuperClassWriter::writeData(time_counter, string("time_counter"), isCollective, field->getNStep()-1);
+                }
                 break;
               }
@@ -653,5 +835,9 @@
 
                  SuperClassWriter::writeData(field_data2D, fieldid, isCollective, field->getNStep()-1,&start,&count);
-                 if (wtime) SuperClassWriter::writeTimeAxisData(time_data, oss.str(), isCollective, field->getNStep()-1,isRoot);
+                 if (wtime) 
+                 {
+                   SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep()-1,isRoot);
+                   SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep()-1,isRoot);
+                 }                   
                  break; 
               
@@ -669,11 +855,16 @@
          StdOStringStream oss;
          
-         if (field->operation.getValue().compare("once") == 0) return ;
-                         
-         oss << "time_" << field->operation.getValue()
-             << "_" << field->getRelFile()->output_freq.getValue();
-
+//         if (field->operation.getValue().compare("once") == 0) return ;
+         if (field->foperation->timeType() == func::CFunctor::once) return ;
+                                
+//         oss << "time_" << field->operation.getValue()
+//             << "_" << field->getRelFile()->output_freq.getValue();
+         
+         string  axisid ;   
+         if (field->foperation->timeType() == func::CFunctor::centered) axisid="time_centered" ;
+         else if (field->foperation->timeType() == func::CFunctor::instant) axisid="time_instant" ;
+         
          std::vector<StdString> dims;
-         StdString axisid = oss.str();
+//         StdString axisid = oss.str();
          StdString timeid = StdString("time_counter");
 
@@ -682,4 +873,5 @@
          {
             SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims);
+            
             CDate timeOrigin=cal->getTimeOrigin() ;
 //            StdOStringStream oss2;
@@ -693,4 +885,22 @@
                 strTimeOrigin);
          }
+
+         dims.clear() ;
+         axisid = "time_counter" ;
+         timeid = "time_counter" ;
+
+         dims.push_back(timeid);
+         if (!SuperClassWriter::varExist(axisid))
+         {
+            SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims);
+            SuperClassWriter::addAttribute("axis", string("T"), &axisid);
+            CDate timeOrigin=cal->getTimeOrigin() ;
+            StdString strTimeOrigin=timeOrigin.toString() ;
+            this->writeTimeAxisAttributes
+               (axisid, cal->getType(),
+                StdString("seconds since ").append(strTimeOrigin),
+                strTimeOrigin);
+         }         
+         
 
       }
Index: XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.hpp	(revision 448)
+++ XIOS/trunk/src/output/nc4_data_output.hpp	(revision 449)
@@ -52,5 +52,5 @@
 
          protected :
-         
+            void writeUnstructuredDomain (CDomain* domain);         
             void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid);
             void writeLocalAttributes_IOIPSL(int ibegin, int ni, int jbegin, int nj, int ni_glo, int nj_glo, int rank, int size) ;
Index: XIOS/trunk/src/test/test_unstruct.f90
===================================================================
--- XIOS/trunk/src/test/test_unstruct.f90	(revision 449)
+++ XIOS/trunk/src/test/test_unstruct.f90	(revision 449)
@@ -0,0 +1,157 @@
+PROGRAM test_client
+
+  USE xios
+  USE mod_wait
+  IMPLICIT NONE
+  INCLUDE "mpif.h"
+  INTEGER :: rank
+  INTEGER :: size
+  INTEGER :: ierr
+  
+  CHARACTER(len=*),PARAMETER :: id="client"
+  INTEGER :: comm
+  TYPE(xios_time)      :: dtime
+  TYPE(xios_context) :: ctx_hdl
+  INTEGER,PARAMETER :: ni_glo=100
+  INTEGER,PARAMETER :: nj_glo=100 
+  INTEGER,PARAMETER :: llm=5 
+  DOUBLE PRECISION  :: lval(llm)=1
+  TYPE(xios_field) :: field_hdl
+  TYPE(xios_fieldgroup) :: fieldgroup_hdl
+  TYPE(xios_file) :: file_hdl
+  LOGICAL :: ok
+  
+  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo
+  DOUBLE PRECISION,DIMENSION(4,ni_glo,nj_glo) :: bounds_lon_glo,bounds_lat_glo
+  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm)
+  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:) ;
+  DOUBLE PRECISION,ALLOCATABLE :: bounds_lon(:,:,:),bounds_lat(:,:,:) ;
+  INTEGER :: ni,ibegin,iend,nj,jbegin,jend
+  INTEGER :: i,j,l,ts,n
+
+  CALL xios_initialize(id,return_comm=comm)
+! CALL MPI_INIT(ierr)
+  CALL MPI_COMM_RANK(comm,rank,ierr)
+  CALL MPI_COMM_SIZE(comm,size,ierr)
+  
+  CALL init_wait
+  
+  
+  DO j=1,nj_glo
+    DO i=1,ni_glo
+      lon_glo(i,j)=(i-1)+(j-1)*ni_glo
+      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo
+      bounds_lat_glo(1,i,j)=lat_glo(i,j)-0.5
+      bounds_lat_glo(2,i,j)=lat_glo(i,j)-0.5
+      bounds_lat_glo(3,i,j)=lat_glo(i,j)+0.5
+      bounds_lat_glo(4,i,j)=lat_glo(i,j)+0.5
+      bounds_lon_glo(1,i,j)=lon_glo(i,j)-0.5
+      bounds_lon_glo(2,i,j)=lon_glo(i,j)-0.5
+      bounds_lon_glo(3,i,j)=lon_glo(i,j)+0.5
+      bounds_lon_glo(4,i,j)=lon_glo(i,j)+0.5
+      DO l=1,llm
+        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l
+      ENDDO
+    ENDDO
+  ENDDO
+  ni=ni_glo ; ibegin=1
+
+  jbegin=1
+  DO n=0,size-1
+    nj=nj_glo/size
+    IF (n<MOD(nj_glo,size)) nj=nj+1
+    IF (n==rank) exit 
+    jbegin=jbegin+nj
+  ENDDO
+  
+  iend=ibegin+ni-1 ; jend=jbegin+nj-1
+
+  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(ni,nj,llm),lonvalue(ni*nj))
+  ALLOCATE(bounds_lon(4,ni,nj),bounds_lat(4,ni,nj))
+  lon(:,:)=lon_glo(ibegin:iend,jbegin:jend)
+  lat(:,:)=lat_glo(ibegin:iend,jbegin:jend)
+  bounds_lon(:,:,:)=bounds_lon_glo(:,ibegin:iend,jbegin:jend)
+  bounds_lat(:,:,:)=bounds_lat_glo(:,ibegin:iend,jbegin:jend)
+  field_A(1:ni,1:nj,:)=field_A_glo(ibegin:iend,jbegin:jend,:)
+ 
+
+  CALL xios_context_initialize("test",comm)
+  CALL xios_get_handle("test",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+  
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+!  CALL xios_set_context_attr("test",start_date="01/01/2000 - 00:00:00")
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_axis_attr("axis_A",size=llm ,value=lval) ;
+!  CALL xios_set_domain_attr("domain_A",ni_glo=1, nj_glo=nj_glo*nj_glo, ibegin=1, ni=1,jbegin=(jbegin-1)*ni_glo+1,nj=nj*ni_glo)
+  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo*nj_glo, ibegin=(jbegin-1)*ni_glo+1, ni=nj*ni_glo)
+  !CALL xios_set_domain_attr("domain_A",zoom_ni=3,zoom_ibegin=3,zoom_nj=3,zoom_jbegin=6)
+  CALL xios_set_domain_attr("domain_A",data_dim=1,type='unstructured')
+  CALL xios_set_domain_attr("domain_A",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/)))
+  CALL xios_set_domain_attr("domain_A", bounds_lon=RESHAPE(bounds_lon,(/4,ni*nj/)) )
+  CALL xios_set_domain_attr("domain_A",bounds_lat=RESHAPE(bounds_lat,(/4,ni*nj/)) )
+  CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.)
+  
+  CALL xios_get_handle("field_definition",fieldgroup_hdl)
+  CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B")
+  CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B")
+  
+  CALL xios_get_handle("output",file_hdl)
+  CALL xios_add_child(file_hdl,field_hdl,"field_C")
+  CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_C")
+    
+ 
+    dtime%second=3600
+    CALL xios_set_timestep(dtime) 
+    
+!    ni=0 ; lonvalue(:)=0
+!    CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue=lonvalue)
+    
+!    print *,"ni",ni
+!    print *,"lonvalue",lonvalue ;
+
+    CALL xios_is_defined_field_attr("field_A",enabled=ok)
+    PRINT *,"field_A : attribute enabled is defined ? ",ok
+    IF (ok) THEN
+      CALL xios_get_field_attr("field_A",enabled=ok)
+      PRINT *,"field_A : attribute enabled = ",ok
+    ENDIF
+    CALL xios_is_defined_field_attr("field_C",enabled=ok)
+    PRINT *,"field_C : attribute enabled is defined ? ",ok
+    IF (ok) THEN
+      CALL xios_get_field_attr("field_C",enabled=ok)
+      PRINT *,"field_C : attribute enabled = ",ok
+    ENDIF
+      
+    CALL xios_solve_inheritance()
+    CALL xios_is_defined_field_attr("field_C",enabled=ok)
+    PRINT *,"field_C : attribute enabled is defined ? ",ok
+    IF (ok) THEN
+      CALL xios_get_field_attr("field_C",enabled=ok)
+      PRINT *,"field_C : attribute enabled = ",ok
+    ENDIF
+    CALL xios_close_context_definition()
+    
+    PRINT*,"field field_A is active ? ",xios_field_is_active("field_A")
+    DO ts=1,24*10
+      field_A=field_A+100000
+      CALL xios_update_calendar(ts)
+      CALL xios_send_field("field_A",RESHAPE(field_A,(/ni*nj,llm/)))
+      if (ts==12) CALL xios_send_field("field_once",RESHAPE(field_A,(/ni*nj,llm/)))
+!      field_A=field_A+100000
+!     CALL wait_us(5000) ;
+    ENDDO
+  
+    CALL xios_context_finalize()
+    CALL xios_finalize()
+  
+!  CALL MPI_FINALIZE(ierr)
+  
+END PROGRAM test_client
+
+
+  
+
+  
