Remove monotonicity coordinate check for unstructured grids#965
Remove monotonicity coordinate check for unstructured grids#965
Conversation
koldunovn
left a comment
There was a problem hiding this comment.
Thanks a lot for doing this, @jvegasbsc ! Looks good to me. The assumption of the same sized 1d coordinate is not necessary mean unstructured mesh, one can have a setup on regular grid with same number of lons and lats (some crazy regional model), but better to be practical :)
Is not checking is the same size, it is checking is the same dimension in the cube (see https://scitools-iris.readthedocs.io/en/latest/generated/api/iris/cube.html?highlight=coord_dims#iris.cube.Cube.coord_dims) so it should be safer |
Peter9192
left a comment
There was a problem hiding this comment.
Checking in to offload Bouwe. Code make sense to me. Just one suggestion, a question, and a typo.
If you can point me to a nice example cube with unstructured data I could do a more thorough check, but maybe that's not necessary if one of the other reviewers did it.
Cheers! @jvegasbsc
Co-authored-by: Peter Kalverla <peter.kalverla@gmx.com>
You can find the name of the model and variable in the linked issue, it would be great if you could try running a recipe to make sure it really works. |
|
This set of HighRESMIP experiments, for example. Be aware that you may need some extra tags, as I run this in our local copies of the data - {dataset: CESM1-CAM5-SE-HR, project: CMIP6, exp: hist-1950, start_year: 1960, end_year: 2014, ensemble: r1i1p1f1, grid: gn, mip: Amon}
- {dataset: CESM1-CAM5-SE-LR, project: CMIP6, exp: hist-1950, start_year: 1960, end_year: 2014, ensemble: r1i1p1f1, grid: gn, mip: Amon}
- {dataset: CESM1-CAM5-SE-HR, project: CMIP6, exp: highres-future, start_year: 2015, end_year: 2050, ensemble: r1i1p1f1, grid: gn, mip: Amon}
- {dataset: CESM1-CAM5-SE-LR, project: CMIP6, exp: highres-future, start_year: 2015, end_year: 2050, ensemble: r1i1p1f1, grid: gn, mip: Amon } |
Thanks, that seems to work like a charm 👍 Now we just need to make sure that the checks pass. The docs build is fixed here: #964. |
|
Checks work, codacy down. |
|
Seems like Codacy is spitting out another warning. Can you see if this is fixable @jvegasbsc ? |
Thanks, that seems to work like a charm 👍 Now we just need to make sure that the checks pass.
|
Sorry for dismissing your review @Peter9192 , but the check pass and the codacy issue is solved now, and we want this in 2.2 |
No problem! Sorry I didn't get back to it soon enough. |
Description
We currently can not work with unstructured grids because they fail the monotonicity check. This PR fixes this by skipping the check when we detect an unstructured grid, as we do for the irregular ones when
ndimoflatandlonis greather than one.I opted for a fairly easy way to detect those grids: look for
ndim== 1 andlatandlonsharing the same dimensionBefore you get started
Checklist
pre-commitoryamllintchecksIf you make backwards incompatible changes to the recipe format:
To help with the number pull requests: