Index: /XIOS/trunk/src/config/field_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/field_attribute.conf	(revision 675)
+++ /XIOS/trunk/src/config/field_attribute.conf	(revision 676)
@@ -14,4 +14,5 @@
 DECLARE_ATTRIBUTE(bool,      enabled)
 DECLARE_ATTRIBUTE(bool,      read_access)
+DECLARE_ATTRIBUTE(bool,      indexed_output)
 
 DECLARE_ATTRIBUTE(StdString, domain_ref)
Index: /XIOS/trunk/src/data_output.cpp
===================================================================
--- /XIOS/trunk/src/data_output.cpp	(revision 675)
+++ /XIOS/trunk/src/data_output.cpp	(revision 676)
@@ -14,21 +14,10 @@
       //----------------------------------------------------------------
 
-      void CDataOutput::writeGrid(CGrid* grid)
+      void CDataOutput::writeGrid(CGrid* grid, bool allowCompressedOutput /*= false*/)
       {
-//         if (grid->domain_ref.isEmpty())
-//            ERROR("CDataOutput::writeGrid(grid)",
-//                   << " domain is not defined !");
-//
-//         if (grid->axis_ref.isEmpty())
-//         {
-//            this->writeGrid(CDomain::get(grid->domain_ref.getValue()));
-//         }
-//         else
-//         {
-//            this->writeGrid(CDomain::get(grid->domain_ref.getValue()),
-//                            CAxis::get(grid->axis_ref.getValue()));
-//         }
-//        this->writeGrid(grid->domain, grid->axis);
         this->writeGrid(grid->getDomains(), grid->getAxis());
+
+        if (allowCompressedOutput)
+          writeGridCompressed_(grid);
       }
 
@@ -57,5 +46,5 @@
       //----------------------------------------------------------------
 
-      void CDataOutput::writeGrid(CDomain* domain,CAxis* axis)
+      void CDataOutput::writeGrid(CDomain* domain, CAxis* axis)
       {
          this->writeDomain_(domain);
@@ -98,5 +87,6 @@
       void CDataOutput::writeFieldGrid(CField* field)
       {
-         this->writeGrid(field->getRelGrid());
+         this->writeGrid(field->getRelGrid(),
+                         !field->indexed_output.isEmpty() && field->indexed_output);
       }
 
Index: /XIOS/trunk/src/data_output.hpp
===================================================================
--- /XIOS/trunk/src/data_output.hpp	(revision 675)
+++ /XIOS/trunk/src/data_output.hpp	(revision 676)
@@ -20,7 +20,7 @@
 
             /// Ecriture ///
-            void writeFile     (CFile*  file);
-            void writeAttribute(CVariable*  var);
-            void syncFile     (void);
+            void writeFile     (CFile*     file);
+            void writeAttribute(CVariable* var);
+            void syncFile      (void);
             void closeFile     (void);
             void writeField    (CField* field);
@@ -40,21 +40,21 @@
 
             /// Ecriture ///
-            void writeGrid(CGrid* grid);
-            void writeGrid(CDomain* domain,
-                           CAxis*   axis);
+            void writeGrid(CGrid* grid, bool allowCompressedOutput = false);
+            void writeGrid(CDomain* domain, CAxis* axis);
             void writeGrid(CDomain* domain);
             void writeGrid(std::vector<CDomain*> domain, std::vector<CAxis*> axis);
 
-            virtual void writeFile_       (CFile*     file)   = 0;
-            virtual void writeAttribute_(CVariable*  var) = 0 ;
-            virtual void closeFile_       (void)                                            = 0;
-            virtual void syncFile_       (void)                                            = 0;
-            virtual void writeField_      (CField*    field)  = 0;
-            virtual void writeFieldData_  (CField*    field)  = 0;
-            virtual void writeDomain_     (CDomain*   domain) = 0;
-            virtual void writeTimeDimension_ (void) = 0;
-            virtual void writeAxis_       (CAxis*     axis)   = 0;
-            virtual void writeTimeAxis_   (CField*    field,
-                                           const shared_ptr<CCalendar> cal)    = 0;
+            virtual void writeFile_     (CFile*      file)   = 0;
+            virtual void writeAttribute_(CVariable*  var)    = 0;
+            virtual void closeFile_     (void)               = 0;
+            virtual void syncFile_      (void)               = 0;
+            virtual void writeField_    (CField*     field)  = 0;
+            virtual void writeFieldData_(CField*     field)  = 0;
+            virtual void writeDomain_   (CDomain*    domain) = 0;
+            virtual void writeAxis_     (CAxis*      axis)   = 0;
+            virtual void writeGridCompressed_(CGrid* grid)   = 0;
+            virtual void writeTimeDimension_(void)           = 0;
+            virtual void writeTimeAxis_ (CField*     field,
+                                         const shared_ptr<CCalendar> cal) = 0;
 
             /// PropriÃ©tÃ©s protÃ©gÃ©es ///
Index: /XIOS/trunk/src/distribution_client.hpp
===================================================================
--- /XIOS/trunk/src/distribution_client.hpp	(revision 675)
+++ /XIOS/trunk/src/distribution_client.hpp	(revision 676)
@@ -46,4 +46,9 @@
     bool isDataDistributed() { return isDataDistributed_; }
 
+    static int getDomainIndex(const int& dataIIndex, const int& dataJIndex,
+                                     const int& dataIBegin, const int& dataJBegin,
+                                     const int& dataDim, const int& ni, int& j);
+    static int getAxisIndex(const int& dataIndex, const int& dataBegin, const int& ni);
+
   protected:
     void createGlobalIndex();
@@ -61,9 +66,4 @@
     //! Create local index of an axis
     void createLocalAxisDataIndex();
-
-    inline int getDomainIndex(const int& dataIIndex, const int& dataJIndex,
-                              const int& dataIBegin, const int& dataJBegin,
-                              const int& dataDim, const int& ni, int& j);
-    inline int getAxisIndex(const int& dataIndex, const int& dataBegin, const int& ni);
 
     template<int N>
Index: /XIOS/trunk/src/distribution_server.cpp
===================================================================
--- /XIOS/trunk/src/distribution_server.cpp	(revision 675)
+++ /XIOS/trunk/src/distribution_server.cpp	(revision 676)
@@ -146,16 +146,29 @@
 }
 
+/*!
+  Transforms local indexes owned by the server into global indexes
+  \param [in/out] indexes on input, local indexes of the server,
+                          on output, the corresponding global indexes
+*/
+void CDistributionServer::computeGlobalIndex(CArray<int,1>& indexes) const
+{
+  for (int i = 0; i < indexes.numElements(); ++i)
+  {
+    indexes(i) = globalIndex_(indexes(i));
+  }
+}
 
-std::vector<int> CDistributionServer::getZoomBeginGlobal() const
+
+const std::vector<int>& CDistributionServer::getZoomBeginGlobal() const
 {
   return nZoomBeginGlobal_;
 }
 
-std::vector<int> CDistributionServer::getZoomBeginServer() const
+const std::vector<int>& CDistributionServer::getZoomBeginServer() const
 {
   return nZoomBegin_;
 }
 
-std::vector<int> CDistributionServer::getZoomSizeServer() const
+const std::vector<int>& CDistributionServer::getZoomSizeServer() const
 {
   return nZoomSize_;
Index: /XIOS/trunk/src/distribution_server.hpp
===================================================================
--- /XIOS/trunk/src/distribution_server.hpp	(revision 675)
+++ /XIOS/trunk/src/distribution_server.hpp	(revision 676)
@@ -34,10 +34,11 @@
     virtual ~CDistributionServer();
 
-    std::vector<int> getZoomBeginGlobal() const;
-    std::vector<int> getZoomBeginServer() const;
-    std::vector<int> getZoomSizeServer() const;
+    const std::vector<int>& getZoomBeginGlobal() const;
+    const std::vector<int>& getZoomBeginServer() const;
+    const std::vector<int>& getZoomSizeServer() const;
 
     virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex);
     virtual void computeLocalIndex(CArray<size_t,1>& globalIndex);
+    virtual void computeGlobalIndex(CArray<int,1>& indexes) const;
 
   protected:
Index: /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 675)
+++ /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 676)
@@ -313,4 +313,27 @@
 
 
+  void cxios_set_field_indexed_output(field_Ptr field_hdl, bool indexed_output)
+  {
+    CTimer::get("XIOS").resume();
+    field_hdl->indexed_output.setValue(indexed_output);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_field_indexed_output(field_Ptr field_hdl, bool* indexed_output)
+  {
+    CTimer::get("XIOS").resume();
+    *indexed_output = field_hdl->indexed_output.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_field_indexed_output(field_Ptr field_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = field_hdl->indexed_output.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_field_level(field_Ptr field_hdl, int level)
   {
Index: /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 675)
+++ /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 676)
@@ -339,4 +339,27 @@
 
 
+  void cxios_set_fieldgroup_indexed_output(fieldgroup_Ptr fieldgroup_hdl, bool indexed_output)
+  {
+    CTimer::get("XIOS").resume();
+    fieldgroup_hdl->indexed_output.setValue(indexed_output);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_fieldgroup_indexed_output(fieldgroup_Ptr fieldgroup_hdl, bool* indexed_output)
+  {
+    CTimer::get("XIOS").resume();
+    *indexed_output = fieldgroup_hdl->indexed_output.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_fieldgroup_indexed_output(fieldgroup_Ptr fieldgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = fieldgroup_hdl->indexed_output.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_fieldgroup_level(fieldgroup_Ptr fieldgroup_hdl, int level)
   {
Index: /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90	(revision 675)
+++ /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90	(revision 676)
@@ -231,4 +231,23 @@
 
 
+    SUBROUTINE cxios_set_field_indexed_output(field_hdl, indexed_output) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: indexed_output
+    END SUBROUTINE cxios_set_field_indexed_output
+
+    SUBROUTINE cxios_get_field_indexed_output(field_hdl, indexed_output) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      LOGICAL (KIND=C_BOOL)             :: indexed_output
+    END SUBROUTINE cxios_get_field_indexed_output
+
+    FUNCTION cxios_is_defined_field_indexed_output(field_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_indexed_output
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+    END FUNCTION cxios_is_defined_field_indexed_output
+
+
     SUBROUTINE cxios_set_field_level(field_hdl, level) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 675)
+++ /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 676)
@@ -252,4 +252,23 @@
 
 
+    SUBROUTINE cxios_set_fieldgroup_indexed_output(fieldgroup_hdl, indexed_output) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: indexed_output
+    END SUBROUTINE cxios_set_fieldgroup_indexed_output
+
+    SUBROUTINE cxios_get_fieldgroup_indexed_output(fieldgroup_hdl, indexed_output) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      LOGICAL (KIND=C_BOOL)             :: indexed_output
+    END SUBROUTINE cxios_get_fieldgroup_indexed_output
+
+    FUNCTION cxios_is_defined_fieldgroup_indexed_output(fieldgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_indexed_output
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+    END FUNCTION cxios_is_defined_fieldgroup_indexed_output
+
+
     SUBROUTINE cxios_set_fieldgroup_level(fieldgroup_hdl, level) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90	(revision 675)
+++ /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90	(revision 676)
@@ -13,6 +13,6 @@
   SUBROUTINE xios(set_field_attr)  &
     ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-    , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+    , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -32,4 +32,6 @@
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_op
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: grid_ref
+      LOGICAL  , OPTIONAL, INTENT(IN) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
@@ -48,6 +50,6 @@
       CALL xios(set_field_attr_hdl_)   &
       ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-      , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+      , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr)
@@ -55,6 +57,6 @@
   SUBROUTINE xios(set_field_attr_hdl)  &
     ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-    , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+    , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -73,4 +75,6 @@
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_op
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: grid_ref
+      LOGICAL  , OPTIONAL, INTENT(IN) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
@@ -88,6 +92,6 @@
       CALL xios(set_field_attr_hdl_)  &
       ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-      , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+      , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr_hdl)
@@ -95,7 +99,7 @@
   SUBROUTINE xios(set_field_attr_hdl_)   &
     ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_  &
-    , operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_  &
-     )
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, indexed_output_, level_  &
+    , long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_  &
+    , valid_min_ )
 
     IMPLICIT NONE
@@ -114,4 +118,6 @@
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_op_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: grid_ref_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: indexed_output_
+      LOGICAL (KIND=C_BOOL) :: indexed_output__tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: level_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
@@ -173,4 +179,9 @@
       ENDIF
 
+      IF (PRESENT(indexed_output_)) THEN
+        indexed_output__tmp = indexed_output_
+        CALL cxios_set_field_indexed_output(field_hdl%daddr, indexed_output__tmp)
+      ENDIF
+
       IF (PRESENT(level_)) THEN
         CALL cxios_set_field_level(field_hdl%daddr, level_)
@@ -222,6 +233,6 @@
   SUBROUTINE xios(get_field_attr)  &
     ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-    , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+    , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -241,4 +252,6 @@
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_op
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: grid_ref
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
@@ -257,6 +270,6 @@
       CALL xios(get_field_attr_hdl_)   &
       ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-      , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+      , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr)
@@ -264,6 +277,6 @@
   SUBROUTINE xios(get_field_attr_hdl)  &
     ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-    , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+    , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -282,4 +295,6 @@
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_op
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: grid_ref
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
@@ -297,6 +312,6 @@
       CALL xios(get_field_attr_hdl_)  &
       ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-      , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+      , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr_hdl)
@@ -304,7 +319,7 @@
   SUBROUTINE xios(get_field_attr_hdl_)   &
     ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_  &
-    , operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_  &
-     )
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, indexed_output_, level_  &
+    , long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_  &
+    , valid_min_ )
 
     IMPLICIT NONE
@@ -323,4 +338,6 @@
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_op_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: grid_ref_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: indexed_output_
+      LOGICAL (KIND=C_BOOL) :: indexed_output__tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: level_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
@@ -382,4 +399,9 @@
       ENDIF
 
+      IF (PRESENT(indexed_output_)) THEN
+        CALL cxios_get_field_indexed_output(field_hdl%daddr, indexed_output__tmp)
+        indexed_output_ = indexed_output__tmp
+      ENDIF
+
       IF (PRESENT(level_)) THEN
         CALL cxios_get_field_level(field_hdl%daddr, level_)
@@ -431,6 +453,6 @@
   SUBROUTINE xios(is_defined_field_attr)  &
     ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-    , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+    , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -459,4 +481,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: grid_ref
       LOGICAL(KIND=C_BOOL) :: grid_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL(KIND=C_BOOL) :: indexed_output_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: level
       LOGICAL(KIND=C_BOOL) :: level_tmp
@@ -485,6 +509,6 @@
       CALL xios(is_defined_field_attr_hdl_)   &
       ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-      , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+      , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr)
@@ -492,6 +516,6 @@
   SUBROUTINE xios(is_defined_field_attr_hdl)  &
     ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-    , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+    , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -519,4 +543,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: grid_ref
       LOGICAL(KIND=C_BOOL) :: grid_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL(KIND=C_BOOL) :: indexed_output_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: level
       LOGICAL(KIND=C_BOOL) :: level_tmp
@@ -544,6 +570,6 @@
       CALL xios(is_defined_field_attr_hdl_)  &
       ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec  &
-      , read_access, scale_factor, standard_name, unit, valid_max, valid_min )
+      , enabled, field_ref, freq_offset, freq_op, grid_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr_hdl)
@@ -551,7 +577,7 @@
   SUBROUTINE xios(is_defined_field_attr_hdl_)   &
     ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_  &
-    , operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_  &
-     )
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, indexed_output_, level_  &
+    , long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_  &
+    , valid_min_ )
 
     IMPLICIT NONE
@@ -579,4 +605,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: grid_ref_
       LOGICAL(KIND=C_BOOL) :: grid_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: indexed_output_
+      LOGICAL(KIND=C_BOOL) :: indexed_output__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: level_
       LOGICAL(KIND=C_BOOL) :: level__tmp
@@ -657,4 +685,9 @@
       ENDIF
 
+      IF (PRESENT(indexed_output_)) THEN
+        indexed_output__tmp = cxios_is_defined_field_indexed_output(field_hdl%daddr)
+        indexed_output_ = indexed_output__tmp
+      ENDIF
+
       IF (PRESENT(level_)) THEN
         level__tmp = cxios_is_defined_field_level(field_hdl%daddr)
Index: /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 675)
+++ /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 676)
@@ -13,7 +13,7 @@
   SUBROUTINE xios(set_fieldgroup_attr)  &
     ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-    , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-     )
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+    , valid_min )
 
     IMPLICIT NONE
@@ -34,4 +34,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: grid_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(IN) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
@@ -50,7 +52,7 @@
       CALL xios(set_fieldgroup_attr_hdl_)   &
       ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-      , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-       )
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+      , valid_min )
 
   END SUBROUTINE xios(set_fieldgroup_attr)
@@ -58,7 +60,7 @@
   SUBROUTINE xios(set_fieldgroup_attr_hdl)  &
     ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-    , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-     )
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+    , valid_min )
 
     IMPLICIT NONE
@@ -78,4 +80,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: grid_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(IN) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
@@ -93,7 +97,7 @@
       CALL xios(set_fieldgroup_attr_hdl_)  &
       ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-      , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-       )
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+      , valid_min )
 
   END SUBROUTINE xios(set_fieldgroup_attr_hdl)
@@ -101,7 +105,7 @@
   SUBROUTINE xios(set_fieldgroup_attr_hdl_)   &
     ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_  &
-    , name_, operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_  &
-     )
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -121,4 +125,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: grid_ref_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: indexed_output_
+      LOGICAL (KIND=C_BOOL) :: indexed_output__tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: level_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
@@ -184,4 +190,9 @@
       ENDIF
 
+      IF (PRESENT(indexed_output_)) THEN
+        indexed_output__tmp = indexed_output_
+        CALL cxios_set_fieldgroup_indexed_output(fieldgroup_hdl%daddr, indexed_output__tmp)
+      ENDIF
+
       IF (PRESENT(level_)) THEN
         CALL cxios_set_fieldgroup_level(fieldgroup_hdl%daddr, level_)
@@ -233,7 +244,7 @@
   SUBROUTINE xios(get_fieldgroup_attr)  &
     ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-    , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-     )
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+    , valid_min )
 
     IMPLICIT NONE
@@ -254,4 +265,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: grid_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
@@ -270,7 +283,7 @@
       CALL xios(get_fieldgroup_attr_hdl_)   &
       ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-      , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-       )
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+      , valid_min )
 
   END SUBROUTINE xios(get_fieldgroup_attr)
@@ -278,7 +291,7 @@
   SUBROUTINE xios(get_fieldgroup_attr_hdl)  &
     ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-    , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-     )
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+    , valid_min )
 
     IMPLICIT NONE
@@ -298,4 +311,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: grid_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL (KIND=C_BOOL) :: indexed_output_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
@@ -313,7 +328,7 @@
       CALL xios(get_fieldgroup_attr_hdl_)  &
       ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-      , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-       )
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+      , valid_min )
 
   END SUBROUTINE xios(get_fieldgroup_attr_hdl)
@@ -321,7 +336,7 @@
   SUBROUTINE xios(get_fieldgroup_attr_hdl_)   &
     ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_  &
-    , name_, operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_  &
-     )
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -341,4 +356,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: grid_ref_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: indexed_output_
+      LOGICAL (KIND=C_BOOL) :: indexed_output__tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: level_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
@@ -404,4 +421,9 @@
       ENDIF
 
+      IF (PRESENT(indexed_output_)) THEN
+        CALL cxios_get_fieldgroup_indexed_output(fieldgroup_hdl%daddr, indexed_output__tmp)
+        indexed_output_ = indexed_output__tmp
+      ENDIF
+
       IF (PRESENT(level_)) THEN
         CALL cxios_get_fieldgroup_level(fieldgroup_hdl%daddr, level_)
@@ -453,7 +475,7 @@
   SUBROUTINE xios(is_defined_fieldgroup_attr)  &
     ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-    , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-     )
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+    , valid_min )
 
     IMPLICIT NONE
@@ -484,4 +506,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL(KIND=C_BOOL) :: indexed_output_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: level
       LOGICAL(KIND=C_BOOL) :: level_tmp
