Ignore:
Timestamp:
11/28/18 09:49:20 (6 years ago)
Author:
ymipsl
Message:

Bug fix when using areas for domain interpolation.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r1615 r1617  
    309309 
    310310  nSrcLocalUnmasked=0 ; 
    311   bool hasSrcArea=!domainSrc_->area.isEmpty() && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true  ; 
     311  bool hasSrcArea=domainSrc_->hasArea && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true  ; 
    312312  double srcAreaFactor ; 
    313313  if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ; 
     
    322322        boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 
    323323      } 
    324       if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->area(idx)*srcAreaFactor ; 
     324      if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ; 
    325325      globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 
    326326      ++nSrcLocalUnmasked ; 
     
    334334  CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 
    335335  CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 
    336   CArray<double,1>   areaDstUnmasked(nSrcLocalUnmasked); 
     336  CArray<double,1>   areaDstUnmasked(nDstLocalUnmasked); 
    337337 
    338338  long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 
    339339 
    340340  nDstLocalUnmasked=0 ; 
    341   bool hasDstArea=!domainDest_->area.isEmpty() && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 
     341  bool hasDstArea=domainDest_->hasArea && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ; 
    342342  double dstAreaFactor ; 
    343343  if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ; 
     
    351351        boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 
    352352      } 
    353       if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->area(idx)*dstAreaFactor ; 
     353      if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ; 
    354354      globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 
    355355      ++nDstLocalUnmasked ; 
Note: See TracChangeset for help on using the changeset viewer.