Ignore:
Timestamp:
12/16/14 12:55:53 (9 years ago)
Author:
mhnguyen
Message:

Reorganizing structure of grid

+) Grid doesn't have domain_ref and axis_ref anymore.
All domain and axis of a grid must be inside grid (These domain and axis can be defined or refer to others)
+) Grid contains list of domain and axis
+) Reorder some functions to make sure new functionlities work

Test
+) On Curie
+) Mode attached and detached
+) Only test_new_features
+) Passed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/data_output.cpp

    r501 r540  
    1616      void CDataOutput::writeGrid(CGrid* grid) 
    1717      { 
    18          if (grid->domain_ref.isEmpty()) 
    19             ERROR("CDataOutput::writeGrid(grid)", 
    20                    << " domain is not defined !"); 
    21  
    22          if (grid->axis_ref.isEmpty()) 
    23          { 
    24             this->writeGrid(CDomain::get(grid->domain_ref.getValue())); 
    25          } 
    26          else 
    27          { 
    28             this->writeGrid(CDomain::get(grid->domain_ref.getValue()), 
    29                             CAxis::get(grid->axis_ref.getValue())); 
    30          } 
     18//         if (grid->domain_ref.isEmpty()) 
     19//            ERROR("CDataOutput::writeGrid(grid)", 
     20//                   << " domain is not defined !"); 
     21// 
     22//         if (grid->axis_ref.isEmpty()) 
     23//         { 
     24//            this->writeGrid(CDomain::get(grid->domain_ref.getValue())); 
     25//         } 
     26//         else 
     27//         { 
     28//            this->writeGrid(CDomain::get(grid->domain_ref.getValue()), 
     29//                            CAxis::get(grid->axis_ref.getValue())); 
     30//         } 
     31//        this->writeGrid(grid->domain, grid->axis); 
     32        this->writeGrid(grid->getDomains(), grid->getAxis()); 
    3133      } 
    3234 
     
    6163      } 
    6264 
     65      void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis) 
     66      { 
     67        int domSize = domains.size(); 
     68        int aSize = axis.size(); 
     69        for (int i = 0; i < domSize; ++i) this->writeDomain_(domains[i]); 
     70        for (int i = 0; i < aSize; ++i) this->writeAxis_(axis[i]); 
     71      } 
     72 
    6373      //---------------------------------------------------------------- 
    6474 
     
    7989         CContext* context = CContext::getCurrent() ; 
    8090         boost::shared_ptr<CCalendar> calendar = context->getCalendar(); 
    81           
     91 
    8292         this->writeField_(field); 
    8393         this->writeTimeAxis_(field, calendar); 
     
    90100         this->writeGrid(field->getRelGrid()); 
    91101      } 
    92        
     102 
    93103      //---------------------------------------------------------------- 
    94        
     104 
    95105      void CDataOutput::writeFieldData(CField* field) 
    96106      { 
    97          CGrid* grid = CGrid::get(field->grid_ref.getValue()); 
    98          CDomain* domain = CDomain::get(grid->domain_ref.getValue()); 
     107//         CGrid* grid = CGrid::get(field->grid_ref.getValue()); 
     108//         CDomain* domain = CDomain::get(grid->domain_ref.getValue()); 
    99109         this->writeFieldData_(field); 
    100110      } 
    101        
     111 
    102112      ///---------------------------------------------------------------- 
    103113 
Note: See TracChangeset for help on using the changeset viewer.