Changeset 2449 for XIOS2


Ignore:
Timestamp:
12/16/22 14:16:32 (19 months ago)
Author:
jderouillat
Message:

Fix in reading rectilinear if lon/lat are not defined, neither coordinates

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

Legend:

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

    r2280 r2449  
    386386                                 const CVarPath* const path) 
    387387  { 
    388     return this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path); 
     388     
     389    return ( this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path) && (this->getAttributeValue(CCFKeywords::XIOS_CF_coordinates, &name, path)!="")); 
    389390  } 
    390391 
     
    481482  { 
    482483    StdString retvalue; 
    483     if (this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path)) 
     484    if (this->hasAttribute(CCFKeywords::XIOS_CF_coordinates, &name, path) && (this->getAttributeValue(CCFKeywords::XIOS_CF_coordinates, &name, path)!="") ) 
    484485    { 
    485486      return this->getAttributeValue(CCFKeywords::XIOS_CF_coordinates, &name, path); 
  • XIOS2/trunk/src/io/nc4_data_input.cpp

    r2280 r2449  
    77#include "axis.hpp" 
    88#include "scalar.hpp" 
     9#include "type.hpp" 
    910 
    1011namespace xios 
     
    143144    // Verify the compatibility of dimension of declared grid and real grid in file 
    144145    int realGridDim = 1; 
    145     bool isUnstructuredGrid = ((gridDim < 2) ? false :  SuperClassWriter::isUnstructured(fieldId)); 
     146    bool isUnstructuredGrid; 
     147    bool domainNotExplicitelyDefined(false); 
     148    for (int idom=0;idom<domainP.size();idom++) 
     149    { 
     150      if ( (!domainP[idom]->type.isEmpty())&& (!domainP[idom]->type.getValue()!=CDomain::type_attr::unstructured)) 
     151      { 
     152        isUnstructuredGrid = false; 
     153      } 
     154      else if (domainP[idom]->type.isEmpty()) 
     155      { 
     156        domainNotExplicitelyDefined = true; 
     157      } 
     158    } 
     159    if (domainNotExplicitelyDefined) 
     160    { 
     161      isUnstructuredGrid = ((gridDim < 2) ? false :  SuperClassWriter::isUnstructured(fieldId)); 
     162    } 
    146163    std::map<StdString, StdSize> dimSizeMap = SuperClassWriter::getDimensions(&fieldId); 
    147164    std::list<StdString> dimList = SuperClassWriter::getDimensionsList(&fieldId); 
Note: See TracChangeset for help on using the changeset viewer.