Index: XIOS/trunk/src/attribute_map.cpp
===================================================================
--- XIOS/trunk/src/attribute_map.cpp	(revision 501)
+++ XIOS/trunk/src/attribute_map.cpp	(revision 509)
@@ -13,5 +13,5 @@
       CAttributeMap::~CAttributeMap(void)
       { /* Ne rien faire de plus */ }
-      
+
       ///--------------------------------------------------------------
 
@@ -30,10 +30,15 @@
 
       bool CAttributeMap::hasAttribute(const StdString & key) const
-      { 
-         return (this->find(key) != this->end()); 
-      }
-      
-      //---------------------------------------------------------------
-      
+      {
+         return (this->find(key) != this->end());
+      }
+
+      void CAttributeMap::clearAttribute(const StdString& key)
+      {
+        if (hasAttribute(key)) this->find(key)->second->reset();
+      }
+
+      //---------------------------------------------------------------
+
       void CAttributeMap::setAttribute(const StdString & key, CAttribute * const attr)
       {
@@ -47,7 +52,7 @@
 //         this->find(key)->second->setAnyValue(attr->getAnyValue());
       }
-      
-      //---------------------------------------------------------------
-      
+
+      //---------------------------------------------------------------
+
       CAttribute * CAttributeMap::operator[](const StdString & key)
       {
@@ -57,12 +62,12 @@
          return (SuperClassMap::operator[](key));
       }
-      
-      //---------------------------------------------------------------
-      
+
+      //---------------------------------------------------------------
+
       StdString CAttributeMap::toString(void) const
       {
          typedef std::pair<StdString, CAttribute*> StdStrAttPair;
          StdOStringStream oss;
-         
+
          SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
          for (; it != end; it++)
@@ -74,20 +79,20 @@
          return (oss.str());
       }
-      
-      //---------------------------------------------------------------
-      
+
+      //---------------------------------------------------------------
+
       void CAttributeMap::fromString(const StdString & str)
-      { 
+      {
          ERROR("CAttributeMap::fromString(const StdString & str)",
-               << "[ str = " << str << "] Not implemented yet !"); 
-      }
-      
+               << "[ str = " << str << "] Not implemented yet !");
+      }
+
       //---------------------------------------------------------------
 
       //StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap)
       //{ os << attributmap.toString(); return (os); }
-      
-      //---------------------------------------------------------------
-      
+
+      //---------------------------------------------------------------
+
       void CAttributeMap::setAttributes(const xml::THashAttributes & attributes)
       {
@@ -104,11 +109,20 @@
          }
       }
-      
-      //---------------------------------------------------------------
-      
+
+      //---------------------------------------------------------------
+
+      /*!
+      \brief Set attributes from a specific attributemap, considered parent.
+         The child attribute map will insert the attributes of its parent into its current attribute map.
+      The existing attributes can be filled with the values of the parent map if they are empty or
+      simply replaced by these values depending on choice of user.
+      \param [in] _parent Attribute map from which the current map gets attributes.
+      \param [in] apply Specify if current attribute map is replaced by the attributes of parent (false)
+                    or filled in in case of emptyp (true)
+      */
       void CAttributeMap::setAttributes(const CAttributeMap * const _parent, bool apply)
       {
          typedef std::pair<StdString, CAttribute*> StdStrAttPair;
-         
+
          SuperClassMap::const_iterator it = _parent->begin(), end = _parent->end();
          for (; it != end; it++)
@@ -130,24 +144,24 @@
          }
       }
-      
-      //---------------------------------------------------------------
-/*      
+
+      //---------------------------------------------------------------
+/*
       void CAttributeMap::toBinary(StdOStream & os) const
       {
          typedef std::pair<StdString, CAttribute*> StdStrAttPair;
          SuperClassMap::const_iterator it = this->begin(), end = this->end();
-         
+
          const StdSize nbatt = SuperClassMap::size();
          os.write (reinterpret_cast<const char*>(&nbatt) , sizeof(StdSize));
-         
+
          for (; it != end; it++)
          {
             const StdString & key   = it->first;
-            const CAttribute* value = it->second;            
+            const CAttribute* value = it->second;
             const StdSize size = key.size();
-            
+
             os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize));
             os.write (key.data(), size * sizeof(char));
-            
+
             if (!value->isEmpty())
             {
@@ -156,5 +170,5 @@
                value->toBinary(os);
             }
-            else 
+            else
             {
                bool b = false;
@@ -163,12 +177,12 @@
          }
       }
-      
-      //---------------------------------------------------------------
-      
+
+      //---------------------------------------------------------------
+
       void CAttributeMap::fromBinary(StdIStream & is)
       {
          StdSize nbatt = 0;
          is.read (reinterpret_cast<char*>(&nbatt), sizeof(StdSize));
-         
+
          for (StdSize i = 0; i < nbatt; i++)
          {
@@ -178,16 +192,16 @@
             StdString key(size, ' ');
             is.read (const_cast<char *>(key.data()), size * sizeof(char));
-            
+
             if (!this->hasAttribute(key))
                ERROR("CAttributeMap::fromBinary(StdIStream & is)",
                      << "[ key = " << key << "] key not found !");
-                                        
+
             is.read (reinterpret_cast<char*>(&hasValue), sizeof(bool));
-            
-            if (hasValue)          
+
+            if (hasValue)
                this->operator[](key)->fromBinary(is);
          }
       }
- */     
+ */
       void CAttributeMap::generateCInterface(ostream& oss, const string& className)
       {
@@ -208,9 +222,9 @@
            it->second->generateFortran2003Interface(oss,className) ;
            it->second->generateFortran2003InterfaceIsDefined(oss,className) ;
-          
+
            oss<<iendl<<iendl ;
          }
-      }      
- 
+      }
+
       ///--------------------------------------------------------------
 
@@ -221,34 +235,34 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
-         oss2=new ostringstream ;
-         
-         *oss2<<"( "<<className<<"_hdl"  ;
-         
-         for ( it=begin ; it != end; it++) 
+
+         oss2=new ostringstream ;
+
+         *oss2<<"( "<<className<<"_hdl"  ;
+
+         for ( it=begin ; it != end; it++)
          {
            *oss2<<", "<<it->second->getName()<<"_" ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
          oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceDeclaration_(oss,className) ;
          }
-         
-         oss<<iendl ;
-         
+
+         oss<<iendl ;
+
          for (it=begin; it != end; it++)
          {
@@ -256,9 +270,9 @@
            oss<<iendl ;
          }
-         
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(set_"<<className<<"_attr_hdl_)"<<iendl ;
-         
-      }      
+
+      }
 
       void CAttributeMap::generateFortranInterfaceGet_hdl_(ostream& oss, const string& className)
@@ -268,34 +282,34 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
-         oss2=new ostringstream ;
-         
-         *oss2<<"( "<<className<<"_hdl"  ;
-         
-         for ( it=begin ; it != end; it++) 
+
+         oss2=new ostringstream ;
+
+         *oss2<<"( "<<className<<"_hdl"  ;
+
+         for ( it=begin ; it != end; it++)
          {
            *oss2<<", "<<it->second->getName()<<"_" ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
          oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceGetDeclaration_(oss,className) ;
          }
-         
-         oss<<iendl ;
-         
+
+         oss<<iendl ;
+
          for (it=begin; it != end; it++)
          {
@@ -303,10 +317,10 @@
            oss<<iendl ;
          }
-         
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(get_"<<className<<"_attr_hdl_)"<<iendl ;
-         
-      }     
-      
+
+      }
+
 
       void CAttributeMap::generateFortranInterfaceIsDefined_hdl_(ostream& oss, const string& className)
@@ -316,34 +330,34 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
-         oss2=new ostringstream ;
-         
-         *oss2<<"( "<<className<<"_hdl"  ;
-         
-         for ( it=begin ; it != end; it++) 
+
+         oss2=new ostringstream ;
+
+         *oss2<<"( "<<className<<"_hdl"  ;
+
+         for ( it=begin ; it != end; it++)
          {
            *oss2<<", "<<it->second->getName()<<"_" ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
          oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceIsDefinedDeclaration_(oss,className) ;
          }