@@ -510,7 +534,7 @@
       CALL xios(is_defined_fieldgroup_attr_hdl_)   &
       ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-      , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-       )
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+      , valid_min )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr)
@@ -518,7 +542,7 @@
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)  &
     ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-    , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-     )
+    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+    , valid_min )
 
     IMPLICIT NONE
@@ -548,4 +572,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: indexed_output
+      LOGICAL(KIND=C_BOOL) :: indexed_output_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: level
       LOGICAL(KIND=C_BOOL) :: level_tmp
@@ -573,7 +599,7 @@
       CALL xios(is_defined_fieldgroup_attr_hdl_)  &
       ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name  &
-      , name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max, valid_min  &
-       )
+      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  &
+      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  &
+      , valid_min )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)
@@ -581,7 +607,7 @@
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_)   &
     ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_  &
-    , name_, operation_, prec_, read_access_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_  &
-     )
+    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -611,4 +637,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref_
       LOGICAL(KIND=C_BOOL) :: group_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: indexed_output_
+      LOGICAL(KIND=C_BOOL) :: indexed_output__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: level_
       LOGICAL(KIND=C_BOOL) :: level__tmp
@@ -694,4 +722,9 @@
       ENDIF
 
+      IF (PRESENT(indexed_output_)) THEN
+        indexed_output__tmp = cxios_is_defined_fieldgroup_indexed_output(fieldgroup_hdl%daddr)
+        indexed_output_ = indexed_output__tmp
+      ENDIF
+
       IF (PRESENT(level_)) THEN
         level__tmp = cxios_is_defined_fieldgroup_level(fieldgroup_hdl%daddr)
Index: /XIOS/trunk/src/node/axis.cpp
===================================================================
--- /XIOS/trunk/src/node/axis.cpp	(revision 675)
+++ /XIOS/trunk/src/node/axis.cpp	(revision 676)
@@ -8,4 +8,5 @@
 #include "context.hpp"
 #include "context_client.hpp"
+#include "context_server.hpp"
 #include "xios_spl.hpp"
 #include "inverse_axis.hpp"
@@ -14,4 +15,5 @@
 #include "server_distribution_description.hpp"
 #include "client_server_mapping_distributed.hpp"
+#include "distribution_client.hpp"
 
 namespace xios {
@@ -22,5 +24,6 @@
       : CObjectTemplate<CAxis>()
       , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false)
-      , isDistributed_(false), hasBounds_(false)
+      , isDistributed_(false), hasBounds_(false), isCompressible_(false)
+      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
       , transformationMap_(), global_zoom_begin(0), global_zoom_size(0)
    {
@@ -30,5 +33,6 @@
       : CObjectTemplate<CAxis>(id)
       , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false)
-      , isDistributed_(false), hasBounds_(false)
+      , isDistributed_(false), hasBounds_(false), isCompressible_(false)
+      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
       , transformationMap_(), global_zoom_begin(0), global_zoom_size(0)
    {
@@ -50,4 +54,9 @@
    }
 
+   bool CAxis::isWrittenCompressed(const StdString& filename) const
+   {
+      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end());
+   }
+
    bool CAxis::isDistributed(void) const
    {
@@ -55,7 +64,56 @@
    }
 
+   /*!
+    * Test whether the data defined on the axis can be outputted in a compressed way.
+    * 
+    * \return true if and only if a mask was defined for this axis
+    */
+   bool CAxis::isCompressible(void) const
+   {
+      return isCompressible_;
+   }
+
    void CAxis::addRelFile(const StdString & filename)
    {
       this->relFiles.insert(filename);
+   }
+
+   void CAxis::addRelFileCompressed(const StdString& filename)
+   {
+      this->relFilesCompressed.insert(filename);
+   }
+
+   //----------------------------------------------------------------
+
+   const std::vector<int>& CAxis::getIndexesToWrite(void) const
+   {
+     return indexesToWrite;
+   }
+
+   /*!
+     Returns the number of indexes written by each server.
+     \return the number of indexes written by each server
+   */
+   int CAxis::getNumberWrittenIndexes() const
+   {
+     return numberWrittenIndexes_;
+   }
+
+   /*!
+     Returns the total number of indexes written by the servers.
+     \return the total number of indexes written by the servers
+   */
+   int CAxis::getTotalNumberWrittenIndexes() const
+   {
+     return totalNumberWrittenIndexes_;
+   }
+
+   /*!
+     Returns the offset of indexes written by each server.
+     \return the offset of indexes written by each server
+   */
+   int CAxis::getOffsetWrittenIndexes() const
+   {
+     return offsetWrittenIndexes_;
    }
 
@@ -171,4 +229,9 @@
   }
 
+  void CAxis::checkEligibilityForCompressedOutput()
+  {
+    // We don't check if the mask is valid here, just if a mask has been defined at this point.
+    isCompressible_ = !mask.isEmpty();
+  }
 
   bool CAxis::dispatchEvent(CEventServer& event)
@@ -277,4 +340,20 @@
     }
 
+    std::set<int> writtenInd;
+    if (isCompressible_)
+    {
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
+
+        if (ind >= 0 && ind < ni && mask(ind))
+        {
+          ind += ibegin;
+          if (ind >= global_zoom_begin && ind <= zoom_end)
+            writtenInd.insert(ind);
+        }
+      }
+    }
+
     std::vector<int> nGlobDomain(1);
     nGlobDomain[0] = n_glo.getValue();
@@ -303,4 +382,5 @@
                                         iteVec = (globalAxisZoom).end();
     indSrv_.clear();
+    indWrittenSrv_.clear();
     for (; it != ite; ++it)
     {
@@ -315,4 +395,9 @@
           indSrv_[rank].push_back(globalIndexTmp[i]);
         }
+
+        if (writtenInd.count(globalIndexTmp[i]))
+        {
+          indWrittenSrv_[rank].push_back(globalIndexTmp[i]);
+        }
       }
     }
@@ -337,12 +422,28 @@
     CContext* context = CContext::getCurrent();
     CContextClient* client = context->client;
-    CEventClient event(getType(),EVENT_ID_NON_DISTRIBUTED_VALUE);
-
-    int zoom_end = global_zoom_begin+global_zoom_size-1;
-    int nb =0;
+    CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_VALUE);
+
+    int zoom_end = global_zoom_begin + global_zoom_size - 1;
+    int nb = 0;
     for (size_t idx = 0; idx < n; ++idx)
     {
       size_t globalIndex = begin + idx;
       if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nb;
+    }
+
+    int nbWritten = 0;
+    if (isCompressible_)
+    {
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, n);
+
+        if (ind >= 0 && ind < n && mask(ind))
+        {
+          ind += begin;
+          if (ind >= global_zoom_begin && ind <= zoom_end)
+            ++nbWritten;
+        }
+      }
     }
 
@@ -359,4 +460,24 @@
     }
 
+    CArray<int, 1> writtenInd(nbWritten);
+    nbWritten = 0;
+    if (isCompressible_)
+    {
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, n);
+
+        if (ind >= 0 && ind < n && mask(ind))
+        {
+          ind += begin;
+          if (ind >= global_zoom_begin && ind <= zoom_end)
+          {
+            writtenInd(nbWritten) = ind;
+            ++nbWritten;
+          }
+        }
+      }
+    }
+
     if (client->isServerLeader())
     {
@@ -366,10 +487,11 @@
       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
       {
-        // Use const int to ensure CMessage holds a copy of the value instead of just a reference
         msgs.push_back(CMessage());
         CMessage& msg = msgs.back();
         msg << this->getId();
         msg << val;
-        event.push(*itRank,1,msg);
+        if (isCompressible_)
+          msg << writtenInd;
+        event.push(*itRank, 1, msg);
       }
       client->sendEvent(event);
@@ -390,4 +512,5 @@
     list<CMessage> list_msgsIndex, list_msgsVal;
     list<CArray<int,1> > list_indi;
+    list<CArray<int,1> > list_writtenInd;
     list<CArray<double,1> > list_val;
     list<CArray<double,2> > list_bounds;
@@ -433,4 +556,16 @@
       list_msgsIndex.back() << this->getId() << list_indi.back();
 
+      if (isCompressible_)
+      {
+        std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
+        list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
+        CArray<int,1>& writtenInd = list_writtenInd.back();
+
+        for (n = 0; n < writtenInd.numElements(); ++n)
+          writtenInd(n) = writtenIndSrc[n];
+
+        list_msgsIndex.back() << writtenInd;
+      }
+
       list_msgsVal.push_back(CMessage());
       list_msgsVal.back() << this->getId() << list_val.back();
@@ -451,11 +586,25 @@
   void CAxis::recvIndex(CEventServer& event)
   {
+    CAxis* axis;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
     {
       CBufferIn* buffer = it->buffer;
-      string domainId;
-      *buffer >> domainId;
-      get(domainId)->recvIndex(it->rank, *buffer);
+      string axisId;
+      *buffer >> axisId;
+      axis = get(axisId);
+      axis->recvIndex(it->rank, *buffer);
+    }
+
+    if (axis->isCompressible_)
+    {
+      std::sort(axis->indexesToWrite.begin(), axis->indexesToWrite.end());
+
+      CContextServer* server = CContext::getCurrent()->server;
+      axis->numberWrittenIndexes_ = axis->indexesToWrite.size();
+      MPI_Allreduce(&axis->numberWrittenIndexes_, &axis->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      MPI_Scan(&axis->numberWrittenIndexes_, &axis->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      axis->offsetWrittenIndexes_ -= axis->numberWrittenIndexes_;
     }
   }
@@ -464,4 +613,13 @@
   {
     buffer >> indiSrv_[rank];
+
+    if (isCompressible_)
+    {
+      CArray<int, 1> writtenIndexes;
+      buffer >> writtenIndexes;
+      indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
+      for (int i = 0; i < writtenIndexes.numElements(); ++i)
+        indexesToWrite.push_back(writtenIndexes(i));
+    }
   }
 
@@ -472,7 +630,7 @@
     {
       CBufferIn* buffer = it->buffer;
-      string domainId;
-      *buffer >> domainId;
-      get(domainId)->recvDistributedValue(it->rank, *buffer);
+      string axisId;
+      *buffer >> axisId;
+      get(axisId)->recvDistributedValue(it->rank, *buffer);
     }
   }
@@ -503,11 +661,22 @@
    void CAxis::recvNonDistributedValue(CEventServer& event)
   {
+    CAxis* axis;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
     {
       CBufferIn* buffer = it->buffer;
-      string domainId;
-      *buffer >> domainId;
-      get(domainId)->recvNonDistributedValue(it->rank, *buffer);
+      string axisId;
+      *buffer >> axisId;
+      axis = get(axisId);
+      axis->recvNonDistributedValue(it->rank, *buffer);
+    }
+
+    if (axis->isCompressible_)
+    {
+      std::sort(axis->indexesToWrite.begin(), axis->indexesToWrite.end());
+
+      axis->numberWrittenIndexes_ = axis->totalNumberWrittenIndexes_ = axis->indexesToWrite.size();
+      axis->offsetWrittenIndexes_ = 0;
     }
   }
@@ -526,4 +695,13 @@
         bound_srv(1,ind) = bounds(1,ind);
       }
+    }
+
+    if (isCompressible_)
+    {
+      CArray<int, 1> writtenIndexes;
+      buffer >> writtenIndexes;
+      indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
+      for (int i = 0; i < writtenIndexes.numElements(); ++i)
+        indexesToWrite.push_back(writtenIndexes(i));
     }
   }
