This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Matthew, Sorry for the delay in responding to your question. > I'm wondering if and how I can set the compression level of particular > variables from a CDL? I use the CDL to generate a standard netcdf file then > load the variables with values. So in my code I never make explicit > "createVariable" calls, instead relying on ncgen and reading in the resulting > netCDF from ncgen. Add the special attribute "_DeflateLevel = 1" to a variable that you want using level 1 deflation, and similarly for other deflation levels. The ncgen utility uses the values of this attribute to set the deflation levels in the variables of the output netCDF file. You can also set other related properties of variables in CDL using the special variable attributes "_Chunksizes" and "_Shuffle" to specify the shapes and sizes of chunks for each variable and whether or not the shuffle filter is used before compression. You can see the values of all the special attributes in a file by using the "-s" option to ncdump. Please let us know if you need more information about this. The ncgen man page documentation, installed under shared/man/man1/ncgen.1 has a section on "Special Attributes" that lists all the performance-related special virtual attributes that ncgen respects in input CDL. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: WAZ-695298 Department: Support netCDF Priority: Normal Status: Closed