Index: XIOS/trunk/src/attribute_map.cpp
===================================================================
--- XIOS/trunk/src/attribute_map.cpp	(revision 509)
+++ XIOS/trunk/src/attribute_map.cpp	(revision 581)
@@ -5,5 +5,5 @@
 {
       /// ////////////////////// DÃ©finitions ////////////////////// ///
-      CAttributeMap * CAttributeMap::Current = NULL;
+      CAttributeMap* CAttributeMap::Current = NULL;
 
       CAttributeMap::CAttributeMap(void)
@@ -22,5 +22,5 @@
          for (; it != end; it++)
          {
-            const StdStrAttPair & att = *it;
+            const StdStrAttPair& att = *it;
             att.second->reset();
          }
@@ -29,5 +29,5 @@
       //---------------------------------------------------------------
 
-      bool CAttributeMap::hasAttribute(const StdString & key) const
+      bool CAttributeMap::hasAttribute(const StdString& key) const
       {
          return (this->find(key) != this->end());
@@ -41,5 +41,5 @@
       //---------------------------------------------------------------
 
-      void CAttributeMap::setAttribute(const StdString & key, CAttribute * const attr)
+      void CAttributeMap::setAttribute(const StdString& key, CAttribute* const attr)
       {
          if (!this->hasAttribute(key))
@@ -49,16 +49,16 @@
             ERROR("CAttributeMap::setAttribute(key, attr)",
                    << "[ key = " << key << "] attr is null !");
-         this->find(key)->second->set(*attr) ;
-//         this->find(key)->second->setAnyValue(attr->getAnyValue());
-      }
-
-      //---------------------------------------------------------------
-
-      CAttribute * CAttributeMap::operator[](const StdString & key)
+         this->find(key)->second->set(*attr);
+//       this->find(key)->second->setAnyValue(attr->getAnyValue());
+      }
+
+      //---------------------------------------------------------------
+
+      CAttribute* CAttributeMap::operator[](const StdString& key)
       {
          if (!this->hasAttribute(key))
-            ERROR("CAttributeMap::operator[](const StdString & key)",
+            ERROR("CAttributeMap::operator[](const StdString& key)",
                   << "[ key = " << key << "] key not found !");
-         return (SuperClassMap::operator[](key));
+         return SuperClassMap::operator[](key);
       }
 
@@ -73,16 +73,16 @@
          for (; it != end; it++)
          {
-            const StdStrAttPair & att = *it;
+            const StdStrAttPair& att = *it;
             if (!att.second->isEmpty())
                oss << *att.second << " ";
          }
-         return (oss.str());
-      }
-
-      //---------------------------------------------------------------
-
-      void CAttributeMap::fromString(const StdString & str)
-      {
-         ERROR("CAttributeMap::fromString(const StdString & str)",
+         return oss.str();
+      }
+
+      //---------------------------------------------------------------
+
+      void CAttributeMap::fromString(const StdString& str)
+      {
+         ERROR("CAttributeMap::fromString(const StdString& str)",
                << "[ str = " << str << "] Not implemented yet !");
       }
@@ -90,17 +90,16 @@
       //---------------------------------------------------------------
 
-      //StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap)
+      //StdOStream& operator << (StdOStream& os, const CAttributeMap& attributmap)
       //{ os << attributmap.toString(); return (os); }
 
       //---------------------------------------------------------------
 
-      void CAttributeMap::setAttributes(const xml::THashAttributes & attributes)
+      void CAttributeMap::setAttributes(const xml::THashAttributes& attributes)
       {
          for (xml::THashAttributes::const_iterator it  = attributes.begin();
                                                    it != attributes.end();
-                                                   it ++)
-         {
-            if ((*it).first.compare(StdString("id")) != 0 &&
-                (*it).first.compare(StdString("src"))!= 0)
+                                                   it++)
+         {
+            if ((*it).first.compare(StdString("id")) != 0 && (*it).first.compare(StdString("src")) != 0)
             {
                //if (CAttributeMap::operator[]((*it).first)->isEmpty())
@@ -121,5 +120,5 @@
                     or filled in in case of emptyp (true)
       */
-      void CAttributeMap::setAttributes(const CAttributeMap * const _parent, bool apply)
+      void CAttributeMap::setAttributes(const CAttributeMap* const _parent, bool apply)
       {
          typedef std::pair<StdString, CAttribute*> StdStrAttPair;
@@ -128,9 +127,9 @@
          for (; it != end; it++)
          {
-            const StdStrAttPair & el = *it;
+            const StdStrAttPair& el = *it;
             if (this->hasAttribute(el.first))
             {
-               CAttribute * currentAtt = CAttributeMap::operator[](el.first);
-               CAttribute * parentAtt = el.second ;
+               CAttribute* currentAtt = CAttributeMap::operator[](el.first);
+               CAttribute* parentAtt = el.second;
                if (apply)
                {
@@ -140,5 +139,5 @@
                  }
                }
-               else currentAtt->setInheritedValue(*parentAtt) ;
+               else currentAtt->setInheritedValue(*parentAtt);
             }
          }
@@ -147,5 +146,5 @@
       //---------------------------------------------------------------
 /*
-      void CAttributeMap::toBinary(StdOStream & os) const
+      void CAttributeMap::toBinary(StdOStream& os) const
       {
          typedef std::pair<StdString, CAttribute*> StdStrAttPair;
@@ -157,10 +156,10 @@
          for (; it != end; it++)
          {
-            const StdString & key   = it->first;
+            const StdString& key   = it->first;
             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));
+            os.write (key.data(), size* sizeof(char));
 
             if (!value->isEmpty())
@@ -180,5 +179,5 @@
       //---------------------------------------------------------------
 
-      void CAttributeMap::fromBinary(StdIStream & is)
+      void CAttributeMap::fromBinary(StdIStream& is)
       {
          StdSize nbatt = 0;
@@ -191,8 +190,8 @@
             is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
             StdString key(size, ' ');
-            is.read (const_cast<char *>(key.data()), size * sizeof(char));
+            is.read (const_cast<char *>(key.data()), size* sizeof(char));
 
             if (!this->hasAttribute(key))
-               ERROR("CAttributeMap::fromBinary(StdIStream & is)",
+               ERROR("CAttributeMap::fromBinary(StdIStream& is)",
                      << "[ key = " << key << "] key not found !");
 
@@ -209,7 +208,8 @@
          for (; it != end; it++)
          {
-           it->second->generateCInterface(oss,className) ;
-           it->second->generateCInterfaceIsDefined(oss,className) ;
-           oss<<iendl<<iendl ;
+           oss << std::endl << iendl;
+           it->second->generateCInterface(oss, className);
+           oss << iendl;
+           it->second->generateCInterfaceIsDefined(oss, className);
          }
       }
@@ -220,8 +220,8 @@
          for (; it != end; it++)
          {
-           it->second->generateFortran2003Interface(oss,className) ;
-           it->second->generateFortran2003InterfaceIsDefined(oss,className) ;
-
-           oss<<iendl<<iendl ;
+           oss << std::endl << iendl;
+           it->second->generateFortran2003Interface(oss, className);
+           oss << iendl;
+           it->second->generateFortran2003InterfaceIsDefined(oss, className);
          }
       }
@@ -231,491 +231,480 @@
       void CAttributeMap::generateFortranInterface_hdl_(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(set_"<<className<<"_attr_hdl_)   &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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 ;
-
-         for (it=begin; it != end; it++)
-         {
-           it->second->generateFortranInterfaceBody_(oss,className) ;
-           oss<<iendl ;
-         }
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(set_"<<className<<"_attr_hdl_)"<<iendl ;
-
+         oss << "SUBROUTINE xios(set_" << className << "_attr_hdl_)   &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         oss << iendl;
+         delete oss2;
+
+         oss << "IMPLICIT NONE" << iendl++;
+         oss << "TYPE(txios(" << className << ")) , INTENT(IN) :: " << className << "_hdl";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceDeclaration_(oss, className);
+         }
+
+         for (it = begin; it != end; it++)
+         {
+           oss << std::endl << iendl;
+           it->second->generateFortranInterfaceBody_(oss, className);
+         }
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(set_" << className << "_attr_hdl_)" << std::endl;
       }
 
       void CAttributeMap::generateFortranInterfaceGet_hdl_(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(get_"<<className<<"_attr_hdl_)   &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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 ;
-
-         for (it=begin; it != end; it++)
-         {
-           it->second->generateFortranInterfaceGetBody_(oss,className) ;
-           oss<<iendl ;
-         }
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(get_"<<className<<"_attr_hdl_)"<<iendl ;
-
-      }
-
+         oss << "SUBROUTINE xios(get_" << className << "_attr_hdl_)   &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         oss << iendl;
+         delete oss2;
+
+         oss << "IMPLICIT NONE" << iendl++;
+         oss << "TYPE(txios(" << className << ")) , INTENT(IN) :: " << className << "_hdl";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceGetDeclaration_(oss, className);
+         }
+
+         for (it = begin; it != end; it++)
+         {
+           oss << std::endl << iendl;
+           it->second->generateFortranInterfaceGetBody_(oss, className);
+         }
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(get_" << className << "_attr_hdl_)" << std::endl;
+      }
 
       void CAttributeMap::generateFortranInterfaceIsDefined_hdl_(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl_)   &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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 ;
-
-         for (it=begin; it != end; it++)
-         {
-           it->second->generateFortranInterfaceIsDefinedBody_(oss,className) ;
-           oss<<iendl ;
-         }
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl_)"<<iendl ;
-
-      }
-
+         oss << "SUBROUTINE xios(is_defined_" << className << "_attr_hdl_)   &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         oss << iendl;
+         delete oss2;
+
+         oss << "IMPLICIT NONE" << iendl++;
+         oss << "TYPE(txios(" << className << ")) , INTENT(IN) :: " << className << "_hdl";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceIsDefinedDeclaration_(oss, className);
+         }
+
+         for (it = begin; it != end; it++)
+         {
+           oss << std::endl << iendl;
+           it->second->generateFortranInterfaceIsDefinedBody_(oss, className);
+         }
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(is_defined_" << className << "_attr_hdl_)" << std::endl;
+      }
 
       void CAttributeMap::generateFortranInterface_hdl(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(set_"<<className<<"_attr_hdl)  &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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<<"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)
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str() ;
-         delete oss2 ;
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(set_"<<className<<"_attr_hdl)"<<iendl ;
-      }
-
+         oss << "SUBROUTINE xios(set_" << className << "_attr_hdl)  &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         oss << iendl;
+         delete oss2;
+         oss2 = new ostringstream;
+
+         oss << "IMPLICIT NONE" << iendl++;
+         oss << "TYPE(txios(" << className << ")) , INTENT(IN) :: " << className << "_hdl";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceDeclaration(oss, className);
+         }
+
+         oss << std::endl << 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)
+           {
+             oss << oss2->str() << "  &" << iendl;
+             delete oss2;
+             oss2 = new ostringstream;
+           }
+         }
+         *oss2 << " )";
+         oss << oss2->str();
+         delete oss2;
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(set_" << className << "_attr_hdl)" << std::endl;
+      }
 
       void CAttributeMap::generateFortranInterfaceGet_hdl(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(get_"<<className<<"_attr_hdl)  &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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<<"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)
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str() ;
-         delete oss2 ;
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(get_"<<className<<"_attr_hdl)"<<iendl ;
-      }
-
+         oss << "SUBROUTINE xios(get_" << className << "_attr_hdl)  &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         oss << iendl;
+         delete oss2;
+         oss2 = new ostringstream;
+
+         oss << "IMPLICIT NONE" << iendl++;
+         oss << "TYPE(txios(" << className << ")) , INTENT(IN) :: " << className << "_hdl";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceGetDeclaration(oss, className);
+         }
+
+         oss << std::endl << 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)
+           {
+             oss << oss2->str() << "  &" << iendl;
+             delete oss2;
+             oss2 = new ostringstream;
+           }
+         }
+         *oss2 << " )";
+         oss << oss2->str();
+         delete oss2;
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(get_" << className << "_attr_hdl)" << std::endl;
+      }
 
       void CAttributeMap::generateFortranInterfaceIsDefined_hdl(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl)  &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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<<"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)
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str() ;
-         delete oss2 ;
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl)"<<iendl ;
-      }
-
+         oss << "SUBROUTINE xios(is_defined_" << className << "_attr_hdl)  &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         oss << iendl;
+         delete oss2;
+         oss2 = new ostringstream;
+
+         oss << "IMPLICIT NONE" << iendl++;
+         oss << "TYPE(txios(" << className << ")) , INTENT(IN) :: " << className << "_hdl";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className);
+         }
+
+         oss << std::endl << 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)
+           {
+             oss << oss2->str() << "  &" << iendl;
+             delete oss2;
+             oss2 = new ostringstream;
+           }
+         }
+         *oss2 << " )";
+         oss << oss2->str();
+         delete oss2;
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(is_defined_" << className << "_attr_hdl)" << std::endl;
+      }
 
       void CAttributeMap::generateFortranInterface_id(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(set_"<<className<<"_attr)  &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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<<"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)
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str() ;
-         delete oss2 ;
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(set_"<<className<<"_attr)"<<iendl ;
-
+         oss << "SUBROUTINE xios(set_" << className << "_attr)  &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         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";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceDeclaration(oss, className);
+         }
+
+         oss << std::endl << 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)
+           {
+             oss << oss2->str() << "  &" << iendl;
+             delete oss2;
+             oss2 = new ostringstream;
+           }
+         }
+         *oss2 << " )";
+         oss << oss2->str();
+         delete oss2;
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(set_" << className << "_attr)" << std::endl;
       }
 
       void CAttributeMap::generateFortranInterfaceGet_id(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(get_"<<className<<"_attr)  &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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<<"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)
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str() ;
-         delete oss2 ;
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(get_"<<className<<"_attr)"<<iendl ;
-
+         oss << "SUBROUTINE xios(get_" << className << "_attr)  &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         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";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceGetDeclaration(oss, className);
+         }
+
+         oss << std::endl << 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)
+           {
+             oss << oss2->str() << "  &" << iendl;
+             delete oss2;
+             oss2 = new ostringstream;
+           }
+         }
+         *oss2 << " )";
+         oss << oss2->str();
+         delete oss2;
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(get_" << className << "_attr)" << std::endl;
       }
 
       void CAttributeMap::generateFortranInterfaceIsDefined_id(ostream& oss, const string& className)
       {
-         oss<<"SUBROUTINE xios(is_defined_"<<className<<"_attr)  &"<<iendl++ ;
-         ostringstream* oss2 ;
-         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 ;
-
-         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<<"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)
-           {
-             oss<<oss2->str()<<"  &"<<iendl ;
-             delete oss2 ;
-             oss2=new ostringstream ;
-           }
-         }
-         *oss2<<" )" ;
-         oss<<oss2->str() ;
-         delete oss2 ;
-
-         oss<<iendl--<<iendl-- ;
-         oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr)"<<iendl ;
-
-      }
-      ///--------------------------------------------------------------
-
-
+         oss << "SUBROUTINE xios(is_defined_" << className << "_attr)  &" << iendl++;
+         ostringstream* oss2;
+         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() << std::endl;
+         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";
+
+         for (it = begin; it != end; it++)
+         {
+           oss << iendl;
+           it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className);
+         }
+
+         oss << std::endl << 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)
+           {
+             oss << oss2->str() << "  &" << iendl;
+             delete oss2;
+             oss2 = new ostringstream;
+           }
+         }
+         *oss2 << " )";
+         oss << oss2->str();
+         delete oss2;
+
+         oss << std::endl << (iendl -= 2);
+         oss << "END SUBROUTINE xios(is_defined_" << className << "_attr)" << std::endl;
+      }
 } // namespace xmlioser
