Changeset 807
- Timestamp:
- 12/13/15 15:37:26 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/nc4_data_input.cpp
r802 r807 145 145 bool isUnstructuredGrid = SuperClassWriter::isUnstructured(fieldId); 146 146 std::map<StdString, StdSize> dimSizeMap = SuperClassWriter::getDimensions(&fieldId); 147 std::list<StdString> dimList = SuperClassWriter::getDimensionsList(&fieldId); 148 147 149 realGridDim = SuperClassWriter::isTemporal(fieldId) ? dimSizeMap.size() - 1 : dimSizeMap.size(); 148 150 if (isUnstructuredGrid) ++realGridDim; … … 154 156 155 157 // Remove unlimited dimension from the map, we dont need it anymore 156 if (SuperClassWriter::isTemporal(fieldId)) dimSizeMap.erase(SuperClassWriter::getUnlimitedDimensionName()); 158 if (SuperClassWriter::isTemporal(fieldId)) 159 { 160 dimSizeMap.erase(SuperClassWriter::getUnlimitedDimensionName()); 161 dimList.pop_front() ; // assume time dimension is first 162 } 163 157 164 int mapSize = dimSizeMap.size() - 1; 158 165 std::list<std::pair<StdString, StdSize> > listDimSize; 166 /* 159 167 for (std::map<StdString, StdSize>::const_iterator itMap = dimSizeMap.begin(); itMap != dimSizeMap.end(); ++itMap) 160 168 listDimSize.push_front(*itMap); 169 */ 170 for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) 171 listDimSize.push_front(*dimSizeMap.find(*it)); 161 172 162 173 // Now process domain and axis … … 274 285 else if (this->isUnstructured(fieldId)) 275 286 { 287 /* 276 288 if (domain->i_index.isEmpty()) 277 289 ERROR("CNc4DataInput::readDomainAttributeValueFromFile(...)", … … 279 291 << "Trying to read attributes from unstructured grid." 280 292 << "i_index of domain" << domain->getId() << " is mandatory"); 281 293 282 294 int ni = domain->i_index.numElements(); 295 */ 296 int ni = domain->ni; 297 int ibegin = domain->ibegin; 298 if (domain->i_index.isEmpty()) 299 { 300 domain->i_index.resize(ni) ; 301 for(int idx = 0; idx < ni; ++idx) domain->i_index(idx)=ibegin+idx ; 302 } 303 283 304 std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0); 284 305 nSizeLatLon[0] = domain->ni_glo.getValue();
Note: See TracChangeset
for help on using the changeset viewer.