Index: XIOS/trunk/src/declare_ref_func.hpp
===================================================================
--- XIOS/trunk/src/declare_ref_func.hpp	(revision 776)
+++ XIOS/trunk/src/declare_ref_func.hpp	(revision 777)
@@ -19,5 +19,8 @@
   C##type* getDirect##type##Reference(void) const;          \
   const StdString& get##type##OutputName(void) const;       \
-  void setAttributesBaseReference(bool apply = true);       \
+  void setAttributesReference(bool apply = true);       \
+                                                                       \
+private:                                                               \
+  std::vector<C##type*> refObjects;                                    \
 
 // Definitions
@@ -26,14 +29,15 @@
 void C##type::solveRefInheritance(bool apply)                          \
 {                                                                      \
-  std::set<C##type*> refObjects;                                       \
+  std::set<C##type*> tmpRefObjects;                                    \
   C##type* refer_ptr = this;                                           \
+  refObjects.push_back(this);                                          \
                                                                        \
   while (refer_ptr->hasDirect##type##Reference())                      \
   {                                                                    \
-    refObjects.insert(refer_ptr);                                      \
+    tmpRefObjects.insert(refer_ptr);                                   \
                                                                        \
     refer_ptr = refer_ptr->getDirect##type##Reference();               \
                                                                        \
-    if (refObjects.end() != refObjects.find(refer_ptr))                \
+    if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr))          \
     {                                                                  \
       ERROR("void C" #type "::solveRefInheritance(bool apply)",        \
@@ -42,11 +46,13 @@
     }                                                                  \
                                                                        \
+    refObjects.push_back(refer_ptr);                                   \
     SuperClassAttribute::setAttributes(refer_ptr, apply);              \
   }                                                                    \
 }                                                                      \
                                                                        \
-void C##type::setAttributesBaseReference(bool apply)                   \
+void C##type::setAttributesReference(bool apply)                       \
 {                                                                      \
-  baseRefObject->setAttributes(this, apply);                           \
+  for (int i = 1; i < refObjects.size(); ++i)                          \
+    refObjects[i]->setAttributes(refObjects[0], apply);                \
 }                                                                      \
                                                                        \
Index: XIOS/trunk/src/io/nc4_data_input.cpp
===================================================================
--- XIOS/trunk/src/io/nc4_data_input.cpp	(revision 776)
+++ XIOS/trunk/src/io/nc4_data_input.cpp	(revision 777)
@@ -114,5 +114,5 @@
            }
         }
-                  
+
         SuperClassWriter::getData(fieldData, fieldId, isCollective, field->getNStep() - 1, &start, &count);
         break;
@@ -133,5 +133,5 @@
   void CNc4DataInput::readFieldAttributes_(CField* field, bool readAttributeValues)
   {
-    StdString fieldId = !field->name.isEmpty() ? field->name.getValue() : field->getBaseFieldReference()->getId();
+    StdString fieldId = field->getFieldOutputName();
 
     CGrid* grid = field->grid;
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 776)
+++ XIOS/trunk/src/node/grid.cpp	(revision 777)
@@ -212,6 +212,5 @@
      for (size_t i = 0; i < axisList.size(); ++i)
      {
-       axisList[i]->solveBaseReference();
-       axisList[i]->setAttributesBaseReference();
+       axisList[i]->setAttributesReference();
      }
 
@@ -220,6 +219,5 @@
      for (size_t i = 0; i < domList.size(); ++i)
      {
-       domList[i]->solveBaseReference();
-       domList[i]->setAttributesBaseReference();
+       domList[i]->setAttributesReference();
      }
      this->hasDomainAxisBaseRef_ = true;
Index: XIOS/trunk/src/object.cpp
===================================================================
--- XIOS/trunk/src/object.cpp	(revision 776)
+++ XIOS/trunk/src/object.cpp	(revision 777)
@@ -53,5 +53,5 @@
     this->id = id;
     this->idDefined = true;
-    this->idAutoGenerated = false;
+    this->idAutoGenerated = idAutoGenerated;
   }
 
