Changeset 2481 for XIOS3/trunk/src/io/onetcdf4.cpp
- Timestamp:
- 03/23/23 16:22:23 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/io/onetcdf4.cpp
r2479 r2481 308 308 309 309 int CONetCDF4::addVariable(const StdString& name, nc_type type, 310 const std::vector<StdString>& dim, int compressionLevel)310 const std::vector<StdString>& dim, bool defineChunking) 311 311 { 312 312 int varid = 0; … … 315 315 int dimSize = dim.size(); 316 316 317 StdSize size; 318 317 319 int grpid = this->getCurrentGroup(); 318 320 … … 323 325 const StdString& dimid = *it; 324 326 dimids.push_back(this->getDimension(dimid)); 327 CNetCdfInterface::inqDimLen(grpid, this->getDimension(dimid), size); 328 if (size == NC_UNLIMITED) size = 1; 329 dimsizes.push_back(size); 325 330 } 326 331 327 332 CNetCdfInterface::defVar(grpid, name, type, dimids.size(), &dimids[0], varid); 333 334 if (defineChunking) { 335 int storageType = (0 == dimSize) ? NC_CONTIGUOUS : NC_CHUNKED; 336 CNetCdfInterface::defVarChunking(grpid, varid, storageType, &dimsizes[0]); 337 CNetCdfInterface::defVarFill(grpid, varid, true, NULL); 338 } 339 328 340 329 341 return varid; … … 509 521 ERROR("void CONetCDF4::setCompressionLevel(const StdString& varname, int compressionLevel)", 510 522 "Impossible to use compression for variable \"" << varname << "\" when using parallel mode."); 511 512 523 int grpid = this->getCurrentGroup(); 513 524 int varid = this->getVariable(varname);
Note: See TracChangeset
for help on using the changeset viewer.