-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NF_DEF_VAR_DEFLATE not compiled with netcdf version 4.2.1 #80
Comments
Hi, I have checked the netcdf version 4.1.3 and I find that the NF_DEF_VAR_DEFLATE is a netcdff-77 function. The usage of it is to deflate the variable to a small storage. However, there are two prerequisites to use this function. First, the variable to be deflated must has a netCDF-4 feature. Second, this function can't be used when using parallel I/O for writing data. |
OK - thanks @wanglei5212749. That's good to know. Given that this function compiles OK with later NETCDF versions, do you think those requirements changed between NETCDF versions? |
In my view, most of the climate models use a parallel I/O for writing data. And sometimes we use "--disable-netcdf-4" parameter when compile netcdf to avoid some library conflicts. This means we just build a netCDF-3 library without support for the netCDF-4 formats or functions(see here: https://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html). |
To avoid this error, We have two ways. (1)we can recompile the netcdf library we used to make it support for the netCDF-4 formats or functions(But still not use the parallel I/O for writing data). (2)we just comment this line to avoid the compile-error and this will not cause any difference to the model simulation performance except that it may have a little large disk storage. Also we can just comment the usage of #ifndef use_netCDF3 directly to avoid the compile-error. |
In this condition, I think this problem has little relationship with the version we used, But may be caused by that we don't have the netCDF-4 formats or functions supported. Maybe can be tested by another netcdf library with the netCDF-4 formats or functions supported to see if this compile-error still existed. |
I'm not sure I'm following exactly, but option (1) should be what happens normally, i.e. new netCDF features are supported but not used by default (e.g. for created output files). So maybe this is broken by |
Or under option (2), can you set the flag |
Yes can set a definition for use_netCDF3 instead. |
We'll add a mention of this in the debug docs to help users who run into similar issues. |
When compiling Isca on a machine in China, we used netcdf 4.2.1 but it could not find the
NF_DEF_VAR_DEFLATE
command used here:https://github.com/ExeClim/Isca/blob/master/src/shared/mpp/include/mpp_io_write.inc#L516
By commenting this line out the program compiles fine. Perhaps this is a command that is only present in more recent netcdf installs, and so shouldn't be compiled when using some versions of netcdf 4?
The text was updated successfully, but these errors were encountered: