diff --git a/e3sm_diags/driver/utils/regrid.py b/e3sm_diags/driver/utils/regrid.py index ea3c5e00d..f113ac97f 100644 --- a/e3sm_diags/driver/utils/regrid.py +++ b/e3sm_diags/driver/utils/regrid.py @@ -518,6 +518,7 @@ def _hybrid_to_plevs( pressure_grid = xc.create_grid(z=z_axis) pressure_coords = _hybrid_to_pressure(ds, var_key) + # Keep the "axis" and "coordinate" attributes for CF mapping. with xr.set_options(keep_attrs=True): result = ds.regridder.vertical( @@ -528,6 +529,10 @@ def _hybrid_to_plevs( target_data=pressure_coords, ) + # Vertical regriding sets the units to "mb", but the original units + # should be preserved. + result[var_key].attrs["units"] = ds[var_key].units + return result