@@ -561,4 +739,5 @@
         msg << ni << begin << end;
         msg << global_zoom_begin << global_zoom_size;
+        msg << isCompressible_;
 
         event.push(*itRank,1,msg);
@@ -581,5 +760,7 @@
     int ni_srv, begin_srv, end_srv, global_zoom_begin_tmp, global_zoom_size_tmp;
 
-    buffer>>ni_srv>>begin_srv>>end_srv>>global_zoom_begin_tmp>>global_zoom_size_tmp;
+    buffer >> ni_srv >> begin_srv >> end_srv;
+    buffer >> global_zoom_begin_tmp >> global_zoom_size_tmp;
+    buffer >> isCompressible_;
     global_zoom_begin = global_zoom_begin_tmp;
     global_zoom_size  = global_zoom_size_tmp;
Index: /XIOS/trunk/src/node/axis.hpp
===================================================================
--- /XIOS/trunk/src/node/axis.hpp	(revision 675)
+++ /XIOS/trunk/src/node/axis.hpp	(revision 676)
@@ -67,10 +67,18 @@
          const std::set<StdString> & getRelFiles(void) const;
 
+         const std::vector<int>& getIndexesToWrite(void) const;
+         int getNumberWrittenIndexes() const;
+         int getTotalNumberWrittenIndexes() const;
+         int getOffsetWrittenIndexes() const;
+
          /// Test ///
          bool IsWritten(const StdString & filename) const;
+         bool isWrittenCompressed(const StdString& filename) const;
          bool isDistributed(void) const;
+         bool isCompressible(void) const;
 
          /// Mutateur ///
          void addRelFile(const StdString & filename);
+         void addRelFileCompressed(const StdString& filename);
 
          /// VÃ©rifications ///
@@ -97,4 +105,6 @@
                                     CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
 
+         void checkEligibilityForCompressedOutput();
+
          bool hasTransformation();
          void solveInheritanceTransformation();
@@ -107,5 +117,6 @@
         CArray<double,1> value_srv;
         CArray<double,2> bound_srv;
-      private :
+
+      private:
          void checkData();
          void checkMask();
@@ -128,12 +139,18 @@
 
          void setTransformations(const TransMapTypes&);
+
       private:
          bool isChecked;
          bool areClientAttributesChecked_;
-         std::set<StdString> relFiles;
+         std::set<StdString> relFiles, relFilesCompressed;
          TransMapTypes transformationMap_;
          bool isDistributed_;
+         //! True if and only if the data defined on the axis can be outputted in a compressed way
+         bool isCompressible_;
          std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server
          std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server
+         std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server
+         std::vector<int> indexesToWrite;
+         int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
          std::vector<int> connectedServerRank_;
          std::map<int, CArray<int,1> > indiSrv_;
Index: /XIOS/trunk/src/node/context.cpp
===================================================================
--- /XIOS/trunk/src/node/context.cpp	(revision 675)
+++ /XIOS/trunk/src/node/context.cpp	(revision 676)
@@ -745,4 +745,8 @@
       // Find all inheritance in xml structure
       this->solveAllInheritance();
+
+      // Check if some axis, domains or grids are eligible to for compressed indexed output.
+      // Warning: This must be done after solving the inheritance and before the rest of post-processing
+      checkAxisDomainsGridsEligibilityForCompressedOutput();
 
       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
@@ -851,4 +855,22 @@
    }
 
+   //! Client side: Check if the defined axis, domains and grids are eligible for compressed indexed output
+   void CContext::checkAxisDomainsGridsEligibilityForCompressedOutput()
+   {
+     if (!hasClient) return;
+
+     const vector<CAxis*> allAxis = CAxis::getAll();
+     for (vector<CAxis*>::const_iterator it = allAxis.begin(); it != allAxis.end(); it++)
+       (*it)->checkEligibilityForCompressedOutput();
+
+     const vector<CDomain*> allDomains = CDomain::getAll();
+     for (vector<CDomain*>::const_iterator it = allDomains.begin(); it != allDomains.end(); it++)
+       (*it)->checkEligibilityForCompressedOutput();
+
+     const vector<CGrid*> allGrids = CGrid::getAll();
+     for (vector<CGrid*>::const_iterator it = allGrids.begin(); it != allGrids.end(); it++)
+       (*it)->checkEligibilityForCompressedOutput();
+   }
+
    //! Client side: Send information of reference grid of active fields
    void CContext::sendRefGrid()
Index: /XIOS/trunk/src/node/context.hpp
===================================================================
--- /XIOS/trunk/src/node/context.hpp	(revision 675)
+++ /XIOS/trunk/src/node/context.hpp	(revision 676)
@@ -109,4 +109,5 @@
          void updateCalendar(int step);
          void createFileHeader(void );
+         void checkAxisDomainsGridsEligibilityForCompressedOutput();
          void solveAllRefOfEnabledFields(bool sendToServer);
          void buildFilterGraphOfEnabledFields();
Index: /XIOS/trunk/src/node/domain.cpp
===================================================================
--- /XIOS/trunk/src/node/domain.cpp	(revision 675)
+++ /XIOS/trunk/src/node/domain.cpp	(revision 676)
@@ -13,5 +13,7 @@
 #include "context.hpp"
 #include "context_client.hpp"
+#include "context_server.hpp"
 #include "array_new.hpp"
+#include "distribution_client.hpp"
 #include "server_distribution_description.hpp"
 #include "client_server_mapping_distributed.hpp"
@@ -19,4 +21,6 @@
 #include "interpolate_from_file_domain.hpp"
 
+#include <algorithm>
+
 namespace xios {
 
@@ -26,5 +30,5 @@
       : CObjectTemplate<CDomain>(), CDomainAttributes()
       , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_()
-      , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(), isUnstructed_(false)
+      , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(), isCompressible_(false), isUnstructed_(false)
       , global_zoom_ni(0), global_zoom_ibegin(0), global_zoom_nj(0), global_zoom_jbegin(0)
       , isClientAfterTransformationChecked(false), hasLonLat(false)
@@ -35,5 +39,5 @@
       : CObjectTemplate<CDomain>(id), CDomainAttributes()
       , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_()
-      , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(), isUnstructed_(false)
+      , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(), isCompressible_(false), isUnstructed_(false)
       , global_zoom_ni(0), global_zoom_ibegin(0), global_zoom_nj(0), global_zoom_jbegin(0)
       , isClientAfterTransformationChecked(false), hasLonLat(false)
@@ -64,4 +68,39 @@
 
    //----------------------------------------------------------------
+
+   const std::vector<int>& CDomain::getIndexesToWrite(void) const
+   {
+     return indexesToWrite;
+   }
+
+   /*!
+     Returns the number of indexes written by each server.
+     \return the number of indexes written by each server
+   */
+   int CDomain::getNumberWrittenIndexes() const
+   {
+     return numberWrittenIndexes_;
+   }
+
+   /*!
+     Returns the total number of indexes written by the servers.
+     \return the total number of indexes written by the servers
+   */
+   int CDomain::getTotalNumberWrittenIndexes() const
+   {
+     return totalNumberWrittenIndexes_;
+   }
+
+   /*!
+     Returns the offset of indexes written by each server.
+     \return the offset of indexes written by each server
+   */
+   int CDomain::getOffsetWrittenIndexes() const
+   {
+     return offsetWrittenIndexes_;
+   }
+
+   //----------------------------------------------------------------
+
    bool CDomain::isEmpty(void) const
    {
@@ -71,4 +110,5 @@
 
    //----------------------------------------------------------------
+
    bool CDomain::IsWritten(const StdString & filename) const
    {
@@ -76,5 +116,11 @@
    }
 
+   bool CDomain::isWrittenCompressed(const StdString& filename) const
+   {
+      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end());
+   }
+
    //----------------------------------------------------------------
+
    bool CDomain::isDistributed(void) const
    {
@@ -83,7 +129,25 @@
 
    //----------------------------------------------------------------
+
+   /*!
+    * Test whether the data defined on the domain can be outputted in a compressed way.
+    * 
+    * \return true if and only if a mask was defined for this domain
+    */
+   bool CDomain::isCompressible(void) const
+   {
+      return isCompressible_;
+   }
+
+   //----------------------------------------------------------------
+
    void CDomain::addRelFile(const StdString & filename)
    {
       this->relFiles.insert(filename);
+   }
+
+   void CDomain::addRelFileCompressed(const StdString& filename)
+   {
+      this->relFilesCompressed.insert(filename);
    }
 
@@ -246,6 +310,6 @@
    }
 
-
    //----------------------------------------------------------------
+
    void CDomain::checkDomainData(void)
    {
@@ -357,4 +421,13 @@
 
    //----------------------------------------------------------------
+
+   void CDomain::checkEligibilityForCompressedOutput(void)
+   {
+     // We don't check if the mask or the indexes are valid here, just if they have been defined at this point.
+     isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty();
+   }
+
+   //----------------------------------------------------------------
+
    void CDomain::completeLonLatClient(void)
    {
@@ -746,4 +819,5 @@
         msg << ni_srv << ibegin_srv << iend_srv << nj_srv << jbegin_srv << jend_srv;
         msg << global_zoom_ni << global_zoom_ibegin << global_zoom_nj << global_zoom_jbegin;
+        msg << isCompressible_;
 
         event.push(*itRank,1,msg);
@@ -783,4 +857,22 @@
       {
         ++globalIndexCountZoom;
+      }
+    }
+
+    int globalIndexWrittenCount = 0;
+    if (isCompressible_)
+    {
+      for (i = 0; i < data_i_index.numElements(); ++i)
+      {
+        i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
+                                                    data_ibegin, data_jbegin, data_dim, ni,
+                                                    j_ind);
+        if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
+        {
+          i_ind += ibegin;
+          j_ind += jbegin;
+          if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+            ++globalIndexWrittenCount;
+        }
       }
     }
@@ -809,16 +901,38 @@
     }
 
