Here grid_2 and grid_3 are subgrids of grid_1 because they define grid_1 as their parent grid.
An alternative approach would be to embody this nesting explicitly in the data structure, but creating a grids element inside grid_1. This would look like:
This nesting can also be implemented in NetCDF4. In the current implementation each grid is represented by a NetCDF4 group which itself can contain other NetCDF4 groups.
Two reasons why this might be preferable:
it avoids the possibility of invalid nesting strictures (eg grid_1 defines grid_2 as its parent, and grid_2 defines grid_1 as its parent)
the storage data structure more directly reflects the grid structure
A hierarchical grid organisation is still an option. In terms of implementation that would most simply be implemented using this approach using the slightly unintuitive approach of putting the most detailed grids earliest in the list, so that the grid to use is always the first grid in the list containing the calculation point. If it has subgrids then those are are tested using the same approach, and so on. The main reason for choosing a hierarchical organisation would probably be to represent complex grid data would be to handle grids that are not strictly nested (for example overlapping grids).
This issue is to consider a possible alternative representation of nested grid structures in GGXF.
The current implementation of GGXF implements grid nesting using parameters in the grid header, ie (in abbreviated form)
Here grid_2 and grid_3 are subgrids of grid_1 because they define grid_1 as their parent grid.
An alternative approach would be to embody this nesting explicitly in the data structure, but creating a grids element inside grid_1. This would look like:
This nesting can also be implemented in NetCDF4. In the current implementation each grid is represented by a NetCDF4 group which itself can contain other NetCDF4 groups.
Two reasons why this might be preferable:
A hierarchical grid organisation is still an option. In terms of implementation that would most simply be implemented using this approach using the slightly unintuitive approach of putting the most detailed grids earliest in the list, so that the grid to use is always the first grid in the list containing the calculation point. If it has subgrids then those are are tested using the same approach, and so on. The main reason for choosing a hierarchical organisation would probably be to represent complex grid data would be to handle grids that are not strictly nested (for example overlapping grids).