Changeset 1634
- Timestamp:
- 01/14/19 10:47:44 (6 years ago)
- Location:
- XIOS/dev/dev_olga/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/config/domain_attribute.conf
r1553 r1634 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/dev/dev_olga/src/config/interpolate_domain_attribute.conf
r1269 r1634 10 10 DECLARE_ATTRIBUTE(bool, write_weight) 11 11 DECLARE_ENUM2(read_write_convention, c, fortran) 12 DECLARE_ATTRIBUTE(bool, use_area) -
XIOS/dev/dev_olga/src/context_client.cpp
r1475 r1634 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/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp
r1612 r1634 311 311 CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 312 312 CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 313 CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked); 314 313 315 long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 314 316 315 317 nSrcLocalUnmasked=0 ; 318 bool hasSrcArea=domainSrc_->hasArea && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 319 double srcAreaFactor ; 320 if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ; 321 316 322 for (int idx=0 ; idx < nSrcLocal; idx++) 317 323 { … … 323 329 boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 324 330 } 331 if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ; 325 332 globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 326 333 ++nSrcLocalUnmasked ; 327 334 } 328 335 } 329 336 330 337 331 338 int nDstLocalUnmasked = 0 ; … … 334 341 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 335 342 CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 343 CArray<double,1> areaDstUnmasked(nDstLocalUnmasked); 344 336 345 long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 337 346 338 347 nDstLocalUnmasked=0 ; 348 bool hasDstArea=domainDest_->hasArea && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 349 double dstAreaFactor ; 350 if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ; 339 351 for (int idx=0 ; idx < nDstLocal; idx++) 340 352 { … … 346 358 boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 347 359 } 360 if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ; 348 361 globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 349 362 ++nDstLocalUnmasked ; … … 351 364 } 352 365 353 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 354 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 366 double* ptAreaSrcUnmasked = NULL ; 367 if (hasSrcArea) ptAreaSrcUnmasked=areaSrcUnmasked.dataFirst() ; 368 369 double* ptAreaDstUnmasked = NULL ; 370 if (hasDstArea) ptAreaDstUnmasked=areaDstUnmasked.dataFirst() ; 371 372 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), ptAreaSrcUnmasked, nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 373 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), ptAreaDstUnmasked, nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 355 374 356 375 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); … … 986 1005 size_t nbIndex=dataOut.numElements() ; 987 1006 988 for (int idx = 0; idx < nbIndex; ++idx) 989 { 990 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 1007 if (allMissing.numElements()>0) 1008 { 1009 for (int idx = 0; idx < nbIndex; ++idx) 1010 { 1011 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 1012 } 991 1013 } 992 1014
Note: See TracChangeset
for help on using the changeset viewer.