0

I'm trying to write a Netcdf-4 file from a Dataset model, following this http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/tutorial/NetcdfWriting.html resulting in the following code:

NetcdfDataset model = NcMLReader.readNcML(ncmlStream, null);
Nc4Chunking chunker = Nc4ChunkingStrategy.factory(Strategy.standard, 1, true);
NetcdfFileWriter.Version version = NetcdfFileWriter.Version.netcdf4;
FileWriter2 writer = new FileWriter2(model,OUPTPUT_NETCDF_PATH, version, chunker);
NetcdfFile ncfileOut = writer.write();
model.close();
ncfileOut.close();

But this all it generates is a Permission denied error. With this chunk I was hoping to write the .nc4 file from a filled dataset. I don't know how to write it otherwise. I'm using Netcdf nc_inq_libvers=4.4.1.1

Thanks!

republicca
  • 43
  • 1
  • 8

1 Answers1

0

I was able to fix the code by changing the output file path from: file:/D:/output.nc4 to: D:/output.nc4

So the code from the website works!

republicca
  • 43
  • 1
  • 8