Ignore:
Timestamp:
12/21/18 09:19:12 (5 years ago)
Author:
yushan
Message:

working branch @1608 with bug fix @1628

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp

    r1619 r1630  
    305305  CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 
    306306  CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 
    307   CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked); 
    308    
    309307  long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 
    310308 
    311309  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    
    316310  for (int idx=0 ; idx < nSrcLocal; idx++) 
    317311  { 
     
    323317        boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 
    324318      } 
    325       if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ; 
    326319      globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 
    327320      ++nSrcLocalUnmasked ; 
    328321    } 
    329322  } 
    330   
     323 
    331324 
    332325  int nDstLocalUnmasked = 0 ; 
     
    335328  CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 
    336329  CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 
    337   CArray<double,1>   areaDstUnmasked(nDstLocalUnmasked); 
    338  
    339330  long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 
    340331 
    341332  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) ; 
    345333  for (int idx=0 ; idx < nDstLocal; idx++) 
    346334  { 
     
    352340        boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 
    353341      } 
    354       if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ; 
    355342      globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 
    356343      ++nDstLocalUnmasked ; 
     
    358345  } 
    359346 
    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); 
    368349 
    369350  std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); 
Note: See TracChangeset for help on using the changeset viewer.