Index: XIOS/trunk/src/interface/c/icfield.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icfield.cpp	(revision 942)
+++ XIOS/trunk/src/interface/c/icfield.cpp	(revision 943)
@@ -25,4 +25,8 @@
    typedef xios::CFieldGroup * XFieldGroupPtr;
    
+   typedef xios::CDomain     * XDomainPtr;
+   typedef xios::CAxis       * XAxisPtr;
+   typedef xios::CScalar     * XScalarPtr;
+
 // --------------------------------------------------------------------------   
 // ------------------------ CrÃ©ation des handle -----------------------------
@@ -69,5 +73,5 @@
 
 // -----------------------------------------------------------------------------------------------------   
-// ------------------------- other function----------  --------------------------- ---------------------
+// ------------------------- Other functions
 // -----------------------------------------------------------------------------------------------------   
 
@@ -78,4 +82,27 @@
     CTimer::get("XIOS").suspend() ;
   }
-   
+
+// -----------------------------------------------------------------------------------------------------
+// ------------------------- Retrieving information of grid associated to field
+// -----------------------------------------------------------------------------------------------------
+  void cxios_field_get_domain_handle(XDomainPtr * domain_hdl_ret, XFieldPtr field_hdl, int domainIndex)
+  {
+     CTimer::get("XIOS").resume() ;
+     *domain_hdl_ret = field_hdl->grid->getDomain(domainIndex);
+     CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_field_get_axis_handle(XAxisPtr * axis_hdl_ret, XFieldPtr field_hdl, int axisIndex)
+  {
+     CTimer::get("XIOS").resume() ;
+     *axis_hdl_ret = field_hdl->grid->getAxis(axisIndex);
+     CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_field_get_scalar_handle(XScalarPtr * scalar_hdl_ret, XFieldPtr field_hdl, int scalarIndex)
+  {
+     CTimer::get("XIOS").resume() ;
+     *scalar_hdl_ret = field_hdl->grid->getScalar(scalarIndex);
+     CTimer::get("XIOS").suspend();
+  }
 } // extern "C"
Index: XIOS/trunk/src/interface/fortran/field_interface.f90
===================================================================
--- XIOS/trunk/src/interface/fortran/field_interface.f90	(revision 942)
+++ XIOS/trunk/src/interface/fortran/field_interface.f90	(revision 943)
@@ -24,4 +24,25 @@
       END SUBROUTINE cxios_field_is_active
 
+      SUBROUTINE cxios_field_get_domain_handle(ret, field_hdl, idx) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         INTEGER  (kind = C_INT)     , VALUE        :: idx
+      END SUBROUTINE cxios_field_get_domain_handle
+
+      SUBROUTINE cxios_field_get_axis_handle(ret, field_hdl, idx) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         INTEGER  (kind = C_INT)     , VALUE        :: idx
+      END SUBROUTINE cxios_field_get_axis_handle
+
+      SUBROUTINE cxios_field_get_scalar_handle(ret, field_hdl, idx) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         INTEGER  (kind = C_INT)     , VALUE        :: idx
+      END SUBROUTINE cxios_field_get_scalar_handle
+
    END INTERFACE
    
Index: XIOS/trunk/src/interface/fortran/ifield.F90
===================================================================
--- XIOS/trunk/src/interface/fortran/ifield.F90	(revision 942)
+++ XIOS/trunk/src/interface/fortran/ifield.F90	(revision 943)
@@ -8,4 +8,7 @@
 !   USE IFIELDGROUP_ATTR
    USE IDURATION
+   USE IDOMAIN
+   USE IAXIS
+   USE ISCALAR
    
    TYPE txios(field)
@@ -16,5 +19,5 @@
       INTEGER(kind = C_INTPTR_T) :: daddr
    END TYPE txios(fieldgroup)
-   
+
    CONTAINS ! Fonctions disponibles pour les utilisateurs.
 
@@ -35,4 +38,88 @@
    END SUBROUTINE xios(get_fieldgroup_handle)
    
+   SUBROUTINE xios(field_id_get_domain_handle)(field_id, ret, idx)
+      IMPLICIT NONE
+      CHARACTER(len  = *)     , INTENT(IN)  :: field_id
+      INTEGER, OPTIONAL       , INTENT(IN)  :: idx
+      TYPE(txios(domain)), INTENT(OUT) :: ret
+      TYPE(txios(field))      :: field_hdl
+      INTEGER                 :: index
+      index = 0
+      IF (PRESENT(idx)) THEN
+        index = idx
+      ENDIF
+
+      CALL xios(get_field_handle)(field_id,field_hdl)
+      CALL xios(field_get_domain_handle(field_hdl, ret, index))
+   END SUBROUTINE xios(field_id_get_domain_handle)
+
+   SUBROUTINE xios(field_get_domain_handle)(field_hdl, ret, idx)
+      IMPLICIT NONE
+      TYPE(txios(field))      , INTENT(IN)  :: field_hdl
+      INTEGER, OPTIONAL       , INTENT(IN)  :: idx
+      TYPE(txios(domain)), INTENT(OUT) :: ret
+      INTEGER :: index
+      index = 0
+      IF (PRESENT(idx)) THEN
+        index = idx
+      ENDIF
+      CALL cxios_field_get_domain_handle(ret%daddr, field_hdl%daddr, index)
+   END SUBROUTINE xios(field_get_domain_handle)
+
+   SUBROUTINE xios(field_id_get_axis_handle)(field_id, ret, idx)
+      IMPLICIT NONE
+      CHARACTER(len  = *)   , INTENT(IN)  :: field_id
+      INTEGER, OPTIONAL     , INTENT(IN)  :: idx
+      TYPE(txios(axis)), INTENT(OUT) :: ret
+      TYPE(txios(field))     :: field_hdl
+      INTEGER                :: index
+      index = 0
+      IF (PRESENT(idx)) THEN
+        index = idx
+      ENDIF
+      CALL xios(get_field_handle)(field_id,field_hdl)
+      CALL xios(field_get_axis_handle(field_hdl, ret, index))
+   END SUBROUTINE xios(field_id_get_axis_handle)
+
+   SUBROUTINE xios(field_get_axis_handle)(field_hdl, ret, idx)
+      IMPLICIT NONE
+      TYPE(txios(field))    , INTENT(IN)  :: field_hdl
+      INTEGER, OPTIONAL     , INTENT(IN)  :: idx
+      TYPE(txios(axis)), INTENT(OUT) :: ret
+      INTEGER :: index
+      index = 0
+      IF (PRESENT(idx)) THEN
+        index = idx
+      ENDIF
+      CALL cxios_field_get_axis_handle(ret%daddr, field_hdl%daddr, index)
+   END SUBROUTINE xios(field_get_axis_handle)
+
+   SUBROUTINE xios(field_id_get_scalar_handle)(field_id, ret, idx)
+      IMPLICIT NONE
+      CHARACTER(len  = *)     , INTENT(IN)  :: field_id
+      INTEGER, OPTIONAL       , INTENT(IN)  :: idx
+      TYPE(txios(scalar)), INTENT(OUT) :: ret
+      TYPE(txios(field))     :: field_hdl
+      INTEGER                :: index
+      index = 0
+      IF (PRESENT(idx)) THEN
+        index = idx
+      ENDIF
+      CALL xios(get_field_handle)(field_id,field_hdl)
+      CALL xios(field_get_scalar_handle(field_hdl, ret, index))
+   END SUBROUTINE xios(field_id_get_scalar_handle)
+
+   SUBROUTINE xios(field_get_scalar_handle)(field_hdl, ret, idx)
+      IMPLICIT NONE
+      TYPE(txios(field))      , INTENT(IN)  :: field_hdl
+      INTEGER, OPTIONAL       , INTENT(IN)  :: idx
+      TYPE(txios(scalar)), INTENT(OUT) :: ret
+      INTEGER :: index
+      index = 0
+      IF (PRESENT(idx)) THEN
+        index = idx
+      ENDIF
+      CALL cxios_field_get_axis_handle(ret%daddr, field_hdl%daddr, index)
+   END SUBROUTINE xios(field_get_scalar_handle)
 
    LOGICAL FUNCTION xios(is_valid_field)(idt)
Index: XIOS/trunk/src/interface/fortran/ixios.F90
===================================================================
--- XIOS/trunk/src/interface/fortran/ixios.F90	(revision 942)
+++ XIOS/trunk/src/interface/fortran/ixios.F90	(revision 943)
@@ -113,5 +113,6 @@
 
 USE XIOS_INTERFACES, ONLY : xios(set_attr), xios(get_attr), xios(is_defined_attr), xios(get_handle), xios(add_child), &
-                            xios(send_field), xios(recv_field), xios(field_is_active), xios(getVar), xios(setVar)
+                            xios(send_field), xios(recv_field), xios(field_is_active), xios(getVar), xios(setVar), &
+                            xios(field_get_domain),xios(field_get_axis),xios(field_get_scalar)
 
 END MODULE XIOS
Index: XIOS/trunk/src/interface/fortran/ixios_interfaces.F90
===================================================================
--- XIOS/trunk/src/interface/fortran/ixios_interfaces.F90	(revision 942)
+++ XIOS/trunk/src/interface/fortran/ixios_interfaces.F90	(revision 943)
@@ -24,5 +24,7 @@
 USE idomaingroup_attr, ONLY : xios(set_domaingroup_attr_hdl), xios(get_domaingroup_attr_hdl), xios(is_defined_domaingroup_attr_hdl)
 
-USE ifield, ONLY : xios(get_field_handle), xios(get_fieldgroup_handle), xios(field_is_active_id), xios(field_is_active_hdl)
+USE ifield, ONLY : xios(get_field_handle), xios(get_fieldgroup_handle), xios(field_is_active_id), xios(field_is_active_hdl), &
+                   xios(field_get_domain_handle), xios(field_get_axis_handle), xios(field_get_scalar_handle), &
+                   xios(field_id_get_domain_handle), xios(field_id_get_axis_handle), xios(field_id_get_scalar_handle)
 
 USE ifield_attr, ONLY : xios(set_field_attr_hdl), xios(get_field_attr_hdl), xios(is_defined_field_attr_hdl)
@@ -195,4 +197,16 @@
 END INTERFACE xios(field_is_active)
 
+INTERFACE xios(field_get_domain)
+  MODULE PROCEDURE xios(field_get_domain_handle), xios(field_id_get_domain_handle)
+END INTERFACE xios(field_get_domain)
+
+INTERFACE xios(field_get_axis)
+  MODULE PROCEDURE xios(field_get_axis_handle),xios(field_id_get_axis_handle)
+END INTERFACE xios(field_get_axis)
+
+INTERFACE xios(field_get_scalar)
+  MODULE PROCEDURE xios(field_get_scalar_handle),xios(field_id_get_scalar_handle)
+END INTERFACE xios(field_get_scalar)
+
 INTERFACE xios(getVar)
   MODULE PROCEDURE xios(getVar_k8), xios(getVar_k4), xios(getVar_int), xios(getVar_logic), xios(getVar_char)
@@ -204,5 +218,6 @@
 
 PUBLIC :: xios(set_attr), xios(get_attr), xios(is_defined_attr), xios(get_handle), xios(add_child), &
-          xios(send_field), xios(recv_field), xios(field_is_active), xios(getVar), xios(setVar)
+          xios(send_field), xios(recv_field), xios(field_is_active), xios(getVar), xios(setVar), &
+          xios(field_get_domain),xios(field_get_axis),xios(field_get_scalar)
 
 END MODULE XIOS_INTERFACES
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 942)
+++ XIOS/trunk/src/node/grid.cpp	(revision 943)
@@ -1845,4 +1845,73 @@
 
   /*!
+  \brief Get domain pointer with index
+  \return domain pointer
+  */
+  CDomain* CGrid::getDomain(int domainIndex)
+  {
+    std::vector<CDomain*> domainListP = this->getDomains();
+    if (domainListP.empty())
+    {
+      ERROR("CGrid::getDomain(int domainIndex)",
+            << "No domain associated to this grid. " << std::endl
+            << "Grid id = " << this->getId());
+    }
+
+    if (domainIndex >= domainListP.size() || (domainIndex < 0))
+      ERROR("CGrid::getDomain(int domainIndex)",
+            << "Domain with the index doesn't exist " << std::endl
+            << "Grid id = " << this->getId() << std::endl
+            << "Grid has only " << domainListP.size() << " domain but domain index required is " << domainIndex << std::endl);
+
+    return domainListP[domainIndex];
+  }
+
+  /*!
+  \brief Get the axis pointer with index
+  \return axis pointer
+  */
+  CAxis* CGrid::getAxis(int axisIndex)
+  {
+    std::vector<CAxis*> axisListP = this->getAxis();
+    if (axisListP.empty())
+    {
+      ERROR("CGrid::getDomain(int axisIndex)",
+            << "No axis associated to this grid. " << std::endl
+            << "Grid id = " << this->getId());
+    }
+
+    if (axisIndex >= axisListP.size() || (axisIndex < 0))
+      ERROR("CGrid::getDomain(int axisIndex)",
+            << "Domain with the index doesn't exist " << std::endl
+            << "Grid id = " << this->getId() << std::endl
+            << "Grid has only " << axisListP.size() << " axis but axis index required is " << axisIndex << std::endl);
+
+    return axisListP[axisIndex];
+  }
+
+  /*!
+  \brief Get the a scalar pointer
+  \return scalar pointer
+  */
+  CScalar* CGrid::getScalar(int scalarIndex)
+  {
+    std::vector<CScalar*> scalarListP = this->getScalars();
+    if (scalarListP.empty())
+    {
+      ERROR("CGrid::getScalar(int scalarIndex)",
+            << "No scalar associated to this grid. " << std::endl
+            << "Grid id = " << this->getId());
+    }
+
+    if (scalarIndex >= scalarListP.size() || (scalarIndex < 0))
+      ERROR("CGrid::getScalar(int scalarIndex)",
+            << "Scalar with the index doesn't exist " << std::endl
+            << "Grid id = " << this->getId() << std::endl
+            << "Grid has only " << scalarListP.size() << " scalar but scalar index required is " << scalarIndex << std::endl);
+
+    return scalarListP[scalarIndex];
+  }
+
+  /*!
   \brief Set domain(s) of a grid from a list
   \param[in] domains list of domains
Index: XIOS/trunk/src/node/grid.hpp
===================================================================
--- XIOS/trunk/src/node/grid.hpp	(revision 942)
+++ XIOS/trunk/src/node/grid.hpp	(revision 943)
@@ -181,4 +181,7 @@
          std::vector<CAxis*> getAxis();
          std::vector<CScalar*> getScalars();
+         CDomain* getDomain(int domainIndex);
+         CAxis* getAxis(int axisIndex);
+         CScalar* getScalar(int scalarIndex);
          std::vector<int> getAxisOrder();
          std::vector<int> getGlobalDimension();
Index: XIOS/trunk/src/transformation/domain_algorithm_expand.cpp
===================================================================
--- XIOS/trunk/src/transformation/domain_algorithm_expand.cpp	(revision 942)
+++ XIOS/trunk/src/transformation/domain_algorithm_expand.cpp	(revision 943)
@@ -55,11 +55,11 @@
   }
 
-  if (!domainDestination->hasRefTo(domainSource))
-  {
-    ERROR("CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,CDomain* domainSource, CExpandDomain* expandDomain)",
-           << "Domain domain destination must refer to domain source (directly or indirectly) by domain_ref " << std::endl
-           << "Domain source " <<domainSource->getId() << std::endl
-           << "Domain destination " <<domainDestination->getId() << std::endl);
-  }
+//  if (!domainDestination->hasRefTo(domainSource))
+//  {
+//    ERROR("CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,CDomain* domainSource, CExpandDomain* expandDomain)",
+//           << "Domain domain destination must refer to domain source (directly or indirectly) by domain_ref " << std::endl
+//           << "Domain source " <<domainSource->getId() << std::endl
+//           << "Domain destination " <<domainDestination->getId() << std::endl);
+//  }
 
   this->type_ = (ELEMENT_MODIFICATION_WITH_DATA);
@@ -140,6 +140,10 @@
   StdString domainDstRef = (!domainDestination->domain_ref.isEmpty()) ? domainDestination->domain_ref.getValue()
                                                                       : "";
-  domainDestination->domain_ref.setValue(domainSource->getId());
-  domainDestination->solveRefInheritance(true);
+  if (domainDstRef != domainSource->getId())
+  {
+    domainDestination->domain_ref.setValue(domainSource->getId());
+    domainDestination->solveRefInheritance(true);
+  }
+
   if (domainDstRef.empty()) domainDestination->domain_ref.reset();
   else domainDestination->domain_ref.setValue(domainDstRef);
