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_template_impl.hpp

    r462 r472  
    551551      } 
    552552   } 
     553    
     554   template <class U, class V, class W> 
     555   void CGroupTemplate<U, V, W>::parseChild(xml::CXMLNode & node) 
     556   { 
     557 
     558 
     559      // PARSING POUR GESTION DES ENFANTS 
     560           V* group_ptr = (this->hasId())  
     561         ? V::get(this->getId()) 
     562         : boost::polymorphic_downcast<V*>(this); 
     563 
     564          StdString name = node.getElementName(); 
     565          xml::THashAttributes attributes = node.getAttributes(); 
     566 
     567          if (name.compare(V::GetName()) == 0) 
     568          { 
     569             if (attributes.end() == attributes.find("id")) 
     570                CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node); 
     571             else 
     572                CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node); 
     573             return ; 
     574          } 
     575          else if (name.compare(U::GetName()) == 0) 
     576          { 
     577             if (attributes.end() == attributes.find("id")) 
     578                CGroupFactory::CreateChild(group_ptr->getShared())->parse(node); 
     579             else 
     580                CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node); 
     581             return ; 
     582          } 
     583 
     584          DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId() 
     585                << "\', un objet de type \'" << V::GetName() 
     586                << "\' ne peut contenir qu'un objet de type \'" << V::GetName() 
     587                << "\' ou de type \'" << U::GetName() 
     588                << "\' (reçu : " << name << ") !"); 
     589 
     590   } 
    553591} // namespace xios 
    554592 
Note: See TracChangeset for help on using the changeset viewer.