I’d noticed that different precision. The ESM and CM2 examples both have the “spurious precision” and yet yield different results for @Kim_Reid .
Interestingly if the data is loaded directly the axes are consistent in ordering
In [2]: esm = xr.open_dataset('/g/data/fs38/publications/CMIP6/ScenarioMIP/CSIRO/ACCESS-ESM1-5/ssp245/r1i1p1f1/Amon/hus/gn/v20191115/hus_Amon_ACCESS-ESM1-5_ssp245_r1i1p1f1_gn_201501-210012.nc')
In [3]: cm2 = xr.open_dataset('/g/data/fs38/publications/CMIP6/ScenarioMIP/CSIRO-ARCCSS/ACCESS-CM2/ssp585/r1i1p1f1/Amon/hus/gn/v20210317/hus_Amon_ACCESS-CM2_ssp585_r1i1p1f1_gn_201501-210012.nc')
In [5]: esm.plev
Out[5]:
<xarray.DataArray 'plev' (plev: 19)> Size: 152B
array([100000., 92500., 85000., 70000., 60000., 50000., 40000., 30000.,
25000., 20000., 15000., 10000., 7000., 5000., 3000., 2000.,
1000., 500., 100.])
Coordinates:
* plev (plev) float64 152B 1e+05 9.25e+04 8.5e+04 ... 1e+03 500.0 100.0
Attributes:
bounds: plev_bnds
units: Pa
axis: Z
positive: down
long_name: pressure
standard_name: air_pressure
In [6]: cm2.plev
Out[6]:
<xarray.DataArray 'plev' (plev: 19)> Size: 152B
array([100000., 92500., 85000., 70000., 60000., 50000., 40000., 30000.,
25000., 20000., 15000., 10000., 7000., 5000., 3000., 2000.,
1000., 500., 100.])
Coordinates:
* plev (plev) float64 152B 1e+05 9.25e+04 8.5e+04 ... 1e+03 500.0 100.0
Attributes:
bounds: plev_bnds
units: Pa
axis: Z
positive: down
long_name: pressure
standard_name: air_pressure
In [23]: esm.plev.values[0]
Out[23]: 100000.00000001001
In [24]: cm2.plev.values[0]
Out[24]: 100000.00000001001
So I think the “spurious precision” isn’t involved in the observed difference.
The fact that the ordering of the plev
axis is “correct” (unchanged) when these individual data files is loaded directly by open_dataset
suggests to me that there is something happening in the open_mfdataset
call.
Perhaps one of the files is reversed and open_mfdataset
is doing something to make sure they’re all consistent and in doing so flips the axis ordering.
@Kim_Reid you could try looping through all the files in the example that is flipped and check if there are any files with different ordering of the plev
axis.