Skip to content

Conversation

@lilianschuster
Copy link
Member

@lilianschuster lilianschuster commented Dec 8, 2025

I found out that glaciers with a longitude of (-res/2,0) or converted a longitude of (360-res/2,360) get assigned the climate from the neighbouring gridpoint, i.e. lon=-res (or lon= 360-res) instead of correctly being assigned to lon=0 . (res = longitudinal resolution)

This happens only for climate datasets that have longitude gridpoints at "zero" (i.e., e.g. ERA5 / ERA5-Land). It is not relevant for W5E5, ISIMIP3b GCMs because they do not have longitude gridpoints at "zero".

This wrong assignment happens for both the gridded and the flattened climate datasets, however to my knowledge, only two glaciers are affected, and these ones are really small, luckily (see picture below):
Bildschirmfoto vom 2025-12-08 14-36-54

I started to do some changes in the code, though much more lines would be affected, and we may need a helper function for that. I also updated the tests, but this behaviour can only be tested indirectly, as we don't have "test_gdirs" for these specific glaciers ...

Some more explanations are in the following test code of this picture
Bildschirmfoto vom 2025-12-08 14-32-22

  • Tests added/passed (only for the flattened files)

  • TODO: find a clean code solution and update all climate selection functions (also those for the GCMs)

Maybe it is best to do this only for OGGM v1.7?

@lilianschuster lilianschuster changed the title found small bug in climate selection for glaciers near 0 longitude small bug in climate selection for glaciers near 0 longitude Dec 8, 2025
@fmaussion
Copy link
Member

Thanks Lily! Yes : open this PR towards /dev, not main oggm, therefore it'll be fixed in the next version

@lilianschuster lilianschuster changed the base branch from master to dev December 8, 2025 16:43
@lilianschuster lilianschuster changed the base branch from dev to master December 8, 2025 16:48
@lilianschuster
Copy link
Member Author

I couldn't repeat the changes directly in the master/dev because the test (test_glacier_gridpoint_selection) is currently different between oggm/master and oggm/dev. I guess it is easier if the person that updated test_glacier_gridpoint_selection in oggm/dev will do the manual checks of how to merge the two versions ...

@fmaussion fmaussion changed the base branch from master to dev December 8, 2025 17:14
@fmaussion fmaussion changed the base branch from dev to master December 8, 2025 17:15
@fmaussion
Copy link
Member

ok no problem well leave this open for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants