Open truth-quark opened 2 weeks ago
import iris
pr = iris.load_cube('/g/data/tm70/esm15_testing/sample_output/aiihca.paa1jan', 'rainfall_flux')
print(pr)
rainfall_flux / (kg m-2 s-1) (latitude: 145; longitude: 192)
Dimension coordinates:
latitude x -
longitude - x
Scalar coordinates:
forecast_period 372.0 hours, bound=(0.0, 744.0) hours
forecast_reference_time 0101-01-01 00:00:00
time 0101-01-16 12:00:00, bound=(0101-01-01 00:00:00, 0101-02-01 00:00:00)
Cell methods:
0 time: mean (interval: 1 hour)
Attributes:
STASH m01s05i214
source 'Data from Met Office Unified Model'
um_version '7.3'
The pa
files have monthly mean data (as shown by the time bounds). However iris has given an incorrect cell method (sets 1 hour for any averaging period). Although it would be possible to work out the correct interval from the time bounds, the CMIP6 data specification didn't require it, so it's simplest to just drop the interval.
um2nc
needs to process UM files which include unreliable/incorrect cell methods.Rationale/background: the
iris
library is a generic tool for opening/working with earth science data. As a more general library, it lacks some features to handle complexity within the UM file format. The tool doesn't know how to properly handle cell methods, which are sub-cell pre-processing operations: https://github.com/SciTools/iris/blob/main/lib/iris/coords.py#L2903.um2nc
needs to perform custom formatting to ensure NetCDF data is written out correctly.TODO:
briefly describe what is wrong with the cell methods, relates toiris
incorrectly listing hourly intervals in (some?) files, which is wrong in various cases.TODO:
list the main casesum2nc
needs to handle