Ignore:
Timestamp:
11/12/15 16:33:03 (8 years ago)
Author:
mhnguyen
Message:

Reading attributes of curvilinear grid from file

+) Correct some minor bugs detecting type of grid
+) Use constant string for attributes conforming to CF convention
+) Add part of code to read attributes of curvilinear grid

Test
+) On Curie
+) test_remap passes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/io/nc4_data_input.hpp

    r775 r782  
    5050                                        int elementPosition, const StdString& fieldId); 
    5151 
    52     void readFieldVariableValue(CArray<double,1>& var, const StdString& varId, 
     52    template <typename T, int Ndim> 
     53    void readFieldVariableValue(CArray<T, Ndim>& var, const StdString& varId, 
    5354                                const std::vector<StdSize>& nBegin, 
    5455                                const std::vector<StdSize>& nSize, 
     
    6566    bool isCollective; 
    6667  }; // class CNc4DataInput 
     68 
     69template <typename T, int Ndim> 
     70void CNc4DataInput::readFieldVariableValue(CArray<T,Ndim>& var, const StdString& varId, 
     71                                           const std::vector<StdSize>& nBegin, 
     72                                           const std::vector<StdSize>& nSize, 
     73                                           bool forceIndependent) 
     74{ 
     75  if (SuperClass::type==MULTI_FILE || !isCollective) return; 
     76 
     77  bool openCollective = isCollective; 
     78  if (forceIndependent) openCollective = !isCollective; 
     79  switch (SuperClass::type) 
     80  { 
     81    case MULTI_FILE: 
     82      ERROR("CINetCDF4::readFieldVariableValue(...)", 
     83            << "Only support attributes reading with one_file mode"); 
     84      break; 
     85    case ONE_FILE: 
     86    { 
     87      SuperClassWriter::getData(var, varId, openCollective, 0, &nBegin, &nSize); 
     88      break; 
     89    } 
     90  } 
     91} 
    6792} // namespace xios 
    6893 
Note: See TracChangeset for help on using the changeset viewer.