Python freezes when writing netCDF in NETCDF4 format, but NETCDF3_CLASSIC format works fine

212 Views Asked by At

I am using Python to save 300x470x27x24 matrices to netcdf files. So far I was using the following code to create file handle:

nc_output = Dataset(nc_filename,'w',format='NETCDF3_CLASSIC')

It works fine, but I would like to save some disk space and use compression. So I changed this line to:

nc_output = Dataset(nc_filename,'w',format='NETCDF4', zlib=True)

However, the script freezes at this point, with no CPU/IO activity. I am using miniconda with python3.8, with the following package versions/build:

bzip2                     1.0.8                h7b6447c_0  
hdf4                      4.2.13               h3ca952b_2  
hdf5                      1.10.4               hb1b8bf9_0  
libnetcdf                 4.7.3                hb80b6cc_0  
netcdf4                   1.5.3            py38hbf33ddf_0  
numpy                     1.19.1           py38hbc911f0_0  
zlib                      1.2.11               h7b6447c_3 

Any ideas what may be the cause of the problem?

0

There are 0 best solutions below