-     size_t globalSizeIndex = 1, indexBegin, indexEnd;
-     int range, clientSize = client->clientSize;
-     for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i];
-     indexBegin = 0;
-     for (int i = 0; i < clientSize; ++i)
-     {
-       range = globalSizeIndex / clientSize;
-       if (i < (globalSizeIndex%clientSize)) ++range;
-       if (i == client->clientRank) break;
-       indexBegin += range;
-     }
-     indexEnd = indexBegin + range - 1;
+    CArray<int,1> globalIndexWrittenDomain(globalIndexWrittenCount);
+    if (isCompressible_)
+    {
+      globalIndexWrittenCount = 0;
+      for (i = 0; i < data_i_index.numElements(); ++i)
+      {
+        i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
+                                                    data_ibegin, data_jbegin, data_dim, ni,
+                                                    j_ind);
+        if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
+        {
+          i_ind += ibegin;
+          j_ind += jbegin;
+          if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+          {
+            globalIndexWrittenDomain(globalIndexWrittenCount) = i_ind + j_ind * ni_glo;
+            ++globalIndexWrittenCount;
+          }
+        }
+      }
+    }
+
+    size_t globalSizeIndex = 1, indexBegin, indexEnd;
+    int range, clientSize = client->clientSize;
+    for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i];
+    indexBegin = 0;
+    for (int i = 0; i < clientSize; ++i)
+    {
+      range = globalSizeIndex / clientSize;
+      if (i < (globalSizeIndex%clientSize)) ++range;
+      if (i == client->clientRank) break;
+      indexBegin += range;
+    }
+    indexEnd = indexBegin + range - 1;
 
     CServerDistributionDescription serverDescription(nGlobDomain_);
@@ -837,4 +951,5 @@
 
     indSrv_.clear();
+    indWrittenSrv_.clear();
     for (; it != ite; ++it)
     {
@@ -853,4 +968,11 @@
         }
       }
+      for (int i = 0; i < globalIndexWrittenDomain.numElements(); ++i)
+      {
+        if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexWrittenDomain(i), itVec))
+        {
+          indWrittenSrv_[rank].push_back(globalIndexWrittenDomain(i));
+        }
+      }
     }
 
@@ -888,5 +1010,5 @@
 
     list<CMessage> list_msgsIndex;
-    list<CArray<int,1> > list_indi, list_indj;
+    list<CArray<int,1> > list_indi, list_indj, list_writtenInd;
 
     std::map<int, std::vector<size_t> >::const_iterator it, iteMap;
@@ -918,4 +1040,16 @@
       list_msgsIndex.back() << isCurvilinear;
       list_msgsIndex.back() << list_indi.back() << list_indj.back();
+
+      if (isCompressible_)
+      {
+        std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
+        list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
+        CArray<int,1>& writtenInd = list_writtenInd.back();
+
+        for (n = 0; n < writtenInd.numElements(); ++n)
+          writtenInd(n) = writtenIndSrc[n];
+
+        list_msgsIndex.back() << writtenInd;
+      }
 
       eventIndex.push(rank, nbConnectedClients_[rank], list_msgsIndex.back());
@@ -1118,5 +1252,6 @@
   {
     buffer >> ni_srv >> ibegin_srv >> iend_srv >> nj_srv >> jbegin_srv >> jend_srv
-           >> global_zoom_ni >> global_zoom_ibegin >> global_zoom_nj >> global_zoom_jbegin;
+           >> global_zoom_ni >> global_zoom_ibegin >> global_zoom_nj >> global_zoom_jbegin
+           >> isCompressible_;
 
     int zoom_iend = global_zoom_ibegin + global_zoom_ni - 1;
@@ -1158,4 +1293,6 @@
   void CDomain::recvIndex(CEventServer& event)
   {
+    CDomain* domain;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
@@ -1164,5 +1301,17 @@
       string domainId;
       *buffer >> domainId;
-      get(domainId)->recvIndex(it->rank, *buffer);
+      domain = get(domainId);
+      domain->recvIndex(it->rank, *buffer);
+    }
+
+    if (domain->isCompressible_)
+    {
+      std::sort(domain->indexesToWrite.begin(), domain->indexesToWrite.end());
+
+      CContextServer* server = CContext::getCurrent()->server;
+      domain->numberWrittenIndexes_ = domain->indexesToWrite.size();
+      MPI_Allreduce(&domain->numberWrittenIndexes_, &domain->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      MPI_Scan(&domain->numberWrittenIndexes_, &domain->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      domain->offsetWrittenIndexes_ -= domain->numberWrittenIndexes_;
     }
   }
@@ -1178,4 +1327,13 @@
     buffer >> type_int >> isCurvilinear >> indiSrv[rank] >> indjSrv[rank];
     type.setValue((type_attr::t_enum)type_int); // probleme des type enum avec les buffers : ToFix
+
+    if (isCompressible_)
+    {
+      CArray<int, 1> writtenIndexes;
+      buffer >> writtenIndexes;
+      indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
+      for (int i = 0; i < writtenIndexes.numElements(); ++i)
+        indexesToWrite.push_back(writtenIndexes(i));
+    }
   }
 
Index: /XIOS/trunk/src/node/domain.hpp
===================================================================
--- /XIOS/trunk/src/node/domain.hpp	(revision 675)
+++ /XIOS/trunk/src/node/domain.hpp	(revision 676)
@@ -47,5 +47,5 @@
          typedef CDomainAttributes SuperClassAttribute;
 
-      public :
+      public:
 
          typedef CDomainAttributes RelAttributes;
@@ -70,4 +70,6 @@
          void checkAttributesOnClientAfterTransformation();
 
+         void checkEligibilityForCompressedOutput(void);
+
          void sendCheckedAttributes();
 
@@ -76,10 +78,17 @@
          TransMapTypes getAllTransformations();
 
-      public :
+      public:
          const std::set<StdString> & getRelFiles(void) const;
          bool IsWritten(const StdString & filename) const;
+         bool isWrittenCompressed(const StdString& filename) const;
+
+         const std::vector<int>& getIndexesToWrite(void) const;
+         int getNumberWrittenIndexes() const;
+         int getTotalNumberWrittenIndexes() const;
+         int getOffsetWrittenIndexes() const;
+
          bool isEmpty(void) const;
          bool isDistributed(void) const;
-
+         bool isCompressible(void) const;
 
          int global_zoom_ibegin, global_zoom_ni;
@@ -104,7 +113,8 @@
         vector< vector<int> > j_indSrv ; // for each server, j global index to send
 
-      public :
+      public:
          /// Mutateur ///
          void addRelFile(const StdString & filename);
+         void addRelFileCompressed(const StdString& filename);
          void completeLonLatClient(void);
          void sendServerAttribut(void) ;
@@ -159,7 +169,7 @@
          void sendLonLat();
 
-       private :
+       private:
          bool isChecked;
-         std::set<StdString> relFiles;
+         std::set<StdString> relFiles, relFilesCompressed;
          bool isClientChecked; // Verify whether all attributes of domain on the client side are good
          bool isClientAfterTransformationChecked;
@@ -167,6 +177,11 @@
          std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server
          std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server
+         std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server
+         std::vector<int> indexesToWrite;
+         int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
          std::vector<int> connectedServerRank_;
          bool isDistributed_;
+         //! True if and only if the data defined on the domain can be outputted in a compressed way
+         bool isCompressible_;
          TransMapTypes transformationMap_;
          std::vector<int> nGlobDomain_;
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 675)
+++ /XIOS/trunk/src/node/field.cpp	(revision 676)
@@ -35,4 +35,5 @@
       , hasOutputFile(false)
       , domAxisIds_("", ""), areAllReferenceSolved(false)
+      , useCompressedOutput(false)
       , isReadDataRequestPending(false)
    { setVirtualVariableGroup(); }
@@ -45,4 +46,5 @@
       , hasOutputFile(false)
       , domAxisIds_("", ""), areAllReferenceSolved(false)
+      , useCompressedOutput(false)
       , isReadDataRequestPending(false)
    { setVirtualVariableGroup(); }
@@ -455,4 +457,16 @@
    {
       return !this->refObject.empty();
+   }
+
+   //----------------------------------------------------------------
+
+   bool CField::getUseCompressedOutput() const
+   {
+     return useCompressedOutput;
+   }
+
+   void CField::setUseCompressedOutput()
+   {
+     useCompressedOutput = true;
    }
 
@@ -814,5 +828,5 @@
       for(it=data_srv.begin();it!=data_srv.end();it++)
       {
-         grid->outputField(it->first, it->second, fieldOut.dataFirst()) ;
+         grid->outputField(it->first, it->second, fieldOut.dataFirst());
       }
    }
@@ -824,5 +838,5 @@
       for (it = data_srv.begin(); it != data_srv.end(); it++)
       {
-         grid->outputField(it->first, it->second, fieldOut.dataFirst()) ;
+         grid->outputField(it->first, it->second, fieldOut.dataFirst());
       }
    }
@@ -852,4 +866,14 @@
       {
          grid->inputField(it->first, fieldOut.dataFirst(), it->second);
+      }
+   }
+
+   void CField::outputCompressedField(CArray<double,1>& fieldOut)
+   {
+      map<int, CArray<double,1> >::iterator it;
+
+      for (it = data_srv.begin(); it != data_srv.end(); it++)
+      {
+         grid->outputCompressedField(it->first, it->second, fieldOut.dataFirst());
       }
    }
