Writing values to netCDF file