Ignore:
Timestamp:
06/01/23 10:58:08 (13 months ago)
Author:
ymipsl
Message:

Merging XIOS3_ATTACHED branch into XIOS3 trunk.

YM

Location:
XIOS3/trunk/src/transformation/domain_algorithm
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_extract.cpp

    r2340 r2507  
    7676   domainDestination->bounds_lon_2d.reset(); 
    7777   domainDestination->bounds_lat_2d.reset(); 
    78    domainDestination->area.reset(); 
     78   domainDestination->area_1d.reset(); 
     79   domainDestination->area_2d.reset(); 
    7980   domainDestination->radius.reset(); 
    8081    
     
    175176    } 
    176177  } 
    177   if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 
    178  
     178  if (domainSrc_->hasArea)  
     179  { 
     180    if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest); 
     181    else if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest); 
     182  } 
    179183  // Set attributes required to define domainDestination->localElement_ and associated views, full and workflow) 
    180184  CArray<size_t,1> sourceGlobalIdx = domainSource->getLocalElement()->getGlobalIndex(); 
     
    241245 
    242246      // area 
    243       if (!domainSrc_->area.isEmpty()) 
    244       { 
    245         domainDest_->area(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area(iIdxSrcLocal,jIdxSrcLocal); 
    246       } 
     247      if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area_2d(iIdxSrcLocal,jIdxSrcLocal); 
     248      else if (!domainSrc_->area_1d.isEmpty())  domainDest_->area_1d(countDest) = domainSrc_->area_1d(countSrc); 
    247249 
    248250      // bounds 
  • XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp

    r2270 r2507  
    128128   else if (!domainSource->lonvalue_2d.isEmpty() ) 
    129129   { 
    130      domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.numElements() ); 
    131      domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.numElements() ); 
     130     domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.shape() ); 
     131     domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.shape() ); 
    132132     domainDestination->latvalue_2d = domainSource->latvalue_2d; 
    133133     domainDestination->lonvalue_2d = domainSource->lonvalue_2d; 
     
    145145   else if (!domainSource->bounds_lon_2d.isEmpty() ) 
    146146   { 
    147      domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.numElements() ); 
    148      domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.numElements() ); 
     147     domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.shape() ); 
     148     domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.shape() ); 
    149149     domainDestination->bounds_lon_2d = domainSource->bounds_lon_2d; 
    150150     domainDestination->bounds_lat_2d = domainSource->bounds_lat_2d; 
    151151   } 
    152152   // set area 
    153    if (!domainSource->area.isEmpty() ) 
    154    { 
    155      domainDestination->area.resize( domainSource->area.numElements() ); 
    156      domainDestination->area = domainSource->area;     
    157    } 
     153   if (!domainSource->area_1d.isEmpty() ) 
     154   { 
     155     domainDestination->area_1d.resize( domainSource->area_1d.numElements() ); 
     156     domainDestination->area_1d = domainSource->area_1d;     
     157   } 
     158   else if (!domainSource->area_2d.isEmpty() ) 
     159   { 
     160     domainDestination->area_2d.resize( domainSource->area_2d.shape() ); 
     161     domainDestination->area_2d = domainSource->area_2d;     
     162   } 
     163 
    158164   if (!domainSource->radius.isEmpty() ) 
    159165     domainDestination->radius = domainSource->radius; 
  • XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp

    r2270 r2507  
    173173    } 
    174174  } 
    175   if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 
    176  
     175  if (domainSrc_->hasArea) 
     176  { 
     177    if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest); 
     178    else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest); 
     179  } 
    177180 
    178181  for (int iDest = 0; iDest < niDest; iDest++) 
     
    196199 
    197200      if (domainSrc_->hasArea) 
    198         domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc); 
     201      {   
     202         if (!domainSrc_->area_1d.isEmpty())      domainDest_->area_1d(indLocDest)  = domainSrc_->area_1d(ind); 
     203         else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iDest,jDest) = domainSrc_->area_2d(iSrc,jSrc); 
     204      } 
    199205 
    200206      if (domainSrc_->hasLonLat) 
Note: See TracChangeset for help on using the changeset viewer.