Changeset 2481
- Timestamp:
- 03/23/23 16:22:23 (15 months ago)
- Location:
- XIOS3/trunk/src/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/io/nc4_data_output.cpp
r2479 r2481 1810 1810 try 1811 1811 { 1812 SuperClassWriter::addVariable(fieldid, type, dims );1812 SuperClassWriter::addVariable(fieldid, type, dims, false); 1813 1813 SuperClassWriter::addChunk(field, type, dims); 1814 1814 -
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); -
XIOS3/trunk/src/io/onetcdf4.hpp
r2479 r2481 49 49 int addDimension(const StdString& name, const StdSize size = UNLIMITED_DIM); 50 50 int addVariable(const StdString& name, nc_type type, 51 const std::vector<StdString>& dim, int compressionLevel=0);51 const std::vector<StdString>& dim, bool defineChunking=true); 52 52 int addChunk(CField* field, nc_type type, 53 53 const std::vector<StdString>& dim, int compressionLevel=0);
Note: See TracChangeset
for help on using the changeset viewer.