Ignore:
Timestamp:
04/20/18 15:04:38 (6 years ago)
Author:
oabramkina
Message:

Trunk: 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/trunk/src/io/nc4_data_input.cpp

    r1257 r1487  
    1010namespace xios 
    1111{ 
    12   CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     12  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1313    : SuperClass() 
    1414    , SuperClassWriter(filename, &comm_file, multifile, timeCounterName) 
     
    1616    , filename(filename) 
    1717    , isCollective(isCollective) 
     18    , ugridConvention(ugridConvention) 
    1819    , readMetaDataDomains_(), readValueDomains_() 
    1920    , readMetaDataAxis_(), readValueAxis_() 
     
    360361      StdString boundsLonName = this->getBoundsId(lonName); 
    361362 
    362       int nbVertex = this->getNbVertex(fieldId); 
     363      if (ugridConvention && domain->nvertex.isEmpty()) 
     364      { 
     365        ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 
     366          << " Attribute nvertex must be specified for domain " << domain->getDomainOutputName() 
     367          << " read from UGRID file " << this->filename << " ."<< std::endl); 
     368      } 
     369//      int nbVertex = this->getNbVertex(fieldId); 
     370      int nbVertex = (ugridConvention) ? domain->nvertex : this->getNbVertex(fieldId); 
    363371      if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 
    364372      { 
Note: See TracChangeset for help on using the changeset viewer.