Index: /XIOS/trunk/src/config/extract_axis_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/extract_axis_attribute.conf	(revision 1558)
+++ /XIOS/trunk/src/config/extract_axis_attribute.conf	(revision 1558)
@@ -0,0 +1,4 @@
+/*  GLOBAL   */
+DECLARE_ATTRIBUTE(int,       begin)
+DECLARE_ATTRIBUTE(int,       n)
+DECLARE_ARRAY(int    ,1    , index)
Index: /XIOS/trunk/src/config/node_type.conf
===================================================================
--- /XIOS/trunk/src/config/node_type.conf	(revision 1557)
+++ /XIOS/trunk/src/config/node_type.conf	(revision 1558)
@@ -111,4 +111,8 @@
 #endif //__XIOS_CExtractDomain__
 
+#ifdef __XIOS_CExtractAxis__
+   DECLARE_NODE(ExtractAxis, extract_axis)
+#endif //__XIOS_CExtractAxis__
+
 #ifdef __XIOS_CContext__
    DECLARE_NODE_PAR(Context, context)
Index: /XIOS/trunk/src/generate_fortran_interface.cpp
===================================================================
--- /XIOS/trunk/src/generate_fortran_interface.cpp	(revision 1557)
+++ /XIOS/trunk/src/generate_fortran_interface.cpp	(revision 1558)
@@ -41,4 +41,6 @@
   CZoomAxis zoomAxis;
   CInverseAxis inverseAxis;
+  CExtractAxis extractAxis;
+
   CReduceDomainToAxis reduceDomainToAxis;
   CReduceAxisToAxis reduceAxisToAxis;
@@ -360,4 +362,8 @@
   file.close();
 
+  file.open((path+"extract_axis_interface_attr.F90").c_str());
+  extractAxis.generateFortran2003Interface(file);
+  file.close();
+
   file.open((path+"icinverse_axis_attr.cpp").c_str());
   inverseAxis.generateCInterface(file);
Index: /XIOS/trunk/src/group_factory_decl.cpp
===================================================================
--- /XIOS/trunk/src/group_factory_decl.cpp	(revision 1557)
+++ /XIOS/trunk/src/group_factory_decl.cpp	(revision 1558)
@@ -28,4 +28,5 @@
   macro(CZoomAxisGroup)
   macro(CInterpolateAxisGroup)
+  macro(CExtractAxisGroup)
   macro(CZoomDomainGroup)
   macro(CInterpolateDomainGroup)
Index: /XIOS/trunk/src/group_template_decl.cpp
===================================================================
--- /XIOS/trunk/src/group_template_decl.cpp	(revision 1557)
+++ /XIOS/trunk/src/group_template_decl.cpp	(revision 1558)
@@ -17,4 +17,5 @@
   macro(ZoomAxis)
   macro(InterpolateAxis)
+  macro(ExtractAxis)
   macro(ZoomDomain)
   macro(InterpolateDomain)
Index: /XIOS/trunk/src/node/axis.cpp
===================================================================
--- /XIOS/trunk/src/node/axis.cpp	(revision 1557)
+++ /XIOS/trunk/src/node/axis.cpp	(revision 1558)
@@ -51,4 +51,5 @@
      m["zoom_axis"] = TRANS_ZOOM_AXIS;
      m["interpolate_axis"] = TRANS_INTERPOLATE_AXIS;
+     m["extract_axis"] = TRANS_EXTRACT_AXIS;
      m["inverse_axis"] = TRANS_INVERSE_AXIS;
      m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_AXIS;
Index: /XIOS/trunk/src/node/axis.hpp
===================================================================
--- /XIOS/trunk/src/node/axis.hpp	(revision 1557)
+++ /XIOS/trunk/src/node/axis.hpp	(revision 1558)
@@ -125,4 +125,7 @@
       public: 
         bool hasValue;        
+        bool hasBounds;
+        bool hasLabel;
+
         CArray<size_t,1> localIndexToWriteOnServer;        
 
@@ -173,6 +176,4 @@
          std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer;
          std::map<int, std::vector<int> > connectedServerRank_;