-         
-         oss<<iendl ;
-         
+
+         oss<<iendl ;
+
          for (it=begin; it != end; it++)
          {
@@ -351,10 +365,10 @@
            oss<<iendl ;
          }
-         
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl_)"<<iendl ;
-         
-      }      
-       
+
+      }
+
 
       void CAttributeMap::generateFortranInterface_hdl(ostream& oss, const string& className)
@@ -364,40 +378,40 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
-         oss2=new ostringstream ;
-         *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         oss2=new ostringstream ;
-         
+
+         oss2=new ostringstream ;
+         *oss2<<"( "<<className<<"_hdl"  ;
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+         oss2=new ostringstream ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
          oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceDeclaration(oss,className) ;
          }
-         
-         oss<<iendl ;
-         
+
+         oss<<iendl ;
+
          oss<<"CALL xios(set_"<<className<<"_attr_hdl_)  &"<<iendl ;
-         
-         *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
+
+         *oss2<<"( "<<className<<"_hdl"  ;
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
            {
              oss<<oss2->str()<<"  &"<<iendl ;
@@ -408,11 +422,11 @@
          *oss2<<" )" ;
          oss<<oss2->str() ;
-         delete oss2 ; 
-         
+         delete oss2 ;
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(set_"<<className<<"_attr_hdl)"<<iendl ;
-      }      
-      
- 
+      }
+
+
       void CAttributeMap::generateFortranInterfaceGet_hdl(ostream& oss, const string& className)
       {
@@ -421,40 +435,40 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
-         oss2=new ostringstream ;
-         *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         oss2=new ostringstream ;
-         
+
+         oss2=new ostringstream ;
+         *oss2<<"( "<<className<<"_hdl"  ;
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+         oss2=new ostringstream ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
          oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceGetDeclaration(oss,className) ;
          }
-         
-         oss<<iendl ;
-         
+
+         oss<<iendl ;
+
          oss<<"CALL xios(get_"<<className<<"_attr_hdl_)  &"<<iendl ;
-         
-         *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
+
+         *oss2<<"( "<<className<<"_hdl"  ;
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
            {
              oss<<oss2->str()<<"  &"<<iendl ;
@@ -465,9 +479,9 @@
          *oss2<<" )" ;
          oss<<oss2->str() ;
-         delete oss2 ; 
-         
+         delete oss2 ;
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(get_"<<className<<"_attr_hdl)"<<iendl ;
-      }      
+      }
 
 
@@ -478,40 +492,40 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
-         oss2=new ostringstream ;
-         *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         oss2=new ostringstream ;
-         
+
+         oss2=new ostringstream ;
+         *oss2<<"( "<<className<<"_hdl"  ;
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+         oss2=new ostringstream ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
          oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceIsDefinedDeclaration(oss,className) ;
          }
-         
-         oss<<iendl ;
-         
+
+         oss<<iendl ;
+
          oss<<"CALL xios(is_defined_"<<className<<"_attr_hdl_)  &"<<iendl ;
-         
-         *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
+
+         *oss2<<"( "<<className<<"_hdl"  ;
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
            {
              oss<<oss2->str()<<"  &"<<iendl ;
@@ -522,11 +536,11 @@
          *oss2<<" )" ;
          oss<<oss2->str() ;
-         delete oss2 ; 
-         
+         delete oss2 ;
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl)"<<iendl ;
-      }      
-
-      
+      }
+
+
       void CAttributeMap::generateFortranInterface_id(ostream& oss, const string& className)
       {
@@ -535,41 +549,41 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
+
          oss2=new ostringstream ;
          *oss2<<"( "<<className<<"_id"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         oss2=new ostringstream ;
-         
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+         oss2=new ostringstream ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
 
          oss<<"TYPE(txios("<<className<<"))  :: "<<className<<"_hdl"<<iendl ;
          oss<<"CHARACTER(LEN=*), INTENT(IN) ::"<<className<<"_id"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceDeclaration(oss,className) ;
          }
