# Generating netCDF file composed of zeros?

I need to generate an all-zeros file as an input file for an Earth Systems model (DGVM) I'm using. I have a file with the same dimensions as the zero file. I have R and MATLAB and use a Fedora machine.

• matlab has great documentation, have you tried googling? – Communisty Sep 27 '17 at 7:30
• If you can do it in Python, it is very easy by using e.g xarray. – Tactopoda Sep 27 '17 at 10:17
• Also this might be more suitable to another SE cite. – Communisty Sep 27 '17 at 12:08
• If you have a file to begin with, you can open it up and set the variables equal to zero. I suggest NCL, but there are a variety of programs you could use. In general, it's easier to read/write an ncf file rather than creating one from scratch. – farrenthorpe Sep 27 '17 at 14:51
• If you have an example file, just use the NCO tools, which you may well already have installed: e.g., ncap2 -v -s 'zeros=foo*0.0' input.nc output.nc. – Deditos Sep 28 '17 at 11:14