Changeset 623
- Timestamp:
- 06/22/15 13:36:31 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 1 added
- 2 deleted
- 20 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/Version2/iodef.xml
r622 r623 43 43 <axis id="axis_E" axis_ref="axis_B"> 44 44 <inverse_axis /> 45 <inverse_axis /> 46 <!-- <zoom_axis zoom_begin="1" zoom_size="3" />--> 45 46 <zoom_axis zoom_begin="0" zoom_size="4" /> 47 <!-- <inverse_axis />--> 47 48 </axis> 48 49 <axis id="axis_F" axis_ref="axis_A"> 49 <inverse_axis />50 <!-- <inverse_axis />--> 50 51 </axis> 51 52 </axis_definition> … … 63 64 <grid id="grid_Axis"> 64 65 <axis axis_ref="axis_D" /> 66 65 67 </grid> 66 68 <grid id="grid_Two_Axis"> … … 70 72 <grid id="grid_Axis_tranformed"> 71 73 <!-- <domain domain_ref="domain_A" />--> 72 <!-- <axis axis_ref="axis_E" />-->73 74 <axis axis_ref="axis_F" /> 74 75 <axis axis_ref="axis_E" /> 75 76 76 </grid> 77 77 <grid id="grid_All_Axis"> -
XIOS/trunk/src/attribute_map.cpp
r591 r623 144 144 } 145 145 146 void CAttributeMap::duplicateAttributes(const CAttributeMap* const srcAttr) 147 { 148 typedef std::pair<StdString, CAttribute*> StdStrAttPair; 149 150 SuperClassMap::const_iterator it = srcAttr->begin(), end = srcAttr->end(); 151 for (; it != end; it++) 152 { 153 const StdStrAttPair& el = *it; 154 if (this->hasAttribute(el.first)) 155 { 156 if (!el.second->isEmpty()) 157 { 158 this->setAttribute(el.first, el.second); 159 } 160 } 161 } 162 } 163 146 164 //--------------------------------------------------------------- 147 165 /* -
XIOS/trunk/src/attribute_map.hpp
r591 r623 30 30 void setAttributes(const xml::THashAttributes & attributes); 31 31 void setAttributes(const CAttributeMap * const _parent, bool apply=true); 32 32 void duplicateAttributes(const CAttributeMap* const _parent); 33 33 void clearAllAttributes(void); 34 34 -
XIOS/trunk/src/client_server_mapping_distributed.cpp
r585 r623 37 37 \param [in] localIndexOnClient local index on client 38 38 */ 39 //void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient,40 // const CArray<int,1>& localIndexOnClient)41 39 void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) 42 40 { … … 180 178 } 181 179 182 if (0 != recvBuffIndexGlobal) deleterecvBuffIndexGlobal;183 if (0 != recvBuffIndexServer) deleterecvBuffIndexServer;180 if (0 != maxNbIndexDemandedFromOthers) delete [] recvBuffIndexGlobal; 181 if (0 != nbIndexReceivedFromOthers) delete [] recvBuffIndexServer; 184 182 delete [] sendBuff; 185 183 delete [] recvBuff; -
XIOS/trunk/src/distribution_client.cpp
r621 r623 13 13 CDistributionClient::CDistributionClient(int rank, int dims, CArray<size_t,1>* globalIndex) 14 14 : CDistribution(rank, dims, globalIndex), 15 localDataIndex_(0), axisDomainOrder_(), 15 globalDataSendToServer_(0), localDataIndex_(0), localDataIndexSendToServer_(0), localMaskIndex_(0), 16 axisDomainOrder_(), 16 17 nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_(),nZoomBegin_(), nZoomEnd_(), 17 18 dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_(), domainMasks_(), axisMasks_(), 18 19 gridMask_(), localDomainIndex_(), localAxisIndex_(), indexMap_(), indexDomainData_(), indexAxisData_(), 19 isDataDistributed_(true), axisNum_(0), domainNum_(0), localDataIndexSendToServer_(0),nIndexDomain_(), nIndexAxis_()20 isDataDistributed_(true), axisNum_(0), domainNum_(0), nIndexDomain_(), nIndexAxis_() 20 21 { 21 22 } … … 23 24 CDistributionClient::CDistributionClient(int rank, CGrid* grid) 24 25 : CDistribution(rank, 0, 0), 25 localDataIndex_(0), axisDomainOrder_(), 26 globalDataSendToServer_(0), localDataIndex_(0), localDataIndexSendToServer_(0), localMaskIndex_(0), 27 axisDomainOrder_(), 26 28 nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_(),nZoomBegin_(), nZoomEnd_(), 27 29 dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_(), domainMasks_(), axisMasks_(), 28 30 gridMask_(), localDomainIndex_(), localAxisIndex_(), indexMap_(), indexDomainData_(), indexAxisData_(), 29 isDataDistributed_(true), axisNum_(0), domainNum_(0), localDataIndexSendToServer_(0),nIndexDomain_(), nIndexAxis_()31 isDataDistributed_(true), axisNum_(0), domainNum_(0), nIndexDomain_(), nIndexAxis_() 30 32 { 31 33 readDistributionInfo(grid); … … 39 41 if (0 != localDataIndex_) delete localDataIndex_; 40 42 if (0 != localDataIndexSendToServer_) delete localDataIndexSendToServer_; 43 if (0 != localMaskIndex_) delete localMaskIndex_; 41 44 } 42 45 … … 145 148 axisMasks_[i].resize(axisList[i]->mask.numElements()); 146 149 axisMasks_[i] = axisList[i]->mask; 150 std::cout << "axisMask " << axisMasks_[i] << std::endl; 147 151 } 148 152 … … 197 201 nBeginLocal_.at(indexMap_[idx]+1) = 0; 198 202 nBeginGlobal_.at(indexMap_[idx]+1) = domList[domIndex]->jbegin; 199 nZoomBegin_.at((indexMap_[idx]+1)) = domList[domIndex]->zoom_jbegin;200 nZoomEnd_.at((indexMap_[idx]+1)) = domList[domIndex]->zoom_jbegin + domList[domIndex]->zoom_nj-1;203 // nZoomBegin_.at((indexMap_[idx]+1)) = domList[domIndex]->zoom_jbegin; 204 // nZoomEnd_.at((indexMap_[idx]+1)) = domList[domIndex]->zoom_jbegin + domList[domIndex]->zoom_nj-1; 201 205 202 206 dataBegin_.at(indexMap_[idx]+1) = (2 == domList[domIndex]->data_dim) ? domList[domIndex]->data_jbegin.getValue() : -1; … … 209 213 nBeginLocal_.at(indexMap_[idx]) = 0; 210 214 nBeginGlobal_.at(indexMap_[idx]) = domList[domIndex]->ibegin; 211 nZoomBegin_.at((indexMap_[idx])) = domList[domIndex]->zoom_ibegin;212 nZoomEnd_.at((indexMap_[idx])) = domList[domIndex]->zoom_ibegin + domList[domIndex]->zoom_ni-1;215 // nZoomBegin_.at((indexMap_[idx])) = domList[domIndex]->zoom_ibegin; 216 // nZoomEnd_.at((indexMap_[idx])) = domList[domIndex]->zoom_ibegin + domList[domIndex]->zoom_ni-1; 213 217 214 218 dataBegin_.at(indexMap_[idx]) = domList[domIndex]->data_ibegin.getValue(); … … 229 233 nBeginLocal_.at(indexMap_[idx]) = 0; 230 234 nBeginGlobal_.at(indexMap_[idx]) = axisList[axisIndex]->ibegin.getValue(); 231 nZoomBegin_.at((indexMap_[idx])) = axisList[axisIndex]-> zoom_begin;232 nZoomEnd_.at((indexMap_[idx])) = axisList[axisIndex]-> zoom_begin + axisList[axisIndex]->zoom_size-1;235 nZoomBegin_.at((indexMap_[idx])) = axisList[axisIndex]->global_zoom_begin; 236 nZoomEnd_.at((indexMap_[idx])) = axisList[axisIndex]->global_zoom_begin + axisList[axisIndex]->global_zoom_size-1; 233 237 234 238 dataBegin_.at(indexMap_[idx]) = axisList[axisIndex]->data_begin.getValue(); … … 393 397 394 398 // Compute size of the global index on client 395 std::vector< int> idxLoop(numElement_,0);396 std::vector< int> currentIndex(this->dims_);399 std::vector<StdSize> idxLoop(numElement_,0); 400 std::vector<StdSize> currentIndex(this->dims_,0); 397 401 int innerLoopSize = eachElementSize[0]; 398 402 size_t idx = 0, indexLocalDataOnClientCount = 0, indexSend2ServerCount = 0; … … 445 449 else currentIndex[0] = localAxisIndex_[idxAxis][i]; 446 450 447 intgridMaskIndex = currentIndex[0];451 StdSize gridMaskIndex = currentIndex[0]; 448 452 int mulDimMask = 1; 449 453 for (int k = 1; k < this->dims_; ++k) … … 473 477 localDataIndex_ = new CArray<int,1>(indexLocalDataOnClientCount); 474 478 localDataIndexSendToServer_ = new CArray<int,1>(indexSend2ServerCount); 479 localMaskIndex_ = new CArray<int,1>(indexSend2ServerCount); 475 480 476 481 // We need to loop with data index … … 481 486 int countLocalData = 0; 482 487 std::vector<int> correctOuterIndex(numElement_,0); 488 bool isOuterIndexCorrect = true; 483 489 while (idx < ssize) 484 490 { … … 490 496 correctOuterIndex[i] = 0; 491 497 ++idxLoop[i+1]; 492 ++correctOuterIndex[i+1];498 if (isOuterIndexCorrect) ++correctOuterIndex[i+1]; 493 499 } 494 500 } … … 510 516 currentIndex[indexMap_[i]] = localDomainIndex_[idxDomain][correctOuterIndex[i]]; 511 517 currentIndex[indexMap_[i]+1] = localDomainIndex_[idxDomain*2+1][correctOuterIndex[i]]; 518 isIndexDomainDataCorrect &= true; 512 519 } 513 520 else isIndexDomainDataCorrect = false; … … 519 526 { 520 527 currentIndex[indexMap_[i]] = localAxisIndex_[idxAxis][correctOuterIndex[i]]; 528 isIndexAxisDataCorrect &= true; 521 529 } 522 530 else isIndexAxisDataCorrect = false; … … 524 532 } 525 533 } 534 535 isOuterIndexCorrect = (isIndexAxisDataCorrect) && (isIndexDomainDataCorrect); 526 536 527 537 // Inner most index … … 530 540 for (int i = 0; i < innerLoopSize; ++i) 531 541 { 542 bool isCurrentIndexDomainDataCorrect = isIndexDomainDataCorrect; 543 bool isCurrentIndexAxisDataCorrect = isIndexAxisDataCorrect; 544 532 545 if (axisDomainOrder_(0)) 533 546 { … … 536 549 currentIndex[0] = localDomainIndex_[idxDomain][correctIndexDomain]; 537 550 currentIndex[1] = localDomainIndex_[idxDomain+1][correctIndexDomain]; 538 is IndexDomainDataCorrect= true;551 isCurrentIndexDomainDataCorrect &= true; 539 552 ++correctIndexDomain; 540 553 } 541 else is IndexDomainDataCorrect = false;554 else isCurrentIndexDomainDataCorrect = false; 542 555 } 543 556 else … … 546 559 { 547 560 currentIndex[0] = localAxisIndex_[idxAxis][correctIndexAxis]; 548 is IndexAxisDataCorrect= true;561 isCurrentIndexAxisDataCorrect &= true; 549 562 ++correctIndexAxis; 550 563 } 551 else is IndexAxisDataCorrect = false;564 else isCurrentIndexAxisDataCorrect = false; 552 565 } 553 566 … … 560 573 } 561 574 562 if (is IndexDomainDataCorrect &&563 is IndexAxisDataCorrect &&575 if (isCurrentIndexDomainDataCorrect && 576 isCurrentIndexAxisDataCorrect && 564 577 gridMask_(gridMaskIndex)) 565 578 { … … 582 595 (*this->globalDataSendToServer_)(indexSend2ServerCount) = globalIndex; 583 596 (*localDataIndexSendToServer_)(indexSend2ServerCount) = indexLocalDataOnClientCount; 597 (*localMaskIndex_)(indexSend2ServerCount) = gridMaskIndex; 584 598 ++indexSend2ServerCount; 585 599 } … … 649 663 650 664 /*! 665 Return local mask index of client 666 */ 667 const CArray<int,1>& CDistributionClient::getLocalMaskIndexOnClient() const 668 { 669 return (*localMaskIndex_); 670 } 671 672 /*! 651 673 Return local data index on client which are sent to servers 652 674 */ -
XIOS/trunk/src/distribution_client.hpp
r621 r623 39 39 virtual const CArray<int,1>& getLocalDataIndexSendToServer() const; 40 40 const CArray<size_t,1>& getGlobalDataIndexSendToServer() const; 41 const CArray<int,1>& getLocalMaskIndexOnClient() const; 41 42 42 43 std::vector<int> getNGlob() { return nGlob_; } 43 44 std::vector<int> getDataNIndex() { return dataNIndex_; } 45 44 46 bool isDataDistributed() { return isDataDistributed_; } 45 47 … … 73 75 CArray<int,1>* localDataIndex_; 74 76 CArray<int,1>* localDataIndexSendToServer_; 77 CArray<int,1>* localMaskIndex_; 75 78 76 79 private: -
XIOS/trunk/src/filter/axis_algorithm_inverse.cpp
r622 r623 1 #include "axis_ inverse.hpp"1 #include "axis_algorithm_inverse.hpp" 2 2 3 3 namespace xios { 4 4 5 CAxis Inverse::CAxisInverse(CAxis* axisDestination, CAxis* axisSource)5 CAxisAlgorithmInverse::CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource) 6 6 : CAxisAlgorithmTransformation(axisDestination, axisSource) 7 7 { 8 8 if (axisDestination->size.getValue() != axisSource->size.getValue()) 9 9 { 10 ERROR("CAxis Inverse::CAxisInverse(CAxis* axisDestination, CAxis* axisSource)",10 ERROR("CAxisAlgorithmInverse::CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource)", 11 11 << "Two axis have different size" 12 12 << "Size of axis source " <<axisSource->getId() << " is " << axisSource->size.getValue() << std::endl … … 19 19 int ibeginDest = axisDestination->ibegin.getValue(); 20 20 21 for (int idx = 0; idx < niDest; ++idx) axisDestGlobalIndex_.push_back(ibeginDest+idx); 21 for (int idx = 0; idx < niDest; ++idx) 22 if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 22 23 this->computeIndexSourceMapping(); 23 24 } 24 25 25 void CAxis Inverse::computeIndexSourceMapping()26 void CAxisAlgorithmInverse::computeIndexSourceMapping() 26 27 { 27 28 std::map<int, std::vector<int> >& transMap = this->transformationMapping_; -
XIOS/trunk/src/filter/axis_algorithm_inverse.hpp
r622 r623 7 7 namespace xios { 8 8 9 class CAxis Inverse : public CAxisAlgorithmTransformation //public CConcreteAlgo9 class CAxisAlgorithmInverse : public CAxisAlgorithmTransformation 10 10 { 11 11 public: 12 CAxis Inverse(CAxis* axisDestination, CAxis* axisSource);12 CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource); 13 13 14 virtual ~CAxis Inverse() {}14 virtual ~CAxisAlgorithmInverse() {} 15 15 16 16 virtual void computeIndexSourceMapping(); -
XIOS/trunk/src/filter/axis_algorithm_zoom.hpp
r622 r623 8 8 namespace xios { 9 9 10 class CAxis Zoom : public CAxisAlgorithmTransformation10 class CAxisAlgorithmZoom : public CAxisAlgorithmTransformation 11 11 { 12 12 public: 13 CAxis Zoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis);13 CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis); 14 14 15 virtual ~CAxis Zoom() {}15 virtual ~CAxisAlgorithmZoom() {} 16 16 17 17 virtual void computeIndexSourceMapping(); 18 18 19 private: 20 void updateAxisDestinationMask(); 21 void updateZoom(); 19 22 private: 20 23 StdSize zoomBegin_; -
XIOS/trunk/src/filter/generic_algorithm_transformation.hpp
r622 r623 20 20 std::map<size_t, std::set<size_t> >& globaIndexMapFromDestToSource); 21 21 22 22 /*! 23 23 Compute global index mapping from one element of destination grid to the corresponding element of source grid 24 24 */ -
XIOS/trunk/src/filter/grid_transformation.cpp
r622 r623 1 /*! 2 \file grid_transformation.cpp 3 \author Ha NGUYEN 4 \since 14 May 2015 5 \date 09 June 2015 6 7 \brief Interface for all transformations. 8 */ 1 9 #include "grid_transformation.hpp" 2 #include "axis_ inverse.hpp"3 #include "axis_ zoom.hpp"10 #include "axis_algorithm_inverse.hpp" 11 #include "axis_algorithm_zoom.hpp" 4 12 #include "context.hpp" 5 13 #include "context_client.hpp" … … 35 43 { 36 44 CAxis* axis = CAxis::createAxis(); 37 axis SrcTmp[idx]->duplicateAttributes(axis);45 axis->setAttributes(axisSrcTmp[idx]); 38 46 axisSrc.push_back(axis); 39 47 } … … 42 50 { 43 51 CDomain* domain = CDomain::createDomain(); 44 domain SrcTmp[idx]->duplicateAttributes(domain);52 domain->setAttributes(domainSrcTmp[idx]); 45 53 domainSrc.push_back(domain); 46 54 } … … 168 176 case TRANS_ZOOM_AXIS: 169 177 zoomAxis = dynamic_cast<CZoomAxis*> (it->second); 170 algo = new CAxis Zoom(axisListDestP[axisIndex], axisListSrcP[axisIndex], zoomAxis);178 algo = new CAxisAlgorithmZoom(axisListDestP[axisIndex], axisListSrcP[axisIndex], zoomAxis); 171 179 break; 172 180 case TRANS_INVERSE_AXIS: 173 algo = new CAxis Inverse(axisListDestP[axisIndex], axisListSrcP[axisIndex]);181 algo = new CAxisAlgorithmInverse(axisListDestP[axisIndex], axisListSrcP[axisIndex]); 174 182 break; 175 183 default: … … 196 204 case TRANS_INVERSE_AXIS: 197 205 axisIndex = elementPosition2AxisPositionInGrid_[elementPositionInGrid]; 198 axisList DestP[axisIndex]->duplicateAttributes(axisListSrcP[axisIndex]);206 axisListSrcP[axisIndex]->duplicateAttributes(axisListDestP[axisIndex]); 199 207 break; 200 208 default: … … 226 234 const CArray<size_t,1>& globalIndexGridDestSendToServer = distributionClientDest.getGlobalDataIndexSendToServer(); 227 235 236 std::cout << "global index grid dest send to server " << globalIndexGridDestSendToServer << std::endl; 228 237 // ComputeTransformation of global index of each element 229 238 std::vector<int> gridDestinationDimensionSize = gridDestination_->getGlobalDimension(); … … 241 250 } 242 251 243 std::cout << "global index destination 0 " << *globalIndexOfCurrentGridSource_ << std::endl; 244 std::cout << "global index destination 1 " << *globalIndexOfOriginalGridSource_ << std::endl; 252 std::cout << "global index destination 0 final " << *globalIndexOfCurrentGridSource_ << std::endl; 253 std::cout << "global index destination 1 final " << *globalIndexOfOriginalGridSource_ << std::endl; 254 updateFinalGridDestination(); 245 255 computeFinalTransformationMapping(); 246 256 } … … 248 258 249 259 /*! 250 Compute index mapping representing transformation between two grids 251 Each domain and each axis can contain some information of transformation, these information are then converted into 252 form of global index mapping reprensenting transformation between two grids. 260 After applying the algorithms, there are some informations on grid destination needing change, for now, there are: 261 +) mask 253 262 */ 254 void CGridTransformation::computeTransformation() 255 { 256 // const CArray<size_t,1>& globalIndexGridDestSendToServer = gridDestination_->getDistributionClient()->getGlobalDataIndexSendToServer(); 257 // std::list<std::pair<int,CGenericAlgorithmTransformation*> >::const_iterator itbMap, itMap, iteMap; 258 // itbMap = algoTransformation_.begin(); 259 // iteMap = algoTransformation_.end(); 260 // 261 // std::vector<CGenericAlgorithmTransformation*>::const_iterator itbVec, itVec, iteVec; 262 // 263 // for (itMap = itbMap; itMap != iteMap; ++itMap) 264 // { 265 // int elementPosition = itMap->first; 266 // itbVec = (itMap->second).begin(); 267 // iteVec = (itMap->second).end(); 268 // for (itVec = itbVec; itVec != iteVec; ++itVec) 269 // { 270 // (*itVec)->computeGlobalSourceIndex(elementPosition, 271 // gridDestinationDimensionSize_, 272 // globalIndexGridDestSendToServer, 273 // globaIndexMapFromDestToSource_); 274 // } 275 // } 263 void CGridTransformation::updateFinalGridDestination() 264 { 265 CContext* context = CContext::getCurrent(); 266 CContextClient* client=context->client; 267 268 //First of all, retrieve info of local mask of grid destination 269 CDistributionClient distributionClientDest(client->clientRank, gridDestination_); 270 const CArray<int, 1>& localMaskIndexOnClientDest = distributionClientDest.getLocalMaskIndexOnClient(); 271 std::cout << "local mask " << localMaskIndexOnClientDest << std::endl; 272 273 const CArray<size_t,1>& globalIndexOnClientDest = distributionClientDest.getGlobalDataIndexSendToServer(); 274 std::cout << "global index " << globalIndexOnClientDest << std::endl; 275 CArray<size_t, 1>::const_iterator itbArr, itArr, iteArr; 276 itbArr = globalIndexOnClientDest.begin(); 277 iteArr = globalIndexOnClientDest.end(); 278 279 // Then find out which index became invalid (become masked after being applied the algorithms, or demande some masked points from grid source) 280 int num = globalIndexOfOriginalGridSource_->numElements(); 281 const size_t sfmax = NumTraits<unsigned long>::sfmax(); 282 int maskIndexNum = 0; 283 for (int idx = 0; idx < num; ++idx) 284 { 285 if (sfmax == (*globalIndexOfOriginalGridSource_)(idx)) 286 { 287 size_t maskedGlobalIndex = (*globalIndexOfCurrentGridSource_)(idx); 288 itArr = std::find(itbArr, iteArr, maskedGlobalIndex); 289 if (iteArr != itArr) ++maskIndexNum; 290 } 291 } 292 293 CArray<int,1>* maskIndexToModify = new CArray<int,1>(maskIndexNum); 294 maskIndexNum = 0; 295 for (int idx = 0; idx < num; ++idx) 296 { 297 if (sfmax == (*globalIndexOfOriginalGridSource_)(idx)) 298 { 299 size_t maskedGlobalIndex = (*globalIndexOfCurrentGridSource_)(idx); 300 itArr = std::find(itbArr, iteArr, maskedGlobalIndex); 301 if (iteArr != itArr) 302 { 303 int localIdx = std::distance(itbArr, itArr); 304 (*maskIndexToModify)(maskIndexNum) = (localMaskIndexOnClientDest)(localIdx); 305 ++maskIndexNum; 306 } 307 } 308 } 309 310 std::cout << "index to modify " << *maskIndexToModify << std::endl; 311 gridDestination_->modifyMask(*maskIndexToModify); 312 313 delete maskIndexToModify; 276 314 } 277 315 … … 302 340 for (itSend = itbSend; itSend != iteSend; ++itSend) sendBuffSize += (itSend->second).size(); 303 341 342 std::cout << "global index destination 0 before" << *globalIndexOfCurrentGridSource_ << std::endl; 343 std::cout << "global index destination 1 before" << *globalIndexOfOriginalGridSource_ << std::endl; 344 345 typedef unsigned long Scalar; 304 346 unsigned long* sendBuff, *currentSendBuff; 305 347 if (0 != sendBuffSize) sendBuff = new unsigned long [sendBuffSize]; 348 for (StdSize idx = 0; idx < sendBuffSize; ++idx) sendBuff[idx] = NumTraits<Scalar>::sfmax(); 349 306 350 int currentBuffPosition = 0; 307 351 for (itSend = itbSend; itSend != iteSend; ++itSend) … … 332 376 unsigned long* recvBuff, *currentRecvBuff; 333 377 if (0 != recvBuffSize) recvBuff = new unsigned long [recvBuffSize]; 378 for (StdSize idx = 0; idx < recvBuffSize; ++idx) recvBuff[idx] = NumTraits<Scalar>::sfmax(); 379 334 380 int currentRecvBuffPosition = 0; 335 381 for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) … … 353 399 } 354 400 355 globalIndexOfCurrentGridSource_->resize(nbCurrentGridSource); 356 globalIndexOfOriginalGridSource_->resize(nbCurrentGridSource); 401 if (globalIndexOfCurrentGridSource_->numElements() != nbCurrentGridSource) 402 { 403 if ((0 != nbCurrentGridSource) && (0 != globalIndexOfCurrentGridSource_)) 404 { 405 delete globalIndexOfCurrentGridSource_; 406 globalIndexOfCurrentGridSource_ = new CArray<size_t,1>(nbCurrentGridSource); 407 } 408 } 409 410 if (globalIndexOfOriginalGridSource_->numElements() != nbCurrentGridSource) 411 { 412 if ((0 != nbCurrentGridSource) && (0 != globalIndexOfOriginalGridSource_)) 413 { 414 delete globalIndexOfOriginalGridSource_; 415 globalIndexOfOriginalGridSource_ = new CArray<size_t,1>(nbCurrentGridSource); 416 } 417 } 418 357 419 int k = 0; 358 420 currentRecvBuff = recvBuff; … … 372 434 } 373 435 436 std::cout << "global index destination 0 after " << *globalIndexOfCurrentGridSource_ << std::endl; 437 std::cout << "global index destination 1 after " << *globalIndexOfOriginalGridSource_ << std::endl; 374 438 if (0 != sendBuffSize) delete [] sendBuff; 375 439 if (0 != recvBuffSize) delete [] recvBuff; … … 391 455 392 456 int nb = globalIndexOfCurrentGridSource_->numElements(); 457 const size_t sfmax = NumTraits<unsigned long>::sfmax(); 393 458 for (int idx = 0; idx < nb; ++idx) 394 459 { 395 globaIndexMapFromDestToSource[(*globalIndexOfCurrentGridSource_)(idx)].insert((*globalIndexOfOriginalGridSource_)(idx)); 460 if (sfmax != (*globalIndexOfOriginalGridSource_)(idx)) 461 globaIndexMapFromDestToSource[(*globalIndexOfCurrentGridSource_)(idx)].insert((*globalIndexOfOriginalGridSource_)(idx)); 396 462 } 397 463 … … 403 469 404 470 CDistributionClient distributionClientDest(client->clientRank, gridDestination_); 405 CDistributionClient distributionClientSrc(client->clientRank, gridSource_); 406 407 CArray<int, 1> localIndexOnClientDest = distributionClientDest.getLocalDataIndexOnClient(); //gridDestination_->getDistributionClient()->getLocalDataIndexOnClient(); 408 CArray<size_t,1> globalIndexOnClientDest = distributionClientDest.getGlobalDataIndexSendToServer(); //gridDestination_->getDistributionClient()->getGlobalDataIndexSendToServer(); 471 CDistributionClient distributionClientSrc(client->clientRank, originalGridSource_); 472 473 // const CArray<int, 1>& localIndexOnClientDest = distributionClientDest.getLocalDataIndexOnClient(); //gridDestination_->getDistributionClient()->getLocalDataIndexOnClient(); 474 const CArray<int, 1>& localIndexOnClientDest = distributionClientDest.getLocalDataIndexSendToServer(); 475 const CArray<size_t,1>& globalIndexOnClientDest = distributionClientDest.getGlobalDataIndexSendToServer(); //gridDestination_->getDistributionClient()->getGlobalDataIndexSendToServer(); 409 476 410 477 std::cout << "dest: local index " << localIndexOnClientDest << std::endl; 411 478 std::cout << "dest: global index " << globalIndexOnClientDest << std::endl; 412 CArray<int, 1>localIndexOnClientSrc = distributionClientSrc.getLocalDataIndexOnClient(); //gridSource_->getDistributionClient()->getLocalDataIndexOnClient();413 CArray<size_t,1>globalIndexOnClientSrc = distributionClientSrc.getGlobalDataIndexSendToServer(); //gridSource_->getDistributionClient()->getGlobalDataIndexSendToServer();479 const CArray<int, 1>& localIndexOnClientSrc = distributionClientSrc.getLocalDataIndexOnClient(); //gridSource_->getDistributionClient()->getLocalDataIndexOnClient(); 480 const CArray<size_t,1>& globalIndexOnClientSrc = distributionClientSrc.getGlobalDataIndexSendToServer(); //gridSource_->getDistributionClient()->getGlobalDataIndexSendToServer(); 414 481 std::cout << "src: local index " << localIndexOnClientSrc << std::endl; 415 482 std::cout << "src: global index " << globalIndexOnClientSrc << std::endl; 416 483 std::vector<size_t>::const_iterator itbVec, itVec, iteVec; 417 CArray<size_t, 1>:: iterator itbArr, itArr, iteArr;484 CArray<size_t, 1>::const_iterator itbArr, itArr, iteArr; 418 485 419 486 std::map<int,std::vector<std::vector<size_t> > >::const_iterator itbMapRecv, itMapRecv, iteMapRecv; … … 439 506 { 440 507 int localIdx = std::distance(itbArr, itArr); 441 //(*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = localIndexOnClientDest(localIdx); // Local index of un-extracted data (only domain)442 (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = (localIdx); // Local index of extracted data508 (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = localIndexOnClientDest(localIdx); // Local index of un-extracted data (only domain) 509 // (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = (localIdx); // Local index of extracted data 443 510 } 444 511 } 445 512 } 513 // std::cout << "local index to receive from source Rank = " << sourceRank << (*localIndexToReceiveOnGridDest_[sourceRank][i]) << std::endl; 446 514 } 447 515 … … 468 536 } 469 537 } 538 std::cout << "local index to send to dest Rank = " << destRank << (*localIndexToSendFromGridSource_[destRank]) << std::endl; 470 539 } 471 540 } -
XIOS/trunk/src/filter/grid_transformation.hpp
r622 r623 1 /*! 2 \file grid_transformation.hpp 3 \author Ha NGUYEN 4 \since 14 May 2015 5 \date 09 June 2015 6 7 \brief Interface for all transformations. 8 */ 1 9 #ifndef __XIOS_GRID_TRANSFORMATION_HPP__ 2 10 #define __XIOS_GRID_TRANSFORMATION_HPP__ … … 12 20 class CGrid; 13 21 22 /*! 23 \class CGridTransformation 24 This class is an interface for all transformations to interact with the rest of XIOS. 25 The class, firstly, tries to get all information relating to requested transformations by retrieving directly from grid. 26 Then with all these information, all necessary transformations will be be created by generic class \class CGenericAlgorithmTransformation. 27 Because there are information exchange among clients to accomplish the transformations (e.g: some index need retrieving from other clients), 28 this class uses class \class CTransformationMapping to fulfill this demand. 29 For each transformation, a new temporary grid source is created. 30 For a consequential transformations (e.g: inversing -> zoom -> inversing -> ...), 31 the grid destination of current transformation will be grid source of the next transformation 32 */ 14 33 class CGridTransformation 15 34 { … … 38 57 void computeFinalTransformationMapping(); 39 58 void computeTransformationFromOriginalGridSource(const std::map<size_t, std::set<size_t> >& globaIndexMapFromDestToSource); 59 void updateFinalGridDestination(); 40 60 41 61 private: 62 //! Grid source on transformation 42 63 CGrid* gridSource_; 64 65 //! Grid destination on transformation 43 66 CGrid* gridDestination_; 67 68 //! The grid source of the first transformation (original grid source) 44 69 CGrid* originalGridSource_; 45 70 71 //! Grid source dimension size 46 72 std::vector<int> gridSourceDimensionSize_; 73 74 //! Grid destination dimension size 47 75 std::vector<int> gridDestinationDimensionSize_; 48 76 49 77 private: 50 78 typedef std::list<std::pair<int,std::pair<ETranformationType,int> > > ListAlgoType; 79 //! List of algorithm types and their order 80 ListAlgoType listAlgos_; 51 81 52 82 // Mapping between position of an element in grid and its transformation (if any) 53 83 std::list<CGenericAlgorithmTransformation*> algoTransformation_; 54 ListAlgoType listAlgos_; 84 85 //! Mapping of (grid) global index representing tranformation. 55 86 std::map<size_t, std::set<size_t> > globaIndexMapFromDestToSource_; 56 87 88 //! Local index of data to send from grid source 57 89 std::map<int, CArray<int,1>* > localIndexToSendFromGridSource_; 90 91 //! Local index of data to receive on grid destination 58 92 std::map<int, std::vector<CArray<int,1>* > > localIndexToReceiveOnGridDest_; 59 93 94 //! Position of axis and domain in grid 60 95 std::map<int, int> elementPosition2AxisPositionInGrid_, elementPosition2DomainPositionInGrid_; 61 96 97 //! (Grid) Global index of grid source 62 98 CArray<size_t,1>* globalIndexOfCurrentGridSource_; 63 99 CArray<size_t,1>* globalIndexOfOriginalGridSource_; -
XIOS/trunk/src/filter/transformation_mapping.cpp
r622 r623 1 /*! 2 \file transformation_mapping.cpp 3 \author Ha NGUYEN 4 \since 14 May 2015 5 \date 09 June 2015 6 7 \brief Take charge of communication among clients to exchange transformed data. 8 */ 9 1 10 #include "transformation_mapping.hpp" 2 11 #include <boost/unordered_map.hpp> … … 14 23 int clientRank = client->clientRank; 15 24 16 CDistributionClient distributionClient Dest(client->clientRank, gridSource_);25 CDistributionClient distributionClientSrc(client->clientRank, gridSource_); 17 26 18 const CArray<size_t,1>& globalIndexGridSrc = distributionClient Dest.getGlobalDataIndexSendToServer(); //gridSource_->getDistributionClient()->getGlobalDataIndexSendToServer();27 const CArray<size_t,1>& globalIndexGridSrc = distributionClientSrc.getGlobalDataIndexSendToServer(); //gridSource_->getDistributionClient()->getGlobalDataIndexSendToServer(); 19 28 boost::unordered_map<size_t,int> globalIndexOfServer; 20 29 int globalIndexSize = globalIndexGridSrc.numElements(); … … 24 33 } 25 34 35 std::cout << "global index grid src " << globalIndexGridSrc << std::endl; 26 36 gridIndexClientClientMapping_ = new CClientServerMappingDistributed(globalIndexOfServer, 27 37 client->intraComm, … … 151 161 } 152 162 163 /*! 164 Return (grid) global index on grid destination. This mapping contains the rank of client source (that sends info to grid destination) 165 and the corresponding global index to write on grid destination. 166 \return global index mapping to receive on grid destination 167 */ 153 168 const std::map<int,std::vector<std::vector<size_t> > >& CTransformationMapping::getGlobalIndexReceivedOnGridDestMapping() const 154 169 { … … 156 171 } 157 172 173 /*! 174 Return (grid) global index on grid source. This mapping contains the rank of client destination (which receives transformation info) and 175 the corresponding global index to send 176 \return global index mapping to send on grid source 177 */ 158 178 const std::map<int,std::vector<size_t> >& CTransformationMapping::getGlobalIndexSendToGridDestMapping() const 159 179 { -
XIOS/trunk/src/filter/transformation_mapping.hpp
r620 r623 1 /*! 2 \file transformation_mapping.hpp 3 \author Ha NGUYEN 4 \since 14 May 2015 5 \date 09 June 2015 6 7 \brief Take charge of communication among clients to exchange transformed data. 8 */ 1 9 #ifndef __XIOS_TRANSFORMATION_MAPPING_HPP__ 2 10 #define __XIOS_TRANSFORMATION_MAPPING_HPP__ -
XIOS/trunk/src/node/axis.cpp
r622 r623 18 18 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 19 19 , isDistributed_(false) 20 , transformationMap_() 20 , transformationMap_(), global_zoom_begin(0), global_zoom_size(0) 21 21 { 22 22 } … … 26 26 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 27 27 , isDistributed_(false) 28 , transformationMap_() 28 , transformationMap_(), global_zoom_begin(0), global_zoom_size(0) 29 29 { 30 30 } … … 67 67 CAxis* axis = CAxisGroup::get("axis_definition")->createChild(); 68 68 return axis; 69 }70 71 void CAxis::duplicateAttributes(CAxis* axis)72 {73 axis->setAttributes(this);74 69 } 75 70 … … 101 96 else this->ni.setValue(size); 102 97 std::cout << "value " << value << std::endl; 103 StdSize true_size = value.numElements(); 104 if (this->ni.getValue() != true_size) 105 ERROR("CAxis::checkAttributes(void)", 106 << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); 107 98 // StdSize true_size = value.numElements(); 99 // if (this->ni.getValue() != true_size) 100 // ERROR("CAxis::checkAttributes(void)", 101 // << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); 102 103 if (0 == global_zoom_size) global_zoom_size = size; 108 104 this->checkData(); 109 105 this->checkMask(); 110 this->checkZoom();106 // this->checkZoom(); 111 107 112 108 if (!bounds.isEmpty()) … … 281 277 msg << this->getId(); 282 278 msg << ni << begin << end; 279 msg<<global_zoom_begin<<global_zoom_size; 283 280 284 281 event.push(*itRank,1,msg); … … 299 296 void CAxis::recvServerAttribut(CBufferIn& buffer) 300 297 { 301 int zoom_end = zoom_begin.getValue()+zoom_size.getValue()-1; 302 int ni_srv, begin_srv, end_srv; 303 304 buffer>>ni_srv>>begin_srv>>end_srv; 305 306 zoom_begin_srv = zoom_begin.getValue() > begin_srv ? zoom_begin.getValue() : begin_srv; 307 zoom_end_srv = zoom_end < end_srv ? zoom_end : end_srv; 298 int ni_srv, begin_srv, end_srv, global_zoom_begin_tmp, global_zoom_size_tmp; 299 300 buffer>>ni_srv>>begin_srv>>end_srv>>global_zoom_begin_tmp>>global_zoom_size_tmp; 301 global_zoom_begin = global_zoom_begin_tmp; 302 global_zoom_size = global_zoom_size_tmp; 303 int global_zoom_end = global_zoom_begin + global_zoom_size - 1; 304 305 zoom_begin_srv = global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ; 306 zoom_end_srv = global_zoom_end < end_srv ? global_zoom_end : end_srv ; 308 307 zoom_size_srv = zoom_end_srv - zoom_begin_srv + 1; 309 308 … … 315 314 if (size == ni) 316 315 { 317 zoom_begin_srv = zoom_begin.getValue();318 zoom_end_srv = zoom_end;316 zoom_begin_srv = global_zoom_begin; 317 zoom_end_srv = global_zoom_end; //zoom_end; 319 318 zoom_size_srv = zoom_end_srv - zoom_begin_srv + 1; 320 319 } -
XIOS/trunk/src/node/axis.hpp
r622 r623 65 65 /// Accesseurs /// 66 66 const std::set<StdString> & getRelFiles(void) const; 67 void duplicateAttributes(CAxis* axis);68 67 69 68 /// Test /// … … 104 103 int zoom_begin_srv, zoom_end_srv, zoom_size_srv; 105 104 int ni_srv, begin_srv, end_srv; 106 105 int global_zoom_begin, global_zoom_size; // The real global zoom begin and zoom size after axis is transformed (zoomed) 107 106 private : 108 107 void checkData(); -
XIOS/trunk/src/node/field.cpp
r621 r623 551 551 } 552 552 solveGridDomainAxisRef(doSending2Sever); 553 solveCheckMaskIndex(doSending2Sever);554 553 if (context->hasClient) 555 554 { 556 555 solveTransformedGrid(); 557 556 } 557 solveCheckMaskIndex(doSending2Sever); 558 558 } 559 559 … … 784 784 fieldRef->addReference(this); 785 785 fieldRef->solveGridDomainAxisRef(false); 786 fieldRef->solveCheckMaskIndex(false);786 // fieldRef->solveCheckMaskIndex(false); 787 787 break; 788 788 } … … 798 798 fieldRef->addReference(this); 799 799 fieldRef->solveGridDomainAxisRef(false); 800 fieldRef->solveCheckMaskIndex(false);800 // fieldRef->solveCheckMaskIndex(false); 801 801 } 802 802 … … 857 857 CArray<int,1>* localIndex_p = itSend->second; 858 858 int countSize = localIndex_p->numElements(); 859 std::cout << "Data Source " << dataSrc << std::endl; 859 860 for (int idx = 0; idx < countSize; ++idx) 860 861 { … … 887 888 } 888 889 } 890 std::cout << "Data Destination " << dataDest << std::endl; 889 891 } 890 892 -
XIOS/trunk/src/node/grid.cpp
r622 r623 298 298 } 299 299 } 300 301 void CGrid::modifyMask(const CArray<int,1>& indexToModify) 302 { 303 using namespace std; 304 std::vector<CDomain*> domainP = this->getDomains(); 305 std::vector<CAxis*> axisP = this->getAxis(); 306 int dim = domainP.size() * 2 + axisP.size(); 307 308 switch (dim) { 309 case 1: 310 modifyGridMask(mask1, indexToModify); 311 break; 312 case 2: 313 modifyGridMask(mask2, indexToModify); 314 break; 315 case 3: 316 modifyGridMask(mask3, indexToModify); 317 break; 318 319 default: 320 break; 321 } 322 } 323 300 324 //--------------------------------------------------------------- 301 325 … … 850 874 nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv; 851 875 nZoomSize[indexMap[i]] = axisList[axisId]->zoom_size_srv; 852 nZoomBeginGlobal[indexMap[i]] = axisList[axisId]-> zoom_begin;876 nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin; 853 877 nGlob[indexMap[i]] = axisList[axisId]->size; 854 878 ++axisId; … … 1158 1182 transformations_ = new CGridTransformation(transformedGrid, this); 1159 1183 transformations_->computeAll(); 1184 1185 // Ok, now need to compute index of grid source 1186 checkMaskIndex(false); 1160 1187 } 1161 1188 -
XIOS/trunk/src/node/grid.hpp
r622 r623 190 190 bool isTransformed(); 191 191 void setTransformed(); 192 // EElementType getGridElementType();193 //194 // std::vector<ETransformationType> getTransformations();195 // const std::vector<CGenericAlgorithm*>& getTransformationAlgo();196 192 197 193 public: … … 210 206 map<int, CArray<size_t, 1>* > outIndexFromClient; 211 207 void checkMask(void) ; 208 void modifyMask(const CArray<int,1>& indexToModify); 212 209 213 210 private: … … 217 214 const std::vector<CArray<bool,1>* >& axisMasks, 218 215 const CArray<bool,1>& axisDomainOrder); 216 template<int N> 217 void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify); 218 219 219 void setVirtualDomainGroup(CDomainGroup* newVDomainGroup); 220 220 void setVirtualDomainGroup(); … … 366 366 maskIndex += idxLoop[k]*mulDim; 367 367 } 368 *(gridMask.dataFirst()+maskIndex) = maskValue;368 *(gridMask.dataFirst()+maskIndex) &= maskValue; 369 369 370 370 ++idxLoop[0]; … … 374 374 } 375 375 376 /*! 377 Modify the current mask of grid, the local index to be modified will take value false 378 \param [in/out] gridMask current mask of grid 379 \param [in] indexToModify local index to modify 380 */ 381 template<int N> 382 void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify) 383 { 384 bool valueToModify = false; 385 int num = indexToModify.numElements(); 386 for (int idx = 0; idx < num; ++idx) 387 { 388 *(gridMask.dataFirst()+indexToModify(idx)) = valueToModify; 389 } 390 } 376 391 ///-------------------------------------------------------------- 377 392 -
XIOS/trunk/src/node/zoom_axis.cpp
r622 r623 25 25 void CZoomAxis::checkValid(CAxis* axisDest) 26 26 { 27 StdSizeaxisIBegin, axisNi, axisSize;28 StdSizezoom_begin, zoom_end, zoom_size;27 int axisIBegin, axisNi, axisSize; 28 int zoom_begin, zoom_end, zoom_size; 29 29 30 30 axisIBegin = axisDest->ibegin.getValue(); … … 36 36 zoom_end = (this->zoom_end.isEmpty()) ? (axisSize - 1) : this->zoom_end.getValue() ; 37 37 38 if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1 39 if (this->zoom_ end.isEmpty()) zoom_end=zoom_begin+zoom_size-1;40 if (this->zoom_ size.isEmpty()) zoom_size=zoom_end-zoom_begin+1;38 if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1; 39 if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1; 40 if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1; 41 41 42 42 if ((zoom_begin < 0) || (zoom_begin > axisSize-1) || (zoom_end<0) || (zoom_end>axisSize-1) || (zoom_size<1) || (zoom_size>axisSize) || (zoom_begin>zoom_end)) -
XIOS/trunk/src/output/nc4_data_output.cpp
- Property svn:executable set to *
r618 r623 600 600 int zoom_begin_srv = axis->zoom_begin_srv; 601 601 int zoom_size = (MULTI_FILE == SuperClass::type) ? zoom_size_srv : axis->zoom_size; 602 int zoom_begin = (MULTI_FILE == SuperClass::type) ? zoom_begin_srv : axis->zoom_begin; 602 : axis->global_zoom_size; 603 : axis->global_zoom_begin; 603 604 604 605 … … 1361 1362 if (!field->prec.isEmpty() && field->prec==2) fieldData=round(fieldData) ; 1362 1363 1364 std::cout << "fieldData "<< fieldData << std::endl; 1363 1365 switch (SuperClass::type) 1364 1366 { -
XIOS/trunk/src/test/test_new_features.f90
r621 r623 23 23 TYPE(xios_file) :: file_hdl 24 24 LOGICAL :: ok 25 LOGICAL,ALLOCATABLE :: mask_glo(:),mask(:) 25 26 26 27 DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo … … 81 82 82 83 ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj), field_Axis(nAxis), field_All_Axis(1:ni,1:nj,llm), lvaln(nAxis), lval_ni(ni), lval_nj(nj), field_Two_Axis(ni_glo,1:nj)) 84 ALLOCATE(mask(nj)) 85 DO i = 1, nj 86 ! IF (MOD(i,2)>=0) THEN 87 ! mask(i)=.FALSE. 88 ! ELSE 89 mask(i)=.TRUE. 90 ! ENDIF 91 ENDDO 83 92 lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 84 93 lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) … … 99 108 100 109 CALL xios_set_axis_attr("axis_A", size=ni_glo, ibegin=ibegin, ni=ni, value=lval_ni) 101 CALL xios_set_axis_attr("axis_B", size=nj_glo, ibegin=jbegin, ni=nj, value=lval_nj )110 CALL xios_set_axis_attr("axis_B", size=nj_glo, ibegin=jbegin, ni=nj, value=lval_nj, mask=mask) 102 111 CALL xios_set_axis_attr("axis_C", size=llm, value=lval) 103 112 CALL xios_set_axis_attr("axis_D", size=llm, ibegin=axisBegin, ni=nAxis, value=lvaln) -
XIOS/trunk/src/utils.hpp
r584 r623 13 13 14 14 #include <vector> 15 #include <limits> 15 16 #include "array_new.hpp" 16 17 #include "exception.hpp" … … 187 188 } 188 189 }; 190 191 template<typename K> 192 struct NumTraits { 193 typedef K Type; 194 }; 195 196 template<> 197 struct NumTraits<unsigned long> 198 { 199 typedef unsigned long Scalar; 200 typedef Scalar magnitudeType; 201 202 static inline Scalar sfmin() { 203 return std::numeric_limits<Scalar>::min(); 204 } 205 static inline Scalar sfmax() { 206 return std::numeric_limits<Scalar>::max(); 207 } 208 }; 189 209 } 190 210
Note: See TracChangeset
for help on using the changeset viewer.