I have a netCDF file and was trying to create new variables using python netCDF4. However the program failed to assign values into the array.
Below is my code
import netCDF4
file = netCDF4.Dataset(filename, "r+")
tmp = file.createVariable("tmp", "f4", ('time','height','lat','lon'), zlib=True)
tmp.set_auto_mask(False)
tmp.set_auto_maskandscale(False)
//setting values
tmp[0][0][0][0] = 0.1234
print(tmp[0][0][0][0])
//I got 9.96921e+36, which seems to be the default fill value
What should I do to solve this problem?
Any help would be appreciated.
TIA