Changeset 742 for XIOS/trunk/src/node
- Timestamp:
- 10/15/15 15:46:40 (9 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r731 r742 66 66 /*! 67 67 * Test whether the data defined on the axis can be outputted in a compressed way. 68 * 68 * 69 69 * \return true if and only if a mask was defined for this axis 70 70 */ … … 326 326 } 327 327 328 void CAxis::checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid, 329 CServerDistributionDescription::ServerDistributionType distType) 328 void CAxis::checkAttributesOnClient() 330 329 { 331 330 if (this->areClientAttributesChecked_) return; … … 340 339 CServerDistributionDescription::ServerDistributionType distType) 341 340 { 342 if (!this->areClientAttributesChecked_) checkAttributesOnClient(globalDim, 343 orderPositionInGrid, 344 distType); 341 if (!this->areClientAttributesChecked_) checkAttributesOnClient(); 345 342 CContext* context = CContext::getCurrent(); 346 343 -
XIOS/trunk/src/node/axis.hpp
r731 r742 102 102 static void recvServerAttribut(CEventServer& event); 103 103 void recvServerAttribut(CBufferIn& buffer) ; 104 void checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid, 105 CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); 104 void checkAttributesOnClient(); 106 105 void sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 107 106 CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); -
XIOS/trunk/src/node/field.cpp
r741 r742 755 755 void CField::solveGridReference(void) 756 756 { 757 if (grid_ref.isEmpty() && domain_ref.isEmpty() && axis_ref.isEmpty()) 758 { 759 ERROR("CField::solveGridReference(void)", 760 << "At least one dimension must be defined for this field."); 761 } 762 757 763 CDomain* domain; 758 764 CAxis* axis; … … 761 767 std::vector<std::string> domList, axisList; 762 768 769 // In some cases, domain_ref, axis_ref and grid_ref don't come from the current field but from his direct field_ref 770 // To make sure to use the correct *_ref, we need to compare these values to direct field_ref's 771 CField* baseFieldRef = this->getBaseFieldReference(); 772 bool hasDomainFromFieldRef = false; 773 bool hasAxisFromFieldRef = false; 774 bool hasGridFromFieldRef = false; 775 763 776 if (!domain_ref.isEmpty()) 764 777 { 778 if (0 != baseFieldRef) 779 { 780 if ((!baseFieldRef->domain_ref.isEmpty()) && (baseFieldRef->domain_ref.getValue() == domain_ref.getValue())) 781 hasDomainFromFieldRef = true; 782 } 783 765 784 if (CDomain::has(domain_ref.getValue())) 766 785 { 767 786 domain = CDomain::get(domain_ref.getValue()); 787 // It's a direct reference, so we use this ref as its name 788 domain->name.setValue(domain_ref.getValue()); 789 768 790 vecDom.push_back(domain); 769 791 } … … 776 798 if (!axis_ref.isEmpty()) 777 799 { 800 if (0 != baseFieldRef) 801 { 802 if ((!baseFieldRef->axis_ref.isEmpty()) && (baseFieldRef->axis_ref.getValue() == axis_ref.getValue())) 803 hasAxisFromFieldRef = true; 804 } 778 805 if (CAxis::has(axis_ref.getValue())) 779 806 { 780 807 axis = CAxis::get(axis_ref.getValue()); 808 // It's a direct reference, so we use this ref as its name 809 axis->name.setValue(axis_ref.getValue()); 810 781 811 vecAxis.push_back(axis); 782 812 } … … 789 819 if (!grid_ref.isEmpty()) 790 820 { 791 if ( CGrid::has(grid_ref.getValue()))821 if (0 != baseFieldRef) 792 822 { 793 this->grid = CGrid::get(grid_ref.getValue()); 794 domList = grid->getDomainList(); 795 axisList = grid->getAxisList(); 796 if (domList.empty() && axisList.empty()) 823 if ((!baseFieldRef->grid_ref.isEmpty()) && (baseFieldRef->grid_ref.getValue() == grid_ref.getValue())) 824 hasGridFromFieldRef = true; 825 } 826 827 if ((domain_ref.isEmpty() && axis_ref.isEmpty()) || (!hasGridFromFieldRef)) 828 { 829 if (CGrid::has(grid_ref.getValue())) 797 830 { 798 this->grid = CGrid:: createGrid(vecDom, vecAxis);831 this->grid = CGrid::get(grid_ref.getValue()); 799 832 } 800 } 801 else 802 ERROR("CField::solveGridReference(void)", 803 << "Reference to the grid \'" 804 << grid_ref.getValue() << "\' is wrong"); 833 else 834 ERROR("CField::solveGridReference(void)", 835 << "Reference to the grid \'" 836 << grid_ref.getValue() << "\' is wrong"); 837 } 838 else 839 { 840 this->grid = CGrid::createGrid(vecDom, vecAxis); 841 this->grid_ref.setValue(this->grid->getId()); 842 } 805 843 } 806 844 else 807 845 { 808 846 this->grid = CGrid::createGrid(vecDom, vecAxis); 809 } 810 811 if (grid_ref.isEmpty() && domain_ref.isEmpty() && axis_ref.isEmpty()) 812 { 813 ERROR("CField::solveGridReference(void)", 814 << "At least one dimension must be defined for this field."); 847 this->grid_ref.setValue(this->grid->getId()); 815 848 } 816 849 } -
XIOS/trunk/src/node/grid.cpp
r739 r742 21 21 namespace xios { 22 22 23 /// ////////////////////// D éfinitions ////////////////////// ///23 /// ////////////////////// Dfinitions ////////////////////// /// 24 24 25 25 CGrid::CGrid(void) … … 126 126 } 127 127 } 128 128 129 129 return attributesSizes; 130 130 } … … 342 342 axisListP[i]->sendCheckedAttributes(globalDim_,axisPositionInGrid_[i]); 343 343 else 344 axisListP[i]->checkAttributesOnClient( globalDim_,axisPositionInGrid_[i]);344 axisListP[i]->checkAttributesOnClient(); 345 345 ++idx; 346 346 } … … 500 500 } 501 501 502 grid->computeGridGlobalDimension(domains, axis, grid->axis_domain_order); 502 503 grid->solveDomainAxisRefInheritance(true); 503 504 504 505 return grid; … … 1307 1308 if (isDomListSet) return; 1308 1309 std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren(); 1309 if (!domains.empty() && domList.empty()) domList = domains; 1310 if (!domains.empty() && domList.empty()) 1311 { 1312 for (int i = 0; i < domains.size(); ++i) 1313 this->getVirtualDomainGroup()->addChild(domains[i]); 1314 domList = this->getVirtualDomainGroup()->getAllChildren(); 1315 } 1316 1310 1317 if (!domList.empty()) 1311 1318 { … … 1329 1336 if (isAxisListSet) return; 1330 1337 std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren(); 1331 if (!axis.empty() && aList.empty()) aList = axis; 1338 if (!axis.empty() && aList.empty()) 1339 { 1340 for (int i = 0; i < axis.size(); ++i) 1341 this->getVirtualAxisGroup()->addChild(axis[i]); 1342 aList = this->getVirtualAxisGroup()->getAllChildren(); 1343 } 1344 1332 1345 if (!aList.empty()) 1333 1346 { -
XIOS/trunk/src/node/grid.hpp
r731 r742 202 202 void modifyMask(const CArray<int,1>& indexToModify); 203 203 204 void computeGridGlobalDimension(const std::vector<CDomain*>& domains, 205 const std::vector<CAxis*>& axis, 206 const CArray<bool,1>& axisDomainOrder); 207 204 208 private: 205 209 template<int N> … … 218 222 void setAxisList(const std::vector<CAxis*> axis = std::vector<CAxis*>()); 219 223 void setDomainList(const std::vector<CDomain*> domains = std::vector<CDomain*>()); 220 221 void computeGridGlobalDimension(const std::vector<CDomain*>& domains,222 const std::vector<CAxis*>& axis,223 const CArray<bool,1>& axisDomainOrder);224 224 225 225 CDomain* addDomain(const std::string& id);
Note: See TracChangeset
for help on using the changeset viewer.