Changeset 1524 for XIOS/dev/XIOS_DEV_CMIP6/src/node
- Timestamp:
- 06/06/18 11:25:32 (6 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src/node
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp
r1514 r1524 1315 1315 std::vector<CScalar*> vecScalar; 1316 1316 std::vector<int> axisDomainOrderTmp; 1317 1318 std::vector<CDomain*> vecDomRef; 1319 std::vector<CAxis*> vecAxisRef; 1320 std::vector<CScalar*> vecScalarRef; 1321 1317 1322 1318 1323 if (!domain_ref.isEmpty()) … … 1322 1327 { 1323 1328 vecDom.push_back(CDomain::get(domain_ref)); 1329 vecDomRef.push_back(CDomain::createDomain()); 1330 vecDomRef.back()->domain_ref=domain_ref; 1324 1331 axisDomainOrderTmp.push_back(2); 1325 1332 } 1326 else 1327 ERROR("CField::solveGridReference(void)", 1328 << "Invalid reference to domain '" << domain_ref.getValue() << "'."); 1333 else ERROR("CField::solveGridReference(void)", 1334 << "Invalid reference to domain '" << domain_ref.getValue() << "'."); 1329 1335 } 1330 1336 … … 1334 1340 { 1335 1341 vecAxis.push_back(CAxis::get(axis_ref)); 1342 vecAxisRef.push_back(CAxis::createAxis()); 1343 vecAxisRef.back()->axis_ref=axis_ref; 1336 1344 axisDomainOrderTmp.push_back(1); 1337 1345 } 1338 else 1339 ERROR("CField::solveGridReference(void)", 1340 << "Invalid reference to axis '" << axis_ref.getValue() << "'."); 1346 else ERROR("CField::solveGridReference(void)", 1347 << "Invalid reference to axis '" << axis_ref.getValue() << "'."); 1341 1348 } 1342 1349 … … 1346 1353 { 1347 1354 vecScalar.push_back(CScalar::get(scalar_ref)); 1355 vecScalarRef.push_back(CScalar::createScalar()); 1356 vecScalarRef.back()->scalar_ref=scalar_ref; 1348 1357 axisDomainOrderTmp.push_back(0); 1349 1358 } 1350 else 1351 ERROR("CField::solveGridReference(void)", 1352 << "Invalid reference to scalar '" << scalar_ref.getValue() << "'."); 1359 else ERROR("CField::solveGridReference(void)", 1360 << "Invalid reference to scalar '" << scalar_ref.getValue() << "'."); 1353 1361 } 1354 1362 … … 1361 1369 // Warning: the gridId shouldn't be set as the grid_ref since it could be inherited 1362 1370 StdString gridId = CGrid::generateId(vecDom, vecAxis, vecScalar,axisDomainOrder); 1363 if (CGrid::has(gridId)) 1364 this->grid = CGrid::get(gridId); 1365 else 1366 this->grid = CGrid::createGrid(gridId, vecDom, vecAxis, vecScalar,axisDomainOrder); 1371 if (CGrid::has(gridId)) this->grid = CGrid::get(gridId); 1372 else this->grid = CGrid::createGrid(gridId, vecDomRef, vecAxisRef, vecScalarRef,axisDomainOrder); 1367 1373 } 1368 1374 else 1369 1375 { 1370 if (CGrid::has(grid_ref)) 1371 this->grid = CGrid::get(grid_ref); 1372 else 1373 ERROR("CField::solveGridReference(void)", 1374 << "Invalid reference to grid '" << grid_ref.getValue() << "'."); 1376 if (CGrid::has(grid_ref)) this->grid = CGrid::get(grid_ref); 1377 else ERROR("CField::solveGridReference(void)", 1378 << "Invalid reference to grid '" << grid_ref.getValue() << "'."); 1375 1379 } 1376 1380 } … … 1617 1621 } 1618 1622 1623 1624 /*! 1625 * Send all Attributes to server. This method is overloaded, since only grid_ref attribute 1626 * must be sent to server and not domain_ref/axis_ref/scalar_ref. 1627 */ 1628 1629 void CField::sendAllAttributesToServer(CContextClient* client) 1630 { 1631 if (grid_ref.isEmpty()) 1632 { 1633 grid_ref=grid->getId() ; 1634 SuperClass::sendAllAttributesToServer(client) ; 1635 grid_ref.reset(); 1636 } 1637 else SuperClass::sendAllAttributesToServer(client) ; 1638 } 1639 1619 1640 void CField::sendAddVariable(const string& id, CContextClient* client) 1620 1641 { -
XIOS/dev/XIOS_DEV_CMIP6/src/node/field.hpp
r1417 r1524 161 161 template <int N> void setData(const CArray<double, N>& _data); 162 162 static bool dispatchEvent(CEventServer& event); 163 void sendAllAttributesToServer(CContextClient* client) ; 163 164 void sendUpdateData(const CArray<double,1>& data); 164 165 void sendUpdateData(const CArray<double,1>& data, CContextClient* client);
Note: See TracChangeset
for help on using the changeset viewer.