Ignore:
Timestamp:
01/10/18 16:07:16 (6 years ago)
Author:
ymipsl
Message:

Add a method to retrive the local mask of a grid

YM

File:
1 edited

Legend:

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

    r1371 r1397  
    424424   } 
    425425 
     426 
     427/*! 
     428  A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
     429It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
     430One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
     431  \param [in] multi-dimension array grid mask 
     432*/ 
     433 
     434  void CGrid::getLocalMask(CArray<bool,1>& localMask) 
     435  { 
     436      std::vector<CDomain*> domainP = this->getDomains(); 
     437      std::vector<CAxis*> axisP = this->getAxis(); 
     438      int dim = domainP.size() * 2 + axisP.size(); 
     439 
     440      switch (dim) 
     441      { 
     442        case 0: 
     443          getLocalMask(mask_0d, localMask); 
     444          break; 
     445        case 1: 
     446          getLocalMask(mask_1d, localMask); 
     447          break; 
     448        case 2: 
     449          getLocalMask(mask_2d, localMask); 
     450          break; 
     451        case 3: 
     452          getLocalMask(mask_3d, localMask); 
     453          break; 
     454        case 4: 
     455          getLocalMask(mask_4d, localMask); 
     456          break; 
     457        case 5: 
     458          getLocalMask(mask_5d, localMask); 
     459          break; 
     460        case 6: 
     461          getLocalMask(mask_6d, localMask); 
     462          break; 
     463        case 7: 
     464          getLocalMask(mask_7d, localMask); 
     465          break; 
     466        default: 
     467          break; 
     468      } 
     469  } 
     470       
    426471   /* 
    427472     Modify value of mask in a certain index 
Note: See TracChangeset for help on using the changeset viewer.