Index: /XIOS/trunk/src/node/field.hpp
===================================================================
--- /XIOS/trunk/src/node/field.hpp	(revision 675)
+++ /XIOS/trunk/src/node/field.hpp	(revision 676)
@@ -99,4 +99,7 @@
          bool isActive(void) const;
          bool hasOutputFile;
+
+         bool getUseCompressedOutput() const;
+         void setUseCompressedOutput();
 
          /// Traitements ///
@@ -142,4 +145,5 @@
         void inputField(CArray<double,2>& fieldOut);
         void inputField(CArray<double,1>& fieldOut);
+        void outputCompressedField(CArray<double, 1>& fieldOut);
         void scaleFactorAddOffset(double scaleFactor, double addOffset);
         void invertScaleFactorAddOffset(double scaleFactor, double addOffset);
@@ -187,4 +191,5 @@
          std::pair<StdString,StdString> domAxisIds_;
          bool isReadDataRequestPending;
+         bool useCompressedOutput;
 
          DECLARE_REF_FUNC(Field,field)
Index: /XIOS/trunk/src/node/grid.cpp
===================================================================
--- /XIOS/trunk/src/node/grid.cpp	(revision 675)
+++ /XIOS/trunk/src/node/grid.cpp	(revision 676)
@@ -25,7 +25,9 @@
       : CObjectTemplate<CGrid>(), CGridAttributes()
       , isChecked(false), isDomainAxisChecked(false)
-      , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false)
-      , serverDistribution_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_()
-      , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), transformations_(0), isTransformed_(false)
+      , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false)
+      , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0)
+      , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
+      , globalDim_(), connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)
+      , transformations_(0), isTransformed_(false)
       , axisPositionInGrid_(), positionDimensionDistributed_(1)
    {
@@ -37,7 +39,9 @@
       : CObjectTemplate<CGrid>(id), CGridAttributes()
       , isChecked(false), isDomainAxisChecked(false)
-      , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false)
-      , serverDistribution_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_()
-      , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), transformations_(0), isTransformed_(false)
+      , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false)
+      , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0)
+      , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
+      , globalDim_(), connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)
+      , transformations_(0), isTransformed_(false)
       , axisPositionInGrid_(), positionDimensionDistributed_(1)
    {
@@ -149,4 +153,30 @@
    }
 
+   //---------------------------------------------------------------
+
+   /*!
+    * Test whether the data defined on the grid can be outputted in a compressed way.
+    * 
+    * \return true if and only if a mask was defined for this grid
+    */
+   bool CGrid::isCompressible(void) const
+   {
+      return isCompressible_;
+   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::addRelFileCompressed(const StdString& filename)
+   {
+      this->relFilesCompressed.insert(filename);
+   }
+
+   bool CGrid::isWrittenCompressed(const StdString& filename) const
+   {
+      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end());
+   }
+
+   //---------------------------------------------------------------
+
    void CGrid::solveDomainAxisRef(bool areAttributesChecked)
    {
@@ -157,4 +187,10 @@
      computeGridGlobalDimension(getDomains(), getAxis(), axis_domain_order);
      this->isDomainAxisChecked = areAttributesChecked;
+   }
+
+   void CGrid::checkEligibilityForCompressedOutput()
+   {
+     // We don't check if the mask is valid here, just if a mask has been defined at this point.
+     isCompressible_ = !mask1.isEmpty() || !mask2.isEmpty() || !mask3.isEmpty();
    }
 
@@ -488,4 +524,14 @@
    }
 
+   void CGrid::outputCompressedField(int rank, const CArray<double,1>& stored, double* field)
+   {
+     const CArray<size_t,1>& out_i = compressedOutIndexFromClient[rank];
+     StdSize numElements = stored.numElements();
+     for (StdSize n = 0; n < numElements; ++n)
+     {
+       field[out_i(n)] = stored(n);
+     }
+   }
+
    //----------------------------------------------------------------
 
@@ -518,4 +564,38 @@
     }
     isDataDistributed_ = false;
+  }
+
+  void CGrid::computeCompressedIndex()
+  {
+    compressedOutIndexFromClient = outIndexFromClient;
+
+    std::map<size_t, size_t> indexes;
+
+    {
+      std::map<int, CArray<size_t,1> >::const_iterator it = compressedOutIndexFromClient.begin();
+      std::map<int, CArray<size_t,1> >::const_iterator itEnd = compressedOutIndexFromClient.end();
+      for (; it != itEnd; ++it)
+      {
+        for (int i = 0; i < it->second.numElements(); ++i)
+          indexes.insert(std::make_pair(it->second(i), 0));
+      }
+    }
+
+    {
+      std::map<size_t, size_t>::iterator it = indexes.begin();
+      std::map<size_t, size_t>::iterator itEnd = indexes.end();
+      for (size_t i = 0; it != itEnd; ++it, ++i)
+        it->second = i;
+    }
+
+    {
+      std::map<int, CArray<size_t,1> >::iterator it = compressedOutIndexFromClient.begin();
+      std::map<int, CArray<size_t,1> >::iterator itEnd = compressedOutIndexFromClient.end();
+      for (; it != itEnd; ++it)
+      {
+        for (int i = 0; i < it->second.numElements(); ++i)
+          it->second(i) = indexes[it->second(i)];
+      }
+    }
   }
 
@@ -547,5 +627,5 @@
 
         listMsg.push_back(CMessage());
-        listMsg.back() << getId( )<< isDataDistributed_ << listOutIndex.back();
+        listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back();
 
         event.push(rank, 1, listMsg.back());
@@ -589,5 +669,5 @@
 
           listMsg.push_back(CMessage());
-          listMsg.back() << getId() << isDataDistributed_ << listOutIndex.back();
+          listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
 
           event.push(rank, 1, listMsg.back());
@@ -650,5 +730,5 @@
 
         listMsg.push_back(CMessage());
-        listMsg.back() << getId() << isDataDistributed_ << listOutIndex.back();
+        listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
 
         event.push(rank, nbSenders[rank], listMsg.back());
@@ -741,4 +821,31 @@
   }
 
+  /*!
+    Returns the number of indexes written by each server.
+    \return the number of indexes written by each server
+  */
+  int CGrid::getNumberWrittenIndexes() const
+  {
+    return numberWrittenIndexes_;
+  }
+
+  /*!
+    Returns the total number of indexes written by the servers.
+    \return the total number of indexes written by the servers
+  */
+  int CGrid::getTotalNumberWrittenIndexes() const
+  {
+    return totalNumberWrittenIndexes_;
+  }
+
+  /*!
+    Returns the offset of indexes written by each server.
+    \return the offset of indexes written by each server
+  */
+  int CGrid::getOffsetWrittenIndexes() const
+  {
+    return offsetWrittenIndexes_;
+  }
+
   const CDistributionServer* CGrid::getDistributionServer() const
   {
@@ -762,4 +869,5 @@
     CContext* context = CContext::getCurrent();
     CContextServer* server = context->server;
+    numberWrittenIndexes_ = totalNumberWrittenIndexes_ = offsetWrittenIndexes_ = 0;
 
     for (int n = 0; n < ranks.size(); n++)
@@ -768,10 +876,10 @@
       CBufferIn& buffer = *buffers[n];
 
-      buffer >> isDataDistributed_;
+      buffer >> isDataDistributed_ >> isCompressible_;
       size_t dataSize = 0;
 
       if (isScalarGrid())
       {
-        writtenDataSize_ = 1;
+        writtenDataSize_ = numberWrittenIndexes_ = totalNumberWrittenIndexes_ = 1;
         CArray<size_t,1> outIndex;
         buffer >> outIndex;
@@ -849,5 +957,15 @@
       outIndexFromClient.insert(std::make_pair(rank, outIndex));
       connectedDataSize_[rank] = outIndex.numElements();
-    }
+      numberWrittenIndexes_ += outIndex.numElements();
+    }
+
+    if (isDataDistributed_)
+    {
+      MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      offsetWrittenIndexes_ -= numberWrittenIndexes_;
+    }
+    else
+      totalNumberWrittenIndexes_ = numberWrittenIndexes_;
 
     nbSenders = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
Index: /XIOS/trunk/src/node/grid.hpp
===================================================================
--- /XIOS/trunk/src/node/grid.hpp	(revision 675)
+++ /XIOS/trunk/src/node/grid.hpp	(revision 676)
@@ -48,5 +48,5 @@
          typedef CGridAttributes SuperClassAttribute;
 
-      public :
+      public:
 
          typedef CGridAttributes RelAttributes;
@@ -72,4 +72,6 @@
 //         void solveReference(void);
 
+         void checkEligibilityForCompressedOutput();
+
          void solveDomainAxisRef(bool areAttributesChecked);
 
@@ -79,8 +81,11 @@
 //         virtual void fromBinary(StdIStream& is);
 
+         void addRelFileCompressed(const StdString& filename);
+
          /// Tests ///
-         bool hasAxis(void) const;
-
-      public :
+         bool isCompressible(void) const;
+         bool isWrittenCompressed(const StdString& filename) const;
+
+      public:
 
          /// Accesseurs ///
@@ -98,4 +103,6 @@
          void inputField(int rank, const double* const field, CArray<double,1>& stored);
 
+         void outputCompressedField(int rank, const CArray<double,1>& stored, double* field);
+
          virtual void parse(xml::CXMLNode& node);
 
@@ -103,5 +110,5 @@
          virtual ~CGrid(void);
 
-      public :
+      public:
 
          /// Accesseurs statiques ///
@@ -116,5 +123,5 @@
          static CGrid* createGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis, CArray<bool,1> axisDomainOrder = CArray<bool,1>());
 
-      public :
+      public:
 
          /// EntrÃ©es-sorties de champs (interne) ///
@@ -126,4 +133,5 @@
          void computeIndex(void);
          void computeIndexScalarGrid();
+         void computeCompressedIndex();
 
          void solveDomainRef(bool checkAtt);
@@ -163,4 +171,7 @@
          bool doGridHaveDataDistributed();
          size_t getWrittenDataSize() const;
+         int getNumberWrittenIndexes() const;
+         int getTotalNumberWrittenIndexes() const;
+         int getOffsetWrittenIndexes() const;
 
          const CDistributionServer* getDistributionServer() const;
