Changeset 1630 for XIOS/dev/dev_trunk_omp/src/transformation
- Timestamp:
- 12/21/18 09:19:12 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp/src/transformation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp
r1619 r1630 305 305 CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 306 306 CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 307 CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked);308 309 307 long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 310 308 311 309 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 316 310 for (int idx=0 ; idx < nSrcLocal; idx++) 317 311 { … … 323 317 boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 324 318 } 325 if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ;326 319 globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 327 320 ++nSrcLocalUnmasked ; 328 321 } 329 322 } 330 323 331 324 332 325 int nDstLocalUnmasked = 0 ; … … 335 328 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 336 329 CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 337 CArray<double,1> areaDstUnmasked(nDstLocalUnmasked);338 339 330 long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 340 331 341 332 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) ;345 333 for (int idx=0 ; idx < nDstLocal; idx++) 346 334 { … … 352 340 boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 353 341 } 354 if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ;355 342 globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 356 343 ++nDstLocalUnmasked ; … … 358 345 } 359 346 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); 347 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 348 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 368 349 369 350 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_zoom.cpp
r1611 r1630 93 93 domainDest_->ni.setValue(niDest); 94 94 domainDest_->nj.setValue(njDest); 95 if ( (niDest==0) || (njDest==0)) 96 { 97 domainDest_->ibegin.setValue(0); 98 domainDest_->jbegin.setValue(0); 99 } 100 else 101 { 102 domainDest_->ibegin.setValue(ibeginDest); 103 domainDest_->jbegin.setValue(jbeginDest); 104 } 95 domainDest_->ibegin.setValue(ibeginDest); 96 domainDest_->jbegin.setValue(jbeginDest); 105 97 domainDest_->i_index.resize(niDest*njDest); 106 98 domainDest_->j_index.resize(niDest*njDest);
Note: See TracChangeset
for help on using the changeset viewer.