Ignore:
Timestamp:
07/01/16 16:55:33 (8 years ago)
Author:
oabramkina
Message:

Sequential version for UGRID norms. File attribute "convention" has been added with two possible values "CF" and "UGRID". The default value is "CF".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/io/onetcdf4.cpp

    r857 r878  
    1313 
    1414      CONetCDF4::CONetCDF4(const StdString& filename, bool append, bool useClassicFormat, 
     15                                                        bool useCFConvention, 
    1516                           const MPI_Comm* comm, bool multifile, const StdString& timeCounterName) 
    1617        : path() 
    1718        , wmpi(false) 
    1819        , useClassicFormat(useClassicFormat) 
    19       { 
    20          this->initialize(filename, append, useClassicFormat, comm, multifile, timeCounterName); 
     20        , useCFConvention(useCFConvention) 
     21      { 
     22         this->initialize(filename, append, useClassicFormat, useCFConvention, comm, multifile, timeCounterName); 
    2123      } 
    2224 
     
    2931      ///-------------------------------------------------------------- 
    3032 
    31       void CONetCDF4::initialize(const StdString& filename, bool append, bool useClassicFormat, 
     33      void CONetCDF4::initialize(const StdString& filename, bool append, bool useClassicFormat, bool useCFConvention,  
    3234                                 const MPI_Comm* comm, bool multifile, const StdString& timeCounterName) 
    3335      { 
    3436         this->useClassicFormat = useClassicFormat; 
     37         this->useCFConvention = useCFConvention; 
    3538 
    3639         int mode = useClassicFormat ? 0 : NC_NETCDF4; 
     
    284287         std::vector<StdSize> dimsizes; 
    285288         int dimSize = dim.size(); 
     289          
    286290         StdSize size; 
    287291         StdSize totalSize; 
     
    292296         std::vector<StdString>::const_iterator it = dim.begin(), end = dim.end(); 
    293297 
    294          for (; it != end; it++) 
     298         for (int idx = 0; it != end; it++, ++idx) 
    295299         { 
    296300            const StdString& dimid = *it; 
     
    314318              if (totalSize >= maxSize) *it = 1; 
    315319            } 
    316  
    317320            int storageType = (0 == dimSize) ? NC_CONTIGUOUS : NC_CHUNKED; 
    318321            CNetCdfInterface::defVarChunking(grpid, varid, storageType, &dimsizes[0]); 
     
    570573      } 
    571574 
     575      bool CONetCDF4::dimExist(const StdString& dimname) 
     576      { 
     577         int grpid = this->getCurrentGroup(); 
     578         return CNetCdfInterface::isDimExisted(grpid, dimname); 
     579      } 
     580 
    572581      void CONetCDF4::sync(void) 
    573582      { 
Note: See TracChangeset for help on using the changeset viewer.