Changeset 1615
- Timestamp:
- 11/26/18 10:35:26 (6 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/config/domain_attribute.conf
r1553 r1615 58 58 59 59 DECLARE_ARRAY(double, 2, area) 60 DECLARE_ATTRIBUTE(double, radius) 60 61 61 62 DECLARE_ENUM4(type,rectilinear,curvilinear,unstructured, gaussian) -
XIOS/trunk/src/config/interpolate_domain_attribute.conf
r1269 r1615 10 10 DECLARE_ATTRIBUTE(bool, write_weight) 11 11 DECLARE_ENUM2(read_write_convention, c, fortran) 12 DECLARE_ATTRIBUTE(bool, use_area) -
XIOS/trunk/src/context_client.cpp
r1475 r1615 95 95 { 96 96 list<int> ranks = event.getRanks(); 97 97 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<endl ; 98 98 if (CXios::checkEventSync) 99 99 { … … 124 124 { 125 125 event.send(timeLine, sizes, buffList); 126 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<" sent"<<endl ; 126 127 127 128 checkBuffers(ranks); … … 142 143 info(100)<<"DEBUG : temporaly event created : timeline "<<timeLine<<endl ; 143 144 event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers); 145 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<" sent"<<endl ; 144 146 } 145 147 } -
XIOS/trunk/src/node/interpolate_domain.cpp
r1269 r1615 65 65 if (this->read_write_convention.isEmpty()) this->read_write_convention.setValue(read_write_convention_attr::fortran); 66 66 67 67 68 } 68 69 -
XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp
r1542 r1615 304 304 CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 305 305 CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 306 CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked); 307 306 308 long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 307 309 308 310 nSrcLocalUnmasked=0 ; 311 bool hasSrcArea=!domainSrc_->area.isEmpty() && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 312 double srcAreaFactor ; 313 if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ; 314 309 315 for (int idx=0 ; idx < nSrcLocal; idx++) 310 316 { … … 316 322 boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 317 323 } 324 if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->area(idx)*srcAreaFactor ; 318 325 globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 319 326 ++nSrcLocalUnmasked ; 320 327 } 321 328 } 322 329 323 330 324 331 int nDstLocalUnmasked = 0 ; … … 327 334 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 328 335 CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 336 CArray<double,1> areaDstUnmasked(nSrcLocalUnmasked); 337 329 338 long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 330 339 331 340 nDstLocalUnmasked=0 ; 341 bool hasDstArea=!domainDest_->area.isEmpty() && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 342 double dstAreaFactor ; 343 if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ; 332 344 for (int idx=0 ; idx < nDstLocal; idx++) 333 345 { … … 339 351 boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 340 352 } 353 if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->area(idx)*dstAreaFactor ; 341 354 globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 342 355 ++nDstLocalUnmasked ; … … 344 357 } 345 358 346 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 347 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 359 double* ptAreaSrcUnmasked = NULL ; 360 if (hasSrcArea) ptAreaSrcUnmasked=areaSrcUnmasked.dataFirst() ; 361 362 double* ptAreaDstUnmasked = NULL ; 363 if (hasDstArea) ptAreaDstUnmasked=areaDstUnmasked.dataFirst() ; 364 365 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), ptAreaSrcUnmasked, nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 366 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), ptAreaDstUnmasked, nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 348 367 349 368 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); … … 949 968 size_t nbIndex=dataOut.numElements() ; 950 969 951 for (int idx = 0; idx < nbIndex; ++idx) 952 { 953 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 970 if (allMissing.numElements()>0) 971 { 972 for (int idx = 0; idx < nbIndex; ++idx) 973 { 974 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 975 } 954 976 } 955 977
Note: See TracChangeset
for help on using the changeset viewer.