- Timestamp:
- 11/30/18 17:37:26 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp
r1601 r1619 305 305 CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 306 306 CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 307 CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked); 308 307 309 long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 308 310 309 311 nSrcLocalUnmasked=0 ; 312 bool hasSrcArea=domainSrc_->hasArea && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 313 double srcAreaFactor ; 314 if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ; 315 310 316 for (int idx=0 ; idx < nSrcLocal; idx++) 311 317 { … … 317 323 boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 318 324 } 325 if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ; 319 326 globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 320 327 ++nSrcLocalUnmasked ; 321 328 } 322 329 } 323 330 324 331 325 332 int nDstLocalUnmasked = 0 ; … … 328 335 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 329 336 CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 337 CArray<double,1> areaDstUnmasked(nDstLocalUnmasked); 338 330 339 long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 331 340 332 341 nDstLocalUnmasked=0 ; 342 bool hasDstArea=domainDest_->hasArea && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 343 double dstAreaFactor ; 344 if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ; 333 345 for (int idx=0 ; idx < nDstLocal; idx++) 334 346 { … … 340 352 boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 341 353 } 354 if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ; 342 355 globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 343 356 ++nDstLocalUnmasked ; … … 345 358 } 346 359 347 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 348 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 360 double* ptAreaSrcUnmasked = NULL ; 361 if (hasSrcArea) ptAreaSrcUnmasked=areaSrcUnmasked.dataFirst() ; 362 363 double* ptAreaDstUnmasked = NULL ; 364 if (hasDstArea) ptAreaDstUnmasked=areaDstUnmasked.dataFirst() ; 365 366 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), ptAreaSrcUnmasked, nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 367 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), ptAreaDstUnmasked, nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 349 368 350 369 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity);
Note: See TracChangeset
for help on using the changeset viewer.