-         bool hasBounds;
-         bool hasLabel;         
          bool computedWrittenIndex_;                  
 
Index: /XIOS/trunk/src/node/extract_axis.cpp
===================================================================
--- /XIOS/trunk/src/node/extract_axis.cpp	(revision 1558)
+++ /XIOS/trunk/src/node/extract_axis.cpp	(revision 1558)
@@ -0,0 +1,79 @@
+#include "extract_axis.hpp"
+#include "type.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CExtractAxis::CExtractAxis(void)
+    : CObjectTemplate<CExtractAxis>(), CExtractAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CExtractAxis::CExtractAxis(const StdString & id)
+    : CObjectTemplate<CExtractAxis>(id), CExtractAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CExtractAxis::~CExtractAxis(void)
+  {}
+
+  CTransformation<CAxis>* CExtractAxis::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CExtractAxis* extractAxis = CExtractAxisGroup::get("extract_axis_definition")->createChild(id);
+    if (node) extractAxis->parse(*node);
+    return static_cast<CTransformation<CAxis>*>(extractAxis);
+  }
+
+  bool CExtractAxis::registerTrans()
+  {
+    return registerTransformation(TRANS_EXTRACT_AXIS, CExtractAxis::create);
+  }
+
+  bool CExtractAxis::_dummyRegistered = CExtractAxis::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CExtractAxis::GetName(void)    { return StdString("extract_axis"); }
+  StdString CExtractAxis::GetDefName(void) { return StdString("extract_axis"); }
+  ENodeType CExtractAxis::GetType(void)    { return eExtractAxis; }
+
+  void CExtractAxis::checkValid(CAxis* axisDest)
+  {
+    int axisIBegin, axisNi, axisGlobalSize;
+    int begin, end, n;
+
+    axisIBegin = axisDest->begin.getValue();
+    axisNi     = axisDest->n.getValue();
+    axisGlobalSize   = axisDest->n_glo.getValue();
+
+    bool extractByIndex = !this->index.isEmpty() && (0 != this->index.numElements());
+
+    if (extractByIndex)
+    {
+      begin = min(this->index);
+      end   = max(this->index);
+      n     = end - begin + 1;
+    }
+    else
+    {
+      begin = (this->begin.isEmpty()) ?  0 : this->begin.getValue();
+      n     = (this->n.isEmpty()) ?  axisGlobalSize : this->n.getValue();
+      end   = begin+n-1;
+    }
+
+    if (begin < 0 || begin > axisGlobalSize - 1 || end < 0 || end > axisGlobalSize - 1
+        || n < 1 || n > axisGlobalSize || begin > end)
+      ERROR("CExtractAxis::checkValid(CAxis* axisDest)",
+            << "One or more attributes among 'begin' (" << begin << "), 'end' (" << end << "), 'n' (" << n << ") "
+            << "of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified");
+    
+    if (extractByIndex && (!this->begin.isEmpty() || !this->n.isEmpty()))
+      ERROR("CExtractAxis::checkValid(CAxis* axisDest)",
+            << "Only one type of extract is accepted. Define extract by index with global_extract_index or define extract with begin and n. "
+            << "Axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified");
+
+    this->begin.setValue(begin);
+    this->n.setValue(n);
+
+  }
+
+}
Index: /XIOS/trunk/src/node/extract_axis.hpp
===================================================================
--- /XIOS/trunk/src/node/extract_axis.hpp	(revision 1558)
+++ /XIOS/trunk/src/node/extract_axis.hpp	(revision 1558)
@@ -0,0 +1,67 @@
+#ifndef __XIOS_CExtractAxis__
+#define __XIOS_CExtractAxis__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "axis.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CExtractAxisGroup;
+  class CExtractAxisAttributes;
+  class CExtractAxis;
+  class CAxis;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CExtractAxis)
+#include "extract_axis_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CExtractAxis)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CExtractAxis
+    This class describes extract_axis in xml file.
+  */
+  class CExtractAxis
+    : public CObjectTemplate<CExtractAxis>
+    , public CExtractAxisAttributes
+    , public CTransformation<CAxis>
+  {
+    public :
+      typedef CObjectTemplate<CExtractAxis> SuperClass;
+      typedef CExtractAxisAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CExtractAxis(void);
+      explicit CExtractAxis(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CExtractAxis(void);
+
+      virtual void checkValid(CAxis* axisDest);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+      static bool registerTrans();
+      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CExtractAxis
+
+  DECLARE_GROUP(CExtractAxis);
+} // namespace xios
+
+#endif // __XIOS_CExtractAxis__
Index: /XIOS/trunk/src/node/node_enum.hpp
===================================================================
--- /XIOS/trunk/src/node/node_enum.hpp	(revision 1557)
+++ /XIOS/trunk/src/node/node_enum.hpp	(revision 1558)
@@ -23,4 +23,5 @@
          eZoomAxis,
          eInterpolateAxis,
+         eExtractAxis,
          eZoomDomain,
          eInterpolateDomain,
Index: /XIOS/trunk/src/node/node_type.hpp
===================================================================
--- /XIOS/trunk/src/node/node_type.hpp	(revision 1557)
+++ /XIOS/trunk/src/node/node_type.hpp	(revision 1558)
@@ -13,4 +13,5 @@
 #include "zoom_axis.hpp"
 #include "interpolate_axis.hpp"
+#include "extract_axis.hpp"
 #include "zoom_domain.hpp"
 #include "interpolate_domain.hpp"
Index: /XIOS/trunk/src/node/transformation_enum.hpp
===================================================================
--- /XIOS/trunk/src/node/transformation_enum.hpp	(revision 1557)
+++ /XIOS/trunk/src/node/transformation_enum.hpp	(revision 1558)
@@ -25,5 +25,6 @@
         TRANS_REDUCE_SCALAR_TO_SCALAR = 16,
         TRANS_REORDER_DOMAIN = 17,
-        TRANS_EXTRACT_DOMAIN = 18
+        TRANS_EXTRACT_DOMAIN = 18,
+        TRANS_EXTRACT_AXIS = 19
       } ETranformationType;
 
