Closed schlunma closed 1 year ago
Yes, if the dataset needs cmorization before the grid can be read it doesn't work. This should probably be fixed similar to how it is done for vertical levels in the function esmvaltool.preprocessor._regrid.get_reference_levels
.
this needs just the MxN grid dimensionality so a single iris.load(file, constraints=constraint)
where constraint is on the var_name:
constraint = iris.Constraint(
cube_func=(lambda c: c.var_name == VARIABLE))
should do fine, no need to CMORize twice the same file
That would work for this particular case but not in general.
what sort of general case you thinking about @bouweandela
Where the cmorization error is different from containing multiple variables in a single file.
Not an urgent issue, but something I noticed:
Regridding to a reference dataset, e.g.
invokes a simple
iris.load_cube
https://github.com/ESMValGroup/ESMValTool/blob/43598ee48a327fc3ef2a6e53768324d02ad61863/esmvaltool/preprocessor/_regrid.py#L169
on the raw nc file, which may fail in rare cases if the file contains multiple variables (e.g
rsdt
of GFDL-CM3), which leads to errors like this:I think we need an advanced loading function here.