The extract_levels preprocessor fails silently when a layer is requested which is shallower than the shallowest point in the ocean z axis, for the schemes nearest and linear. The resulting output is a cube where all points are masked.
Many ocean models first layer is around 1m thick, and the cell centre will be around 0.5m deep. If you use extract_levels to request a layer close to the surface, like 0.1m deep, it will produce a fully masked cube silently.
ie:
extract_levels:
scheme: nearest
levels: [0.1 ,]
The solution to this problem exists already (yay!), we need to use the scheme nearest_extrapolate or linear_extrapolate, but some kind of warning or error would be useful. This information may exist in the documentation, but a clear error message is worth ten pages of documentation.
The check would be to look whether any of the depth values in the input list fall outside the min/max z range given by the model. The output message would be something like: "It looks like this depth level is output the depth cell centres. Please use the nearest_extrapolate or linear_extrapolate schemes. "
Alternatively, perhaps we also fix the “nearest” calculation so that it looks at the lat/lon/depth boundaries? @schlunma and @valeriupredoi think this is harder to do though.
Note that this problem may also occur in the atmosphere or at the sea floor, but I haven't checked.
The
extract_levels
preprocessor fails silently when a layer is requested which is shallower than the shallowest point in the ocean z axis, for the schemesnearest
andlinear
. The resulting output is a cube where all points are masked.Many ocean models first layer is around 1m thick, and the cell centre will be around 0.5m deep. If you use
extract_levels
to request a layer close to the surface, like 0.1m deep, it will produce a fully masked cube silently.ie:
The solution to this problem exists already (yay!), we need to use the scheme
nearest_extrapolate
orlinear_extrapolate
, but some kind of warning or error would be useful. This information may exist in the documentation, but a clear error message is worth ten pages of documentation.The check would be to look whether any of the depth values in the input list fall outside the min/max z range given by the model. The output message would be something like: "It looks like this depth level is output the depth cell centres. Please use the
nearest_extrapolate
orlinear_extrapolate
schemes. "Alternatively, perhaps we also fix the “nearest” calculation so that it looks at the lat/lon/depth boundaries? @schlunma and @valeriupredoi think this is harder to do though.
Note that this problem may also occur in the atmosphere or at the sea floor, but I haven't checked.