Index: /XIOS/trunk/src/object_factory_decl.cpp
===================================================================
--- /XIOS/trunk/src/object_factory_decl.cpp	(revision 1557)
+++ /XIOS/trunk/src/object_factory_decl.cpp	(revision 1558)
@@ -29,4 +29,5 @@
   macro(CZoomAxis)
   macro(CInterpolateAxis)
+  macro(CExtractAxis)
   macro(CZoomDomain)
   macro(CInterpolateDomain)
@@ -57,4 +58,5 @@
   macro(CZoomAxisGroup)
   macro(CInterpolateAxisGroup)
+  macro(CExtractAxisGroup)
   macro(CZoomDomainGroup)
   macro(CInterpolateDomainGroup)
Index: /XIOS/trunk/src/object_template_decl.cpp
===================================================================
--- /XIOS/trunk/src/object_template_decl.cpp	(revision 1557)
+++ /XIOS/trunk/src/object_template_decl.cpp	(revision 1558)
@@ -16,4 +16,5 @@
   template class CObjectTemplate<CZoomAxis>;
   template class CObjectTemplate<CInterpolateAxis>;
+  template class CObjectTemplate<CExtractAxis>;
   template class CObjectTemplate<CZoomDomain>;
   template class CObjectTemplate<CInterpolateDomain>;
@@ -44,4 +45,5 @@
   template class CObjectTemplate<CZoomAxisGroup>;
   template class CObjectTemplate<CInterpolateAxisGroup>;
+  template class CObjectTemplate<CExtractAxisGroup>;
   template class CObjectTemplate<CZoomDomainGroup>;
   template class CObjectTemplate<CInterpolateDomainGroup>;
Index: /XIOS/trunk/src/transformation/algo_types.hpp
===================================================================
--- /XIOS/trunk/src/transformation/algo_types.hpp	(revision 1557)
+++ /XIOS/trunk/src/transformation/algo_types.hpp	(revision 1558)
@@ -17,4 +17,5 @@
 #include "axis_algorithm_zoom.hpp"
 #include "axis_algorithm_interpolate.hpp"
+#include "axis_algorithm_extract.hpp"
 #include "axis_algorithm_reduce_domain.hpp"
 #include "axis_algorithm_reduce_axis.hpp"
Index: /XIOS/trunk/src/transformation/axis_algorithm_extract.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_extract.cpp	(revision 1558)
+++ /XIOS/trunk/src/transformation/axis_algorithm_extract.cpp	(revision 1558)
@@ -0,0 +1,114 @@
+/*!
+   \file axis_algorithm_extract.cpp
+   \brief Algorithm for extracting an axis.
+ */
+#include "axis_algorithm_extract.hpp"
+#include "axis.hpp"
+#include "grid.hpp"
+#include "grid_transformation_factory_impl.hpp"
+#include "extract_axis.hpp"
+
+namespace xios {
+CGenericAlgorithmTransformation* CAxisAlgorithmExtract::create(CGrid* gridDst, CGrid* gridSrc,
+                                                           CTransformation<CAxis>* transformation,
+                                                           int elementPositionInGrid,
+                                                           std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                           std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                           std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                           std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                           std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                           std::map<int, int>& elementPositionInGridDst2DomainPosition)
+{
+  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
+  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
+
+  CExtractAxis* extractAxis = dynamic_cast<CExtractAxis*> (transformation);
+  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
+  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
+
+  return (new CAxisAlgorithmExtract(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], extractAxis));
+}
+bool CAxisAlgorithmExtract::registerTrans()
+{
+  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_AXIS, create);
+}
+
+CAxisAlgorithmExtract::CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis)
+: CAxisAlgorithmTransformation(axisDestination, axisSource)
+{
+  extractAxis->checkValid(axisSource);
+  extractBegin_ = extractAxis->begin.getValue();
+  extractN_  = extractAxis->n.getValue();
+  extractEnd_   = extractBegin_ + extractN_ - 1;
+
+  if (extractN_ > axisSource->n_glo.getValue())
+  {
+    ERROR("CAxisAlgorithmExtract::CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis)",
+           << "Extract size is greater than global size of source axis"
+           << "Global size of source axis " <<axisSource->getId() << " is " << axisSource->n_glo.getValue()  << std::endl
+           << "Extract size is " << extractN_ );
+  }
+
+  int idxSrc, nDest = 0, beginDestLoc, beginDestGlo = 0 ;
+  int indGloDest, indGloSrc, iSrc;
+  for (int i = 0; i < axisSrc_->n.getValue(); i++)
+  {
+    idxSrc = axisSrc_->index(i);
+    if ((idxSrc >= extractBegin_) && (idxSrc <= extractEnd_))
+    {
+      if (nDest == 0) beginDestLoc = i;
+      ++nDest;
+    }
+  }
+  beginDestGlo = beginDestLoc + axisSrc_->begin - extractBegin_;
+  axisDest_->n_glo.setValue(extractN_);
+  axisDest_->n.setValue(nDest);
+  axisDest_->begin.setValue(beginDestGlo);
+  axisDest_->index.resize(nDest);
+
+  axisDest_->data_n.setValue(nDest);
+  axisDest_->data_begin.setValue(0);
+  axisDest_->data_index.resize(nDest);
+
+  axisDest_->mask.resize(nDest);
+  if (axisSrc_->hasValue) axisDest_->value.resize(nDest);
+  if (axisSrc_->hasLabel) axisDest_->label.resize(nDest);
+  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest);
+
+  this->transformationMapping_.resize(1);
+  this->transformationWeight_.resize(1);
+  TransformationIndexMap& transMap = this->transformationMapping_[0];
+  TransformationWeightMap& transWeight = this->transformationWeight_[0];
+
+  for (int iDest = 0; iDest < nDest; iDest++)
+  {
+    iSrc = iDest + beginDestLoc;
+    axisDest_->index(iDest) = iDest + beginDestGlo;
+    axisDest_->data_index(iDest) = axisSrc_->data_index(iSrc) - beginDestLoc;
+    axisDest_->mask(iDest) = axisSrc_->mask(iSrc);
+
+    if (axisSrc_->hasValue)
+      axisDest_->value(iDest) = axisSrc_->value(iSrc);
+    if (axisSrc_->hasLabel)
+      axisDest_->label(iDest) = axisSrc_->label(iSrc);
+    if (axisSrc_->hasBounds)
+    {
+      axisDest_->bounds(0,iDest) = axisSrc_->bounds(0,iSrc);
+      axisDest_->bounds(1,iDest) = axisSrc_->bounds(1,iSrc);
+    }
+    indGloDest = axisDest_->index(iDest);
+    indGloSrc = axisSrc_->index(iSrc);
+    transMap[indGloDest].push_back(indGloSrc);
+    transWeight[indGloDest].push_back(1.0);
+
+  }
+}
+
+/*!
+  Compute the index mapping between domain on grid source and one on grid destination
+*/
+void CAxisAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
+{
+}
+
+}
Index: /XIOS/trunk/src/transformation/axis_algorithm_extract.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_extract.hpp	(revision 1558)
+++ /XIOS/trunk/src/transformation/axis_algorithm_extract.hpp	(revision 1558)
@@ -0,0 +1,60 @@
+/*!
+   \file axis_algorithm_extract.hpp
+   \brief Algorithm for extracting an axis.
+ */
+#ifndef __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__
+#define __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__
+
+#include "axis_algorithm_transformation.hpp"
+#include "transformation.hpp"
+
+namespace xios {
+class CAxis;
+class CExtractAxis;
+
+/*!
+  \class CAxisAlgorithmExtract
+  Implementing extract on axis
+  A extracted region can be considered as region that isn't masked.
+  Only this extracted region is extracted to write on Netcdf.
+*/
+class CAxisAlgorithmExtract : public CAxisAlgorithmTransformation
+{
+public:
+  CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis);
+
+  virtual ~CAxisAlgorithmExtract() {}
+
+  static bool registerTrans();
+protected:
+  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
+
+private:
+
+private:
+  //! Global extract begin on axis
+  StdSize extractBegin_;
+
+  //! Global extract end on axis
+  StdSize extractEnd_;
+
+  //! Global extract size on axis
+  StdSize extractN_;
+
+  std::vector<int> extractIndex_;
+
+private:
+
+  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
+                                                CTransformation<CAxis>* transformation,
+                                                int elementPositionInGrid,
+                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
+};
+
+}
+#endif // __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__
Index: /XIOS/trunk/src/transformation/grid_transformation_selector.cpp
===================================================================
--- /XIOS/trunk/src/transformation/grid_transformation_selector.cpp	(revision 1557)
+++ /XIOS/trunk/src/transformation/grid_transformation_selector.cpp	(revision 1558)
@@ -28,4 +28,5 @@
   CAxisAlgorithmExtractDomain::registerTrans();
   CAxisAlgorithmInterpolate::registerTrans();
