Opened 11 years ago
Last modified 3 years ago
#369 assigned defect
Check units when reading netCDF
Reported by: | Dave Offiler | Owned by: | Ian Culverwell |
---|---|---|---|
Priority: | normal | Milestone: | Whenever |
Component: | ropp_io | Version: | 7.1 |
Keywords: | netCDF, units, check, conversion | Cc: |
Description
The ucar2ropp tool does not check the units attributes of parameters loaded from the UCAR input file, but assumes the units from the UCAR documentation. In some cases, an explicit scaling is done to convert to standard ROPP units (see Ticket #312). This is not robust to any change to the file units by UCAR.
Worse, it appears that even for ROPP netCDF files, there is no unit checking/conversion prior to range-checking (only after, just before writing). Hence a user emulating the ROPP netCDF content, but using non-standard (for ROPP) units could break the range-check.
Without going back to old ROPP version, I suspect that when udunits library was replaced by the ut_convert() system (ROPP-3/4?), the units conversion was moved from 'on read' to 'on write'. A correct solution would be to either unit convert all numeric parameters on read, or perform this task within the range-check routine. At the least, all UCAR netCDF parameter attributes should be read (as they are for ROPP-netCDF) and not assumed, to future-proof against arbitrary unit changes.
While straightforward, a proper treatment across all netCDF I/O tools would not be trivial and would need to be thoroughly tested with special datasets with non-standard units, so is outside the scope for v8.0 - so perhaps should be reviewed for v9.0.
Change history (5)
comment:1 by , 10 years ago
comment:2 by , 8 years ago
Milestone: | 9.0 → 10.0 |
---|
I think we might be able to do something here by means of a 'UCARprof' data structure. We could then set the default units by means of
CALL ropp_fm_set_units(ucar_data)
before something like
CALL ropp_io_read(ucar_data, ifiles(k), rec=i, ranchk=ranchk)
This is what happens in ropp_fm_bg2ro_1d, and that handles automatic unit conversion of ingested data OK. Maybe not. Just logging the idea here for reference.
No time for ROPP9.0, so postponing to ROPP10.0.
comment:3 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 5 years ago
Milestone: | 10.0 → 11.0 |
---|
comment:5 by , 3 years ago
Milestone: | 11.0 → Whenever |
---|
Unlikely anyone will ever have time to do this, so moving to "Whenever".
Suggest to absorb #201 when attending to this ticket.