Ignore:
Timestamp:
04/20/18 14:33:46 (6 years ago)
Author:
oabramkina
Message:

XIOS_DEV_CMIP: minor modifications for reading UGRID.

Using attribute nvertex defined by a user and not deduced from metadata of a file being read.
Taking into account the fact that the bounds attribute is not required by UGRID.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.cpp

    r1485 r1486  
    1111{ 
    1212  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, 
    13                                bool readMetaDataPar /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
     13                               bool readMetaDataPar /*= false*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1414    : SuperClass() 
    1515    , SuperClassWriter(filename, &comm_file, multifile, readMetaDataPar, timeCounterName) 
     
    1717    , filename(filename) 
    1818    , isCollective(isCollective) 
     19    , ugridConvention(ugridConvention) 
    1920    , readMetaDataDomains_(), readValueDomains_() 
    2021    , readMetaDataAxis_(), readValueAxis_() 
     
    419420      StdString boundsLonName = this->getBoundsId(lonName); 
    420421 
    421       int nbVertex = this->getNbVertex(fieldId); 
     422      if (ugridConvention && domain->nvertex.isEmpty()) 
     423      { 
     424        ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 
     425          << " Attribute nvertex must be specified for domain " << domain->getDomainOutputName() 
     426          << " read from UGRID file " << this->filename << " ."<< std::endl); 
     427      } 
     428//      int nbVertex = this->getNbVertex(fieldId); 
     429      int nbVertex = (ugridConvention) ? domain->nvertex : this->getNbVertex(fieldId); 
    422430      if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 
    423431      { 
Note: See TracChangeset for help on using the changeset viewer.