@@ -184,5 +195,5 @@
          map<int,int> nbSenders;
 
-         map<int, CArray<size_t, 1> > outIndexFromClient;
+         map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient;
          void checkMask(void);
          void modifyMask(const CArray<int,1>& indexToModify);
@@ -221,4 +232,5 @@
 
         std::vector<int> globalDim_;
+
       private:
         CDomainGroup* vDomainGroup_;
@@ -231,8 +243,12 @@
         CClientServerMapping* clientServerMap_;
         size_t writtenDataSize_;
+        int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
         std::map<int,size_t> connectedDataSize_;
         std::vector<int> connectedServerRank_;
         bool isDataDistributed_;
         int positionDimensionDistributed_;
+         //! True if and only if the data defined on the grid can be outputted in a compressed way
+        bool isCompressible_;
+        std::set<std::string> relFilesCompressed;
 
         bool isTransformed_;
Index: /XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 675)
+++ /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 676)
@@ -741,4 +741,217 @@
      }
 
+     //--------------------------------------------------------------
+
+     void CNc4DataOutput::writeGridCompressed_(CGrid* grid)
+     {
+       if (grid->isScalarGrid() || grid->isWrittenCompressed(this->filename)) return;
+
+       try
+       {
+         CArray<bool,1> axisDomainOrder = grid->axis_domain_order;
+         std::vector<StdString> domainList = grid->getDomainList();
+         std::vector<StdString> axisList   = grid->getAxisList();
+         int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0;
+
+         std::vector<StdString> dims;
+
+         if (grid->isCompressible())
+         {
+           StdString varId = grid->getId() + "_points";
+
+           int nbIndexes = (SuperClass::type == MULTI_FILE) ? grid->getNumberWrittenIndexes() : grid->getTotalNumberWrittenIndexes();
+           SuperClassWriter::addDimension(varId, nbIndexes);
+
+           dims.push_back(varId);
+           SuperClassWriter::addVariable(varId, NC_INT, dims);
+
+           StdOStringStream compress;
+           for (int i = numElement - 1; i >= 0; --i)
+           {
+             if (axisDomainOrder(i))
+             {
+               CDomain* domain = CDomain::get(domainList[domainList.size() - idxDomain - 1]);
+               StdString domId = !domain->name.isEmpty() ? domain->name.getValue() : domain->getId();
+               StdString appendDomId  = singleDomain ? "" : "_" + domId;
+
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear:
+                   compress << "y" << appendDomId << " x" << appendDomId;
+                   break;
+                 case CDomain::type_attr::rectilinear:
+                   compress << "lat" << appendDomId << " lon" << appendDomId;
+                   break;
+                 case CDomain::type_attr::unstructured:
+                   compress << "cell" << appendDomId;
+                   break;
+               }
+               ++idxDomain;
+             }
+             else
+             {
+               CAxis* axis = CAxis::get(axisList[axisList.size() - idxAxis - 1]);
+               compress << (!axis->name.isEmpty() ? axis->name.getValue() : axis->getId());
+               ++idxAxis;
+             }
+
+             if (i != 0) compress << ' ';
+           }
+           SuperClassWriter::addAttribute("compress", compress.str(), &varId);
+
+           grid->computeCompressedIndex();
+
+           CArray<int, 1> indexes(grid->getNumberWrittenIndexes());
+           std::map<int, CArray<size_t, 1> >::const_iterator it;
+           for (it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
+           {
+             const CArray<size_t, 1> compressedIndexes = grid->compressedOutIndexFromClient[it->first];
+             for (int i = 0; i < it->second.numElements(); i++)
+               indexes(compressedIndexes(i)) = it->second(i);
+           }
+
+           switch (SuperClass::type)
+           {
+             case (MULTI_FILE):
+             {
+               SuperClassWriter::writeData(indexes, varId, isCollective, 0);
+               break;
+             }
+             case (ONE_FILE):
+             {
+               if (grid->doGridHaveDataDistributed())
+                 grid->getDistributionServer()->computeGlobalIndex(indexes);
+
+               std::vector<StdSize> start, count;
+               start.push_back(grid->getOffsetWrittenIndexes());
+               count.push_back(grid->getNumberWrittenIndexes());
+
+               SuperClassWriter::writeData(indexes, varId, isCollective, 0, &start, &count);
+               break;
+             }
+           }
+         }
+         else
+         {
+           for (int i = 0; i < numElement; ++i)
+           {
+             StdString varId, compress;
+             CArray<int, 1> indexes;
+             bool isDistributed;
+             StdSize nbIndexes, totalNbIndexes, offset;
+             int firstGlobalIndex;
+
+             if (axisDomainOrder(i))
+             {
+               CDomain* domain = CDomain::get(domainList[idxDomain]);
+               if (!domain->isCompressible()
+                    || domain->type == CDomain::type_attr::unstructured
+                    || domain->isWrittenCompressed(this->filename))
+                 continue;
+
+               StdString domId = !domain->name.isEmpty() ? domain->name.getValue() : domain->getId();
+               StdString appendDomId  = singleDomain ? "" : "_" + domId;
+
+               varId = domId + "_points";
+               switch (domain->type)
+               {
+                 case CDomain::type_attr::curvilinear:
+                   compress = "y" + appendDomId + " x" + appendDomId;
+                   break;
+                 case CDomain::type_attr::rectilinear:
+                   compress = "lat" + appendDomId + " lon" + appendDomId;
+                   break;
+               }
+
+               const std::vector<int>& indexesToWrite = domain->getIndexesToWrite();
+               indexes.resize(indexesToWrite.size());
+               for (int n = 0; n < indexes.numElements(); ++n)
+                 indexes(n) = indexesToWrite[n];
+
+               isDistributed = domain->isDistributed();
+               nbIndexes = domain->getNumberWrittenIndexes();
+               totalNbIndexes = domain->getTotalNumberWrittenIndexes();
+               offset = domain->getOffsetWrittenIndexes();
+               firstGlobalIndex = domain->ibegin + domain->jbegin * domain->ni_glo;
+
+               domain->addRelFileCompressed(this->filename);
+               ++idxDomain;
+             }
+             else
+             {
+               CAxis* axis = CAxis::get(axisList[idxAxis]);
+               if (!axis->isCompressible() || axis->isWrittenCompressed(this->filename))
+                 continue;
+
+               StdString axisId = !axis->name.isEmpty() ? axis->name.getValue() : axis->getId();
+               varId = axisId + "_points";
+               compress = axisId;
+
+               const std::vector<int>& indexesToWrite = axis->getIndexesToWrite();
+               indexes.resize(indexesToWrite.size());
+               for (int n = 0; n < indexes.numElements(); ++n)
+                 indexes(n) = indexesToWrite[n];
+
+               isDistributed = axis->isDistributed();
+               nbIndexes = axis->getNumberWrittenIndexes();
+               totalNbIndexes = axis->getTotalNumberWrittenIndexes();
+               offset = axis->getOffsetWrittenIndexes();
+               firstGlobalIndex = axis->begin;
+
+               axis->addRelFileCompressed(this->filename);
+               ++idxAxis;
+             }
+
+             if (!varId.empty())
+             {
+               SuperClassWriter::addDimension(varId, (SuperClass::type == MULTI_FILE) ? nbIndexes : totalNbIndexes);
+
+               dims.clear();
+               dims.push_back(varId);
+               SuperClassWriter::addVariable(varId, NC_INT, dims);
+
+               SuperClassWriter::addAttribute("compress", compress, &varId);
+
+               switch (SuperClass::type)
+               {
+                 case (MULTI_FILE):
+                 {
+                   indexes -= firstGlobalIndex;
+                   SuperClassWriter::writeData(indexes, varId, isCollective, 0);
+                   break;
+                 }
+                 case (ONE_FILE):
+                 {
+                   std::vector<StdSize> start, count;
+                   start.push_back(offset);
+                   count.push_back(nbIndexes);
+
+                   SuperClassWriter::writeData(indexes, varId, isCollective, 0, &start, &count);
+                   break;
+                 }
+               }
+             }
+           }
+
+           if (!dims.empty())
+             grid->computeCompressedIndex();
+         }
+
+         grid->addRelFileCompressed(this->filename);
+       }
+       catch (CNetCdfException& e)
+       {
+         StdString msg("On writing compressed grid : ");
+         msg.append(grid->getId()); msg.append("\n");
+         msg.append("In the context : ");
+         CContext* context = CContext::getCurrent();
+         msg.append(context->getId()); msg.append("\n");
+         msg.append(e.what());
+         ERROR("CNc4DataOutput::writeGridCompressed_(CGrid* grid)", << msg);
+       }
+     }
+
+     //--------------------------------------------------------------
+
      void CNc4DataOutput::writeTimeDimension_(void)
      {
@@ -757,4 +970,5 @@
        }
      }
+
       //--------------------------------------------------------------
 
@@ -779,4 +993,5 @@
          bool hasArea = false;
          StdString cellMeasures = "area:";
+         bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output;
 
          for (int i = 0; i < numElement; ++i)
