Ignore:
Timestamp:
07/27/22 11:49:51 (2 years ago)
Author:
jderouillat
Message:

Move renames of the attributes name in the element classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/io/nc4_data_output.cpp

    r2387 r2389  
    2020            , SuperClassWriter(filename, exist) 
    2121            , filename(filename) 
    22             , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none), relElements_() 
     22            , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none), relAxis_(), relDomains_() 
    2323      { 
    2424        SuperClass::type = MULTI_FILE; 
     
    3434            , filename(filename) 
    3535            , isCollective(isCollective) 
    36             , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none), relElements_() 
     36            , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none), relAxis_(), relDomains_() 
    3737      { 
    3838        SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 
     
    7979              { 
    8080                // if yes, associate the same ids to current element 
    81                 domain->name = it->second.second->getDomainOutputName(); 
    82                 domain->lon_name = it->second.second->lon_name; 
    83                 domain->lat_name = it->second.second->lat_name; 
    84                 if (domain->type == CDomain::type_attr::unstructured) 
    85                 { 
    86                   domain->dim_i_name = it->second.second->dim_i_name; 
    87                   domain->dim_j_name = it->second.second->dim_j_name; 
    88                 } 
     81                domain->renameAttributesBeforeWriting( it->second.second ); 
    8982                elementIsInMap = true; 
    9083              } 
     
    9386            if (!elementIsInMap)  // ! in MAP 
    9487            { 
    95               domain->name =  domain->getId(); 
    96               domain->lon_name = "lon_"+domain->getId(); 
    97               domain->lat_name = "lat_"+domain->getId(); 
    98               if (domain->type == CDomain::type_attr::unstructured) 
    99               { 
    100                 domain->dim_i_name = "cell_"+domain->getId(); 
    101                 domain->dim_j_name = "nvertex_"+domain->getId(); 
    102               } 
     88              domain->renameAttributesBeforeWriting(); 
    10389              relDomains_.insert( make_pair( defaultNameKey, make_pair(globalHash, domain) ) ) ;          
    10490            } 
     
    10561042 
    10571043          StdString defaultNameKey = axis->getAxisOutputName(); 
    1058           if ( !relElements_.count ( defaultNameKey ) ) 
     1044          if ( !relAxis_.count ( defaultNameKey ) ) 
    10591045          { 
    10601046            // if defaultNameKey not in the map, write the element such as it is defined 
    1061             relElements_.insert( make_pair( defaultNameKey, make_pair(globalHash, defaultNameKey) ) ); 
     1047            relAxis_.insert( make_pair( defaultNameKey, make_pair(globalHash, axis) ) ); 
    10621048          } 
    10631049          else // look if a hash associated this key is equal 
    10641050          { 
    10651051            bool elementIsInMap(false); 
    1066             auto defaultNameKeyElements = relElements_.equal_range( defaultNameKey ); 
     1052            auto defaultNameKeyElements = relAxis_.equal_range( defaultNameKey ); 
    10671053            for (auto it = defaultNameKeyElements.first; it != defaultNameKeyElements.second; it++) 
    10681054            { 
     
    10701056              { 
    10711057                // if yes, associate the same ids to current element 
    1072                 axis->name = it->second.second; 
     1058                axis->renameAttributesBeforeWriting( it->second.second ); 
    10731059                elementIsInMap = true; 
    10741060              } 
     
    10771063            if (!elementIsInMap)  // ! in MAP 
    10781064            { 
    1079               axis->name =  axis->getId(); 
    1080               relElements_.insert( make_pair( defaultNameKey, make_pair(globalHash, axis->getAxisOutputName()) ) ) ;// = axis->getId()           
     1065              axis->renameAttributesBeforeWriting(); 
     1066              relAxis_.insert( make_pair( defaultNameKey, make_pair(globalHash, axis) ) ) ;// = axis->getId()           
    10811067            } 
    10821068          } 
Note: See TracChangeset for help on using the changeset viewer.