Ignore:
Timestamp:
10/24/17 11:03:29 (7 years ago)
Author:
ymipsl
Message:

Fix conflict between for domain mask_1d and mask_2d when inheritance is done after transformation. Now class attribute "domainMask" is fill either by mask_1d or mask_2d and will be used instead of mask_1d in code.
This is a temporary fix which will solve later by reconstructing a cleanear grid graph.

YM

Location:
XIOS/dev/XIOS_DEV_CMIP6/src/node
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp

    r1305 r1311  
    10401040      if (!mask_2d.isEmpty()) 
    10411041      { 
    1042         mask_1d.resize(mask_2d.extent(0) * mask_2d.extent(1)); 
     1042        domainMask.resize(mask_2d.extent(0) * mask_2d.extent(1)); 
    10431043        for (int j = 0; j < nj; ++j) 
    1044           for (int i = 0; i < ni; ++i) mask_1d(i+j*ni) = mask_2d(i,j); 
    1045         mask_2d.reset(); 
     1044          for (int i = 0; i < ni; ++i) domainMask(i+j*ni) = mask_2d(i,j); 
     1045//        mask_2d.reset(); 
    10461046      } 
    10471047      else if (mask_1d.isEmpty()) 
    10481048      { 
    1049         mask_1d.resize(i_index.numElements()); 
    1050         for (int i = 0; i < i_index.numElements(); ++i) mask_1d(i) = true; 
     1049        domainMask.resize(i_index.numElements()); 
     1050        for (int i = 0; i < i_index.numElements(); ++i) domainMask(i) = true; 
    10511051      } 
    10521052   } 
     
    11971197         { 
    11981198           ind=i+ni*j ; 
    1199            localMask(ind)=mask_1d(ind) ; 
     1199           localMask(ind)=domainMask(ind) ; 
    12001200         } 
    12011201     } 
     
    21862186        { 
    21872187          idx = static_cast<int>(it->second[n]); 
    2188           list_mask.back()(n) = mask_1d(globalLocalIndexMap_[idx]); 
     2188          list_mask.back()(n) = domainMask(globalLocalIndexMap_[idx]); 
    21892189        } 
    21902190 
     
    26602660    nbMaskInd = globalLocalIndexMap_.size(); 
    26612661    mask_1d.resize(nbMaskInd); 
     2662    domainMask.resize(nbMaskInd); 
    26622663    mask_1d = false; 
    26632664     
     
    26722673          mask_1d(lInd) = tmp(ind); 
    26732674      } 
    2674     }     
     2675    } 
     2676    domainMask=mask_1d ; 
    26752677  } 
    26762678 
     
    30123014         dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);   
    30133015 
    3014          if (!mask_1d(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes     
     3016         if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes     
    30153017         { 
    30163018           dataIIndex(lInd) = dataJIndex(lInd) = -1; 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp

    r1291 r1311  
    142142         CArray<size_t,1> localIndexToWriteOnServer;          
    143143 
    144          CArray<bool, 1> localMask; 
     144         CArray<bool, 1> domainMask; // mask_1d, mask_2d -> domainMask 
     145         CArray<bool, 1> localMask; // domainMask + indexing 
    145146         bool isCurvilinear ; 
    146147         bool hasBounds ; 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.cpp

    r1294 r1311  
    362362 
    363363      std::vector<CArray<bool,1>* > domainMasks(domainP.size()); 
    364       for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->mask_1d); 
     364      for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->domainMask); 
    365365      std::vector<CArray<bool,1>* > axisMasks(axisP.size()); 
    366366      for (int i = 0; i < axisMasks.size(); ++i) axisMasks[i] = &(axisP[i]->mask); 
     
    404404 
    405405      std::vector<CArray<bool,1>* > domainMasks(domainP.size()); 
    406       for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->mask_1d); 
     406      for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->domainMask); 
    407407      std::vector<CArray<bool,1>* > axisMasks(axisP.size()); 
    408408      for (int i = 0; i < axisMasks.size(); ++i) axisMasks[i] = &(axisP[i]->mask); 
     
    17751775                                        const CArray<int,1>& axisDomainOrder) 
    17761776  { 
    1777     globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
     1777 //   globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
     1778    globalDim.resize(domains.size()*2+axis.size()); 
    17781779    int positionDimensionDistributed = 1; 
    17791780    int idx = 0, idxDomain = 0, idxAxis = 0, idxScalar = 0; 
     
    18051806      else 
    18061807      { 
    1807         globalDim[idx] = 1; 
     1808//        globalDim[idx] = 1; 
    18081809        ++idxScalar; 
    1809         ++idx; 
     1810//        ++idx; 
    18101811      } 
    18111812    } 
Note: See TracChangeset for help on using the changeset viewer.