@@ -785,45 +1000,64 @@
            {
              CDomain* domain = CDomain::get(domainList[idxDomain]);
-             StdString domid = (!domain->name.isEmpty())
-                                 ? domain->name.getValue() : domain->getId();
-             StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
+             StdString domId = !domain->name.isEmpty() ? domain->name.getValue() : domain->getId();
+             StdString appendDomId  = singleDomain ? "" : "_" + domId ;
+
+             if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured)
+             {
+               dimIdList.push_back(domId + "_points");
+               field->setUseCompressedOutput();
+             }
+
              switch (domain->type)
              {
-               case CDomain::type_attr::curvilinear :
-                 dimXid     = StdString("x").append(appendDomid);
+               case CDomain::type_attr::curvilinear:
+                 if (!compressedOutput || !domain->isCompressible())
+                 {
+                   dimXid     = StdString("x").append(appendDomId);
+                   dimIdList.push_back(dimXid);
+                   dimYid     = StdString("y").append(appendDomId);
+                   dimIdList.push_back(dimYid);
+                 }
+                 dimCoordList.push_back(StdString("nav_lon").append(appendDomId));
+                 dimCoordList.push_back(StdString("nav_lat").append(appendDomId));
+                 break ;
+               case CDomain::type_attr::rectilinear:
+                 if (!compressedOutput || !domain->isCompressible())
+                 {
+                   dimXid     = StdString("lon").append(appendDomId);
+                   dimIdList.push_back(dimXid);
+                   dimYid     = StdString("lat").append(appendDomId);
+                   dimIdList.push_back(dimYid);
+                 }
+                 break ;
+               case CDomain::type_attr::unstructured:
+                 dimXid     = StdString("cell").append(appendDomId);
                  dimIdList.push_back(dimXid);
-                 dimYid     = StdString("y").append(appendDomid);
-                 dimIdList.push_back(dimYid);
-                 dimCoordList.push_back(StdString("nav_lon").append(appendDomid));
-                 dimCoordList.push_back(StdString("nav_lat").append(appendDomid));
+                 dimCoordList.push_back(StdString("lon").append(appendDomId));
+                 dimCoordList.push_back(StdString("lat").append(appendDomId));
                  break ;
-               case CDomain::type_attr::rectilinear :
-                 dimXid     = StdString("lon").append(appendDomid);
-                 dimIdList.push_back(dimXid);
-                 dimYid     = StdString("lat").append(appendDomid);
-                 dimIdList.push_back(dimYid);
-                 break ;
-               case CDomain::type_attr::unstructured :
-                 dimXid     = StdString("cell").append(appendDomid);
-                 dimIdList.push_back(dimXid);
-                 dimCoordList.push_back(StdString("lon").append(appendDomid));
-                 dimCoordList.push_back(StdString("lat").append(appendDomid));
-                 break ;
-            }
-            if (domain->hasArea)
-            {
-              hasArea = true;
-              cellMeasures += " area" + appendDomid;
-            }
-            ++idxDomain;
+             }
+             if (domain->hasArea)
+             {
+               hasArea = true;
+               cellMeasures += " area" + appendDomId;
+             }
+             ++idxDomain;
            }
            else
            {
              CAxis* axis = CAxis::get(axisList[idxAxis]);
-             StdString axisid = (!axis->name.isEmpty())
-                                ? axis->name.getValue() : axis->getId();
-             dimIdList.push_back(axisid);
-             dimCoordList.push_back(axisid);
-            ++idxAxis;
+             StdString axisId = !axis->name.isEmpty() ? axis->name.getValue() : axis->getId();
+
+             if (compressedOutput && axis->isCompressible())
+             {
+               dimIdList.push_back(axisId + "_points");
+               field->setUseCompressedOutput();
+             }
+             else
+               dimIdList.push_back(axisId);
+
+             dimCoordList.push_back(axisId);
+             ++idxAxis;
            }
          }
@@ -867,8 +1101,16 @@
          }
 
-         while (!dimIdList.empty())
-         {
-           dims.push_back(dimIdList.back());
-           dimIdList.pop_back();
+         if (compressedOutput && grid->isCompressible())
+         {
+           dims.push_back(grid->getId() + "_points");
+           field->setUseCompressedOutput();
+         }
+         else
+         {
+           while (!dimIdList.empty())
+           {
+             dims.push_back(dimIdList.back());
+             dimIdList.pop_back();
+           }
          }
 
@@ -1211,7 +1453,18 @@
          try
          {
-           CArray<double,1> fieldData(grid->getWrittenDataSize());
+           size_t writtenSize;
+           if (field->getUseCompressedOutput())
+             writtenSize = grid->getNumberWrittenIndexes();
+           else
+             writtenSize = grid->getWrittenDataSize();
+
+           CArray<double,1> fieldData(writtenSize);
            if (!field->default_value.isEmpty()) fieldData = field->default_value;
-           field->outputField(fieldData);
+
+           if (field->getUseCompressedOutput())
+             field->outputCompressedField(fieldData);
+           else
+             field->outputField(fieldData);
+
            if (!field->prec.isEmpty() && field->prec==2) fieldData=round(fieldData) ;
 
@@ -1232,26 +1485,94 @@
               case (ONE_FILE) :
               {
-                std::vector<int> nZoomBeginGlobal = grid->getDistributionServer()->getZoomBeginGlobal();
-                std::vector<int> nZoomBeginServer = grid->getDistributionServer()->getZoomBeginServer();
-                std::vector<int> nZoomSizeServer  = grid->getDistributionServer()->getZoomSizeServer();
-
-                int ssize = nZoomBeginGlobal.size();
-
-                std::vector<StdSize> start(ssize) ;
-                std::vector<StdSize> count(ssize) ;
-
-                for (int i = 0; i < ssize; ++i)
+                const std::vector<int>& nZoomBeginGlobal = grid->getDistributionServer()->getZoomBeginGlobal();
+                const std::vector<int>& nZoomBeginServer = grid->getDistributionServer()->getZoomBeginServer();
+                const std::vector<int>& nZoomSizeServer  = grid->getDistributionServer()->getZoomSizeServer();
+
+                std::vector<StdSize> start, count;
+
+                if (field->getUseCompressedOutput())
                 {
-                  start[i] = nZoomBeginServer[ssize-i-1] - nZoomBeginGlobal[ssize-i-1];
-                  count[i] = nZoomSizeServer[ssize-i-1];
+                  if (grid->isCompressible())
+                  {
+                    start.push_back(grid->getOffsetWrittenIndexes());
+                    count.push_back(grid->getNumberWrittenIndexes());
+                  }
+                  else
+                  {
+                    CArray<bool,1> axisDomainOrder = grid->axis_domain_order;
+                    std::vector<StdString> domainList = grid->getDomainList();
+                    std::vector<StdString> axisList   = grid->getAxisList();
+                    int numElement = axisDomainOrder.numElements();
+                    int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1;
+                    int idx = nZoomBeginGlobal.size() - 1;
+
+                    start.reserve(nZoomBeginGlobal.size());
+                    count.reserve(nZoomBeginGlobal.size());
+
+
+                    for (int i = numElement - 1; i >= 0; --i)
+                    {
+                      if (axisDomainOrder(i))
+                      {
+                        CDomain* domain = CDomain::get(domainList[idxDomain]);
+
+                        if (domain->isCompressible())
+                        {
+                          start.push_back(domain->getOffsetWrittenIndexes());
+                          count.push_back(domain->getNumberWrittenIndexes());
+                        }
+                        else
+                        {
+                          start.push_back(nZoomBeginServer[idx] - nZoomBeginGlobal[idx]);
+                          count.push_back(nZoomSizeServer[idx]);
+                          start.push_back(nZoomBeginServer[idx - 1] - nZoomBeginGlobal[idx - 1]);
+                          count.push_back(nZoomSizeServer[idx - 1]);
+                        }
+
+                        --idxDomain;
+                        idx -= 2;
+                      }
+                      else
+                      {
+                        CAxis* axis = CAxis::get(axisList[idxAxis]);
+
+                        if (axis->isCompressible())
+                        {
+                          start.push_back(axis->getOffsetWrittenIndexes());
+                          count.push_back(axis->getNumberWrittenIndexes());
+                        }
+                        else
+                        {
+                          start.push_back(nZoomBeginServer[idx] - nZoomBeginGlobal[idx]);
+                          count.push_back(nZoomSizeServer[idx]);
+                        }
+
+                        --idxAxis;
+                        --idx;
+                      }
+                    }
+                  }
                 }
-
-                SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep()-1,&start,&count );
+                else
+                {
+                  int ssize = nZoomBeginGlobal.size();
+
+                  start.resize(ssize);
+                  count.resize(ssize);
+
+                  for (int i = 0; i < ssize; ++i)
+                  {
+                    start[i] = nZoomBeginServer[ssize - i - 1] - nZoomBeginGlobal[ssize - i - 1];
+                    count[i] = nZoomSizeServer[ssize - i - 1];
+                  }
+                }
+
+                SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count);
                 if (wtime)
                 {
-                  SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep()-1,isRoot );
-                  SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep()-1,isRoot );
-                  SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep()-1, isRoot );
-                  SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep()-1, isRoot);
+                  SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot);
+                  SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep() - 1, isRoot);
+                  SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot);
+                  SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot);
                 }
 
Index: /XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.hpp	(revision 675)
+++ /XIOS/trunk/src/output/nc4_data_output.hpp	(revision 676)
@@ -41,16 +41,17 @@
 
             /// Ecriture ///
-            virtual void writeDomain_    (CDomain* domain);
-            virtual void writeAxis_      (CAxis* axis);
+            virtual void writeDomain_   (CDomain* domain);
+            virtual void writeAxis_     (CAxis* axis);
+            virtual void writeGridCompressed_(CGrid* grid);
             virtual void writeTimeDimension_(void);
-            virtual void writeField_     (CField* field);
-            virtual void writeAttribute_ (CVariable* var);
-            virtual void writeAttribute_ (CVariable* var, const string& fieldId);
-            virtual void writeFieldData_ (CField* field);
-            virtual void writeFile_      (CFile* file);
-            virtual void closeFile_      (void);
+            virtual void writeField_    (CField* field);
+            virtual void writeAttribute_(CVariable* var);
+            virtual void writeAttribute_(CVariable* var, const string& fieldId);
+            virtual void writeFieldData_(CField* field);
+            virtual void writeFile_     (CFile* file);
+            virtual void closeFile_     (void);
             virtual void syncFile_      (void);
-            virtual void writeTimeAxis_  (CField* field,
-                                          const boost::shared_ptr<CCalendar> cal);
+            virtual void writeTimeAxis_ (CField* field,
+                                         const boost::shared_ptr<CCalendar> cal);
 
          protected :
Index: /XIOS/trunk/src/output/onetcdf4_decl.cpp
===================================================================
--- /XIOS/trunk/src/output/onetcdf4_decl.cpp	(revision 675)
+++ /XIOS/trunk/src/output/onetcdf4_decl.cpp	(revision 676)
@@ -9,7 +9,8 @@
                                                const std::vector<StdSize> * count) ;
  
-  macro(double,1)
-  macro(double,2)
-  macro(double,3)                                              
+  macro(int, 1)
+  macro(double, 1)
+  macro(double, 2)
+  macro(double, 3)
  
   template void CONetCDF4::setDefaultValue<double>(const StdString & varname, const double* value) ;
