Ignore:
Timestamp:
02/03/14 14:16:20 (10 years ago)
Author:
ymipsl
Message:

Enhancement : user defined global and field attribute can be output in the netcdfcf file.
A variable child element inclosed into a file element will be output as a global file attribute.
A variable child element inclosed into a field element will be output as a field attribute.

+ variable fortran interface added

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/group_parser.hpp

    r462 r472  
    8080      } 
    8181   } 
     82  
     83  /// ////////////////////// Définitions ////////////////////// /// 
     84   template <class U, class V, class W> 
     85      void CGroupTemplate<U, V, W>::parseChild(xml::CXMLNode & node) 
     86   { 
    8287 
     88 
     89      // PARSING POUR GESTION DES ENFANTS 
     90           V* group_ptr = (this->hasId())  
     91         ? V::get(this->getId()) 
     92         : boost::polymorphic_downcast<V*>(this); 
     93 
     94          StdString name = node.getElementName(); 
     95          attributes.clear(); 
     96          attributes = node.getAttributes(); 
     97 
     98          if (name.compare(V::GetName()) == 0) 
     99          { 
     100             if (attributes.end() == attributes.find("id")) 
     101                CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node); 
     102                return ; 
     103             else 
     104                CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node); 
     105             continue; 
     106          } 
     107 
     108          if (name.compare(U::GetName()) == 0) 
     109          { 
     110             if (attributes.end() == attributes.find("id")) 
     111                CGroupFactory::CreateChild(group_ptr->getShared())->parse(node); 
     112                return ; 
     113             else 
     114                CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node); 
     115             continue; 
     116          } 
     117 
     118          DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId() 
     119                << "\', un objet de type \'" << V::GetName() 
     120                << "\' ne peut contenir qu'un objet de type \'" << V::GetName() 
     121                << "\' ou de type \'" << U::GetName() 
     122                << "\' (reçu : " << name << ") !"); 
     123 
     124   } 
    83125} // namespace xios 
    84126 
Note: See TracChangeset for help on using the changeset viewer.