[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #SXF-400193]: NetcdfFileWriter's global Attributes



Hi Jin,

thanks for your thorough description.
I think the issue might be you are using a NetcdfDataset for finding the 
variables in the NetcdfFileWriter write method:  
target.write(targetDs.findVariable(varNameA), origin, arrayA);

The NetcdfDataset does not hold an exact copy of the objects (dimensions, 
variables) in the file but it is a sort of shallow copy of those contents and 
adds some enhancements for managing coordinate systems. So, when you create the 
NetcdfDataset the information in the variables needed by the Input Output 
Service Provider (IOSP) for actually writing the variables is lost. 
I think you could try to write the variables in the same way you write the 
dimensions:
target.write(target.findVariable(dimName), array);
and use this:
target.write(target.findVariable(varNameA), origin, arrayA);
instead of: 
target.write(targetDs.findVariable(varNameA), origin, arrayA);

Hope it helps,
Marcos Hermida.

Ticket Details
===================
Ticket ID: SXF-400193
Department: Support netCDF Java
Priority: Normal
Status: Open