-         
-         oss<<iendl ;
-         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ; 
+
+         oss<<iendl ;
+         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ;
          oss<<"CALL xios(set_"<<className<<"_attr_hdl_)   &"<<iendl ;
          *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
            {
              oss<<oss2->str()<<"  &"<<iendl ;
@@ -580,11 +594,11 @@
          *oss2<<" )" ;
          oss<<oss2->str() ;
-         delete oss2 ; 
-         
+         delete oss2 ;
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(set_"<<className<<"_attr)"<<iendl ;
-         
-      }      
-      
+
+      }
+
       void CAttributeMap::generateFortranInterfaceGet_id(ostream& oss, const string& className)
       {
@@ -593,41 +607,41 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
+
          oss2=new ostringstream ;
          *oss2<<"( "<<className<<"_id"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         oss2=new ostringstream ;
-         
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+         oss2=new ostringstream ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
 
          oss<<"TYPE(txios("<<className<<"))  :: "<<className<<"_hdl"<<iendl ;
          oss<<"CHARACTER(LEN=*), INTENT(IN) ::"<<className<<"_id"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceGetDeclaration(oss,className) ;
          }
-         
-         oss<<iendl ;
-         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ; 
+
+         oss<<iendl ;
+         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ;
          oss<<"CALL xios(get_"<<className<<"_attr_hdl_)   &"<<iendl ;
          *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
            {
              oss<<oss2->str()<<"  &"<<iendl ;
@@ -638,11 +652,11 @@
          *oss2<<" )" ;
          oss<<oss2->str() ;
-         delete oss2 ; 
-         
+         delete oss2 ;
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(get_"<<className<<"_attr)"<<iendl ;
-         
-      }      
-      
+
+      }
+
       void CAttributeMap::generateFortranInterfaceIsDefined_id(ostream& oss, const string& className)
       {
@@ -651,41 +665,41 @@
          SuperClassMap::const_iterator it ;
          SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
-         
+
          oss2=new ostringstream ;
          *oss2<<"( "<<className<<"_id"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str()<<iendl ;
-         oss<<iendl ;
-         delete oss2 ; 
-         oss2=new ostringstream ;
-         
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
+           {
+             oss<<oss2->str()<<"  &"<<iendl ;
+             delete oss2 ;
+             oss2=new ostringstream ;
+           }
+         }
+         *oss2<<" )" ;
+         oss<<oss2->str()<<iendl ;
+         oss<<iendl ;
+         delete oss2 ;
+         oss2=new ostringstream ;
+
          oss<<"IMPLICIT NONE"<<iendl++ ;
 
          oss<<"TYPE(txios("<<className<<"))  :: "<<className<<"_hdl"<<iendl ;
          oss<<"CHARACTER(LEN=*), INTENT(IN) ::"<<className<<"_id"<<iendl ;
-         
+
          for (it=begin; it != end; it++)
          {
            it->second->generateFortranInterfaceIsDefinedDeclaration(oss,className) ;
          }
-         
-         oss<<iendl ;
-         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ; 
+
+         oss<<iendl ;
+         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ;
          oss<<"CALL xios(is_defined_"<<className<<"_attr_hdl_)   &"<<iendl ;
          *oss2<<"( "<<className<<"_hdl"  ;
-         for ( it=begin ; it != end; it++) 
-         {
-           *oss2<<", "<<it->second->getName() ;
-           if (oss2->str().size()>90) 
+         for ( it=begin ; it != end; it++)
+         {
+           *oss2<<", "<<it->second->getName() ;
+           if (oss2->str().size()>90)
            {
              oss<<oss2->str()<<"  &"<<iendl ;
@@ -696,12 +710,12 @@
          *oss2<<" )" ;
          oss<<oss2->str() ;
-         delete oss2 ; 
-         
+         delete oss2 ;
+
          oss<<iendl--<<iendl-- ;
          oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr)"<<iendl ;
-         
-      }      
+
+      }
       ///--------------------------------------------------------------
-  
+
 
 } // namespace xmlioser
