Opened 16 years ago
Closed 16 years ago
#356 closed upgrade (Done)
Added capability to process the add_offset attribute in input NetCDF files
Reported by: | arango | Owned by: | arango |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 3.3 |
Component: | Nonlinear | Version: | 3.3 |
Keywords: | Cc: |
Description
Added code in the NetCDF input routines to process the add_offset attribute, if present in an input NetCDF variable. This implies that users need to be careful when including such an attribute in a NetCDF variable.
If the add_offset attribute is present for a variable, its numeric value is added to the data after is read by ROMS I/O interface. In some applications, the add_offset is used to provide simple data compression. Also, it can be used to change units. For example, we can convert temperature from Kelvin to Celsius:
float Tair(time, eta_rho, xi_rho) ; Tair:long_name = "surface air temperature" ; Tair:units = "Celsius" ; Tair:add_offset = -273.16; Tair:time = "time" ;
Here the original data is actually in Kelvin, so a value of -273.16 is added to the data to convert it to Celsius.
Many thanks to Kate Hedstrom for suggesting this capability.