+  CAxisAlgorithmExtract::registerTrans();
   CAxisAlgorithmInverse::registerTrans();
   CAxisAlgorithmReduceDomain::registerTrans();
Index: /XIOS/trunk/src/type/type_util.hpp
===================================================================
--- /XIOS/trunk/src/type/type_util.hpp	(revision 1557)
+++ /XIOS/trunk/src/type/type_util.hpp	(revision 1558)
@@ -26,4 +26,6 @@
     class CInterpolateAxis;
     class CInterpolateAxisGroup;
+    class CExtractAxis;
+    class CExtractAxisGroup;
     class CZoomDomain;
     class CZoomDomainGroup;
@@ -102,4 +104,6 @@
   macro(CInterpolateAxis)
   macro(CInterpolateAxisGroup)
+  macro(CExtractAxis)
+  macro(CExtractAxisGroup)
   macro(CZoomDomain)
   macro(CZoomDomainGroup)
Index: /XIOS/trunk/src/xml_parser_decl.cpp
===================================================================
--- /XIOS/trunk/src/xml_parser_decl.cpp	(revision 1557)
+++ /XIOS/trunk/src/xml_parser_decl.cpp	(revision 1558)
@@ -22,4 +22,5 @@
     macro( ZoomAxis )
     macro( InterpolateAxis )
+    macro( ExtractAxis )
     macro( ZoomDomain )
     macro( InterpolateDomain )
