Skip to content

Do not round 1d LithosphericTemp profile to nearest km (fixes extrapolation error) #174

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mitchellmcm27
Copy link

This change is driven by the fact that, by default, the interp_linear_T function created by linear_interpolation throws when asked to extrapolate without being given an extrapolation method.

The need for extrapolation is due the 1d temperature profile being constructed by rounding min/max depth to the nearest km, sometimes resulting in a slightly smaller depth range than the actual layers in the model.

I think I understand the original impetus for rounding to the nearest km: it is highly likely that the user has input lithosphere thicknesses as a whole-km number, but finite grid spacing means that interfaces get shifted a bit.

However, I think it is more accurate to forego rounding here. Whether my lithosphere ends up being 100km or 99.3km, I want the base and surface of it to initially be certain temperatures in the model.

Removing the rounding removes the possibility of extrapolation and results in a T profile that will be interpolated onto the model slightly more accurately.

Also renamed some of the internal variables for clarity.

Copy link

github-actions bot commented Jun 12, 2025

Your PR no longer requires formatting changes. Thank you for your contribution!

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.

1 participant