Changeset 1653 for XIOS/dev/dev_olga/src/node/grid.hpp
- Timestamp:
- 03/06/19 12:11:10 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/grid.hpp
r1594 r1653 205 205 bool hasTransform(); 206 206 size_t getGlobalWrittenSize(void) ; 207 // void getLocalMask(CArray<bool,1>& localMask) ;208 // template<int N>209 // void getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) ;210 207 public: 211 208 CArray<int, 1> storeIndex_client; … … 377 374 template <int n> 378 375 void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const 376 TRY 379 377 { 380 378 //#ifdef __XIOS_DEBUG … … 388 386 this->storeField_arr(field.dataFirst(), stored); 389 387 } 388 CATCH 390 389 391 390 template <int n> … … 405 404 template <int n> 406 405 void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const 406 TRY 407 407 { 408 408 //#ifdef __XIOS_DEBUG … … 416 416 this->restoreField_arr(stored, field.dataFirst()); 417 417 } 418 CATCH 418 419 419 420 /*! … … 425 426 template <int N> 426 427 void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const 428 TRY 427 429 { 428 430 uncompressField_arr(data.dataFirst(), outData); 429 431 } 432 CATCH 430 433 431 434 template<int N> … … 435 438 const CArray<int,1>& axisDomainOrder, 436 439 bool createMask) 440 TRY 437 441 { 438 442 int idx = 0; … … 530 534 } 531 535 } 536 CATCH_DUMP_ATTR 532 537 533 538 template<int N> … … 535 540 const std::vector<int>& eachDimSize, 536 541 bool newValue) 542 TRY 537 543 { 538 544 if (N != eachDimSize.size()) … … 549 555 gridMask = newValue; 550 556 } 557 CATCH_DUMP_ATTR 551 558 552 559 … … 558 565 template<int N> 559 566 void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify) 567 TRY 560 568 { 561 569 int num = indexToModify.numElements(); … … 565 573 } 566 574 } 575 CATCH_DUMP_ATTR 576 567 577 ///-------------------------------------------------------------- 568 578 569 579 570 /*!571 A grid can have multiple dimension, so can its mask in the form of multi-dimension array.572 It's not a good idea to store all multi-dimension arrays corresponding to each mask.573 One of the ways is to convert this array into 1-dimension one and every process is taken place on it.574 \param [in] multi-dimension array grid mask575 */576 //template<int N>577 //void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask)578 //{579 // if (gridMask.isEmpty()) return ;580 // int dim = gridMask.dimensions();581 // std::vector<int> dimensionSizes(dim);582 // for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i);583 //584 // std::vector<int> idxLoop(dim,0);585 // int ssize = gridMask.numElements(), idx = 0;586 // localMask.resize(ssize);587 // while (idx < ssize)588 // {589 // for (int i = 0; i < dim-1; ++i)590 // {591 // if (idxLoop[i] == dimensionSizes[i])592 // {593 // idxLoop[i] = 0;594 // ++idxLoop[i+1];595 // }596 // }597 //598 // int maskIndex = idxLoop[0];599 // int mulDim = 1;600 // for (int k = 1; k < dim; ++k)601 // {602 // mulDim *= dimensionSizes[k-1];603 // maskIndex += idxLoop[k]*mulDim;604 // }605 // localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex);606 //607 // ++idxLoop[0];608 // ++idx;609 // }610 //}611 580 612 581 // Declare/Define CGridGroup and CGridDefinition
Note: See TracChangeset
for help on using the changeset viewer.