small bug in climate selection for glaciers near 0 longitude#1825
Closed
lilianschuster wants to merge 2 commits intoOGGM:masterfrom
Closed
small bug in climate selection for glaciers near 0 longitude#1825lilianschuster wants to merge 2 commits intoOGGM:masterfrom
lilianschuster wants to merge 2 commits intoOGGM:masterfrom
Conversation
Member
|
Thanks Lily! Yes : open this PR towards /dev, not main oggm, therefore it'll be fixed in the next version |
Member
Author
|
I couldn't repeat the changes directly in the master/dev because the test ( |
Member
|
ok no problem well leave this open for now |
Member
|
is this actually mergeable? Thinking about redoing ERA5 now |
1 task
Member
Author
|
will do this instead in #1843 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):

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

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?