-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adapt inversion flux and filter_inversion_output #1502
adapt inversion flux and filter_inversion_output #1502
Conversation
…ng filter_inversion_output in init_hef
I have now undone my changes to So far I managed to fix most of the test, but I would need help with two run_with_hydro tests, where I could not figure out the problem:
Further, some reference graphics need to be updated. I also was wondering if I should also exclude the filter in all other tests which do not use |
@pat-schmitt sorry for changing my mind over and over about this topic, but looking at the cross sections without filter I just think it still makes more sense to use it in the "default" workflow, until COMBINE becomes the default. Would you be willing to continue this PR by adding the filter again in the HEF test case and try it on a few other glaciers with other bedshapes to see that it more or less works as expected? I think that the new default should be to filter the inversion output and use dynamical spinup where appropriate |
Here are five examples of the new filter I propose (not committed right now). The last example just shows that the filter is doing nothing if not necessary. What do you think? Are there other glaciers I should test? Should I also include more test graphics or is HEF enough? For Centerlines: For Elevation bands: |
This looks great! Let's go for it. |
@fmaussion we discussed that I should try to delete the artificial increase of the ice flux at the last grid point (https://github.com/OGGM/oggm/blob/master/oggm/core/inversion.py#L116), now I was wondering if I also should delete the same thing for the tributaries just below (https://github.com/OGGM/oggm/blob/master/oggm/core/inversion.py#L120) or only for the main flowline. |
@pat-schmitt yeah delete there also - better not inventing stuff |
Without the artificial flux increase, you see a small hill at the last grid point (because of zero ice thickness through construction). (If we keep this we should adpte the check for zero thickness from I adapted my filter now and these are the results: (Should I continue adapting the tests again?) |
@pat-schmitt I trust your judgment here. Either put back the flux at 1/10, or maybe (probably better) find a way to make it look better using your idea of prolongating the immediate downstream slope? As a general rule I think the prolongation of the downstream slope to avoid deepenings or bumps is very clever. |
I tested my new idea of the implementation of the inversion flux now (see two examples below). If the terminus is very thin (first row) there is still a small artefact present. However, it looks better at a 'thicker' terminus (second row, right subplots), without the need for an artificial flux. With this, I will now start fixing the tests (the idealized tests passed right away). |
👍 perfect - any artifact at the tongue will have to be addressed with filtering anyway. Thanks! |
I managed to fix all tests besides one (and the graphics). Something with the correction of negative fluxes is not working out in the Besides this: for calving flowlines, I decided to use the old implementation so that the thickness of the last grid point is consistent with the calving parametrization. |
I think it was arbitrary - sometimes the last grid point was negative for numerical reasons, and it will be clipped to zero and I found this not too bad. I think you can take another decision here.
OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed through the code - this looks good I think?
Here I add an adapted version of
filter_inversion_output
.The old implementation always smooths with a parabolic bed shape and overwrites the original cross-section shape. Further no smoothing was conducted if the 'smoothed-parabolic bed shape factor' was smaller than the minimum (
cfg.PARAMS['mixed_min_shape']
).Now the adapted version preserves the cross-section shape. Additionally, if the 'smoothed-parabolic bed shape factor' is smaller than the defined minimum the cross-section shape is changed to a trapezoid (similar to what is done during the inversion with mixed bed shapes).
I opened this PR for discussion and to see which tests need to be adapted.
Further, the old implementation of this function probably causes the problem described in #1360, as the difference in the grid points is 5 grid points, which is the number of grid points which are smoothed and hence forced to a parabolic shape with the old function. And probably depending on the prepro-border the bed shapes of the downstream line are different (which partly decides if the inversion output is smoothed or not). But this needs further investigation.
whats-new.rst