scream icon indicating copy to clipboard operation
scream copied to clipboard

[AD] SCORPIO-Interface: Automatic registration of dimensions as variables

Open AaronDonahue opened this issue 4 years ago • 8 comments

netCDF makes a distinction between dimensions and variables. All variables must be defined as having 1 or more dimensions, as they are registered with a particular netCDF file. In other words, dimensions are registered first, and a variable cannot be registered if it has a dimension unknown to the netCDF file.

In the interface, this is handled via register_dimension and register_variable.

Note, that dimensions don't necessarily need to be written as variables too, however, it makes sense that they would be since that would allow users to understand exactly where/when data exists.

This task is to improve the current infrastructure to automatically add any new dimension as also a variable to be written. Currently, the dimensions themselves need to be included as output fields, which is a bit cumbersome, and also opens the door to a user accidentally not including, say lat/lon, as output variables and getting frustrated when they are not present in the netCDF output file.

Additionally, dimensions should not be dependent on time (except for of course the time dimension). So they should only be written once, right at initialization.

AaronDonahue avatar Dec 08 '20 14:12 AaronDonahue