Changeset 2689


Ignore:
Timestamp:
12/12/24 10:54:23 (8 weeks ago)
Author:
jderouillat
Message:

Backport fixes from XIOS2 to read attributes

Location:
XIOS3/trunk/src/io
Files:
2 edited

Legend:

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

    r2631 r2689  
    384384                                 const CVarPath* const path) 
    385385  { 
    386     return this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path); 
     386    return ( this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path) && (this->getAttributeValue(CCFKeywords::XIOS_CF_coordinates, &name, path)!="")); 
    387387  } 
    388388 
     
    479479  { 
    480480    StdString retvalue; 
    481     if (this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path)) 
     481    if (this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path) && (this->getAttributeValue(CCFKeywords::XIOS_CF_coordinates, &name, path)!="") ) 
    482482    { 
    483483      return this->getAttributeValue(CCFKeywords::XIOS_CF_coordinates, &name, path); 
  • XIOS3/trunk/src/io/nc4_data_input.cpp

    r2631 r2689  
    135135    // Verify the compatibility of dimension of declared grid and real grid in file 
    136136    int realGridDim = 1; 
    137     bool isUnstructuredGrid = ((gridDim < 2 || domainP.size()==0) ? false :  SuperClassWriter::isUnstructured(fieldId)); 
     137    bool isUnstructuredGrid( (domainP.size()>0)  ); 
     138    bool domainNotExplicitelyDefined(false); 
     139    for (int idom=0;idom<domainP.size();idom++) 
     140    { 
     141      if ( (!domainP[idom]->type.isEmpty())&&  
     142           !(domainP[idom]->type.getValue()==CDomain::type_attr::unstructured || domainP[idom]->type.getValue()==CDomain::type_attr::gaussian)) 
     143      { 
     144        isUnstructuredGrid = false; 
     145      } 
     146      else if (domainP[idom]->type.isEmpty()) 
     147      { 
     148        domainNotExplicitelyDefined = true; 
     149      } 
     150    } 
     151    if (domainNotExplicitelyDefined) 
     152    { 
     153      isUnstructuredGrid = SuperClassWriter::isUnstructured(fieldId); 
     154    } 
    138155    std::map<StdString, StdSize> dimSizeMap = SuperClassWriter::getDimensions(&fieldId); 
    139156    std::list<StdString> dimList = SuperClassWriter::getDimensionsList(&fieldId); 
Note: See TracChangeset for help on using the changeset viewer.