This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Ok,so the following worked. The question is: how does it differ from what you did? The test program: NetcdfDataset infile = NetcdfDataset .openDataset("d:/test.ncml", false, null); File tmpFile = new File("d:/testBlankFile.nc"); FileWriter2 writer = new FileWriter2(infile, tmpFile.getAbsolutePath(), NetcdfFileWriter.Version.netcdf4, null); writer.write(); where test.ncml contained this: <?xml version="1.0" encoding="UTF-8"?> <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"> <attribute name="period" value="10 " type="int"/> </netcdf> This worked and the resulting file contained this: netcdf testBlankFile { // global attributes: :period = 10 ; } =Dennis Heimbigner Unidata Ticket Details =================== Ticket ID: LOO-265831 Department: Support netCDF Java Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.