Changeset 1421
- Timestamp:
- 02/08/18 15:40:25 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.cpp
r1415 r1421 1285 1285 int nbWritten = indexToWrite.numElements(); 1286 1286 CArray<double,1> axis_value(indexToWrite.numElements()); 1287 for (int i = 0; i < nbWritten; i++) axis_value(i) = axis->value(indexToWrite(i)); 1287 for (int i = 0; i < nbWritten; i++) 1288 { 1289 if (i < axis->value.numElements()) 1290 axis_value(i) = axis->value(indexToWrite(i)); 1291 else 1292 axis_value(i) = 0.; 1293 } 1294 1288 1295 CArray<double,2> axis_bounds; 1289 1296 CArray<string,1> axis_label; … … 1291 1298 { 1292 1299 axis_label.resize(indexToWrite.numElements()); 1293 for (int i = 0; i < nbWritten; i++) axis_label(i) = axis->label(indexToWrite(i)); 1300 for (int i = 0; i < nbWritten; i++) 1301 { 1302 if (i < axis->label.numElements()) 1303 axis_label(i) = axis->label(indexToWrite(i)); 1304 else 1305 axis_label(i) = boost::lexical_cast<string>(0); // Write 0 as a label 1306 } 1294 1307 } 1295 1308 … … 1306 1319 for (int i = 0; i < nbWritten; ++i) 1307 1320 { 1308 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 1309 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 1321 if (i < axis->bounds.columns()) 1322 { 1323 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 1324 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 1325 } 1326 else 1327 { 1328 axis_bounds(0, i) = 0.; 1329 axis_bounds(1, i) = 0.; 1330 1331 } 1310 1332 } 1311 1333 … … 1337 1359 for (int i = 0; i < nbWritten; ++i) 1338 1360 { 1339 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 1340 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 1361 if (i < axis->bounds.columns()) 1362 { 1363 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 1364 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 1365 } 1366 else 1367 { 1368 axis_bounds(0, i) = 0.; 1369 axis_bounds(1, i) = 0.; 1370 } 1341 1371 } 1342 1372 SuperClassWriter::writeData(axis_bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds); -
XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp
r1416 r1421 16 16 namespace xios { 17 17 18 /// ////////////////////// D éfinitions ////////////////////// ///18 /// ////////////////////// Definitions ////////////////////// /// 19 19 20 20 CAxis::CAxis(void) … … 284 284 } 285 285 286 // Remove this check because it doen't make sense in case of a hole or overlapping axes 286 287 if (!this->value.isEmpty()) 287 288 { 288 StdSize true_size = value.numElements();289 if (this->n.getValue() != true_size)290 ERROR("CAxis::checkAttributes(void)",291 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] "292 << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").");289 // StdSize true_size = value.numElements(); 290 // if (this->n.getValue() != true_size) 291 // ERROR("CAxis::checkAttributes(void)", 292 // << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " 293 // << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ")."); 293 294 this->hasValue = true; 294 295 } 295 296 296 this->checkData();297 this->checkZoom();298 this->checkMask();299 297 this->checkBounds(); 300 this->checkLabel(); 298 299 CContext* context=CContext::getCurrent(); 300 if (context->hasClient) 301 { 302 this->checkData(); 303 this->checkZoom(); 304 this->checkMask(); 305 this->checkLabel(); 306 } 301 307 } 302 308 … … 457 463 if (this->areClientAttributesChecked_) return; 458 464 459 this->checkAttributes(); 465 CContext* context=CContext::getCurrent(); 466 if (context->hasClient && !context->hasServer) this->checkAttributes(); 460 467 461 468 this->areClientAttributesChecked_ = true; … … 697 704 } 698 705 699 localIndexToWriteOnServer.resize(nbWritten); 706 localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 707 // localIndexToWriteOnServer.resize(nbWritten); 700 708 701 709 nbWritten = 0; -
XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.hpp
r1401 r1421 19 19 namespace xios { 20 20 21 /// ////////////////////// D éclarations ////////////////////// ///21 /// ////////////////////// Dᅵᅵclarations ////////////////////// /// 22 22 23 23 class CGridGroup; … … 91 91 StdSize getDataSize(void) const; 92 92 93 /// Entr ées-sorties de champs93 /// Entrᅵᅵes-sorties de champs 94 94 template <int n> 95 95 void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; … … 421 421 int dim = domainMasks.size() * 2 + axisMasks.size(); 422 422 std::vector<CDomain*> domainP = this->getDomains(); 423 std::vector<CAxis*> axisP = this->getAxis(); 423 424 424 425 std::vector<int> idxLoop(dim,0), indexMap(numElement), eachDimSize(dim); … … 434 435 } 435 436 else if (1 == axisDomainOrder(i)) { 436 eachDimSize[indexMap[i]] = axisMasks[idxAxis]->numElements(); 437 // eachDimSize[indexMap[i]] = axisMasks[idxAxis]->numElements(); 438 eachDimSize[indexMap[i]] = axisP[idxAxis]->n; 437 439 ++idx; ++idxAxis; 438 440 } … … 486 488 else if (1 == axisDomainOrder(i)) 487 489 { 488 maskValue = maskValue && (*axisMasks[idxAxis])(idxLoop[indexMap[i]]); 490 int idxTmp = idxLoop[indexMap[i]]; 491 if (idxTmp < (*axisMasks[idxDomain]).numElements()) 492 maskValue = maskValue && (*axisMasks[idxAxis])(idxTmp); 493 else 494 maskValue = false; 495 489 496 ++idxAxis; 490 497 }
Note: See TracChangeset
for help on using the changeset viewer.