Skip to content
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

Allow to set Ice temperature in place of Glen A. #72

Closed
fmaussion opened this issue Jun 3, 2022 · 16 comments · Fixed by OGGM/oggm-edu#152
Closed

Allow to set Ice temperature in place of Glen A. #72

fmaussion opened this issue Jun 3, 2022 · 16 comments · Fixed by OGGM/oggm-edu#152

Comments

@fmaussion
Copy link
Member

Heard in a feedback call today.

There is a table of Ice Temps <-> Glen A relationship in Physics of Glaciers that can be used to set ice temp (which is a more sensible variable) instead of A.

@Holmgren825
Copy link
Member

This needs some thinking/discussion I think. Table provides discrete values, which would work. But ideally I think it would be nice to use for example eq. 3.35 (p.72) for continuous values of A for user provided T. However selecting $A_*$ is not trivial from what I understand.

image

For reference table is on p.75.

@fmaussion
Copy link
Member Author

cc @ehultee , @skachuck and @jbassis who suggested that.

@fmaussion
Copy link
Member Author

I think the easiest would be to fit a function to this table and allow user to set any temp between the bounds

@ehultee
Copy link
Member

ehultee commented Jun 8, 2022

In SERMeQ I have a temperature variable and I think it is just a lookup table...the user can only choose certain pre-determined values. A varies nonlinearly over several orders of magnitude, and it's especially weird near common temperate ice values. A continuous function would be easy to use but could produce surprising results.

I'd have to look again at the text, but I'd also guess that we don't have a lot of lab measurements to resolve the shape of the important nonlinearities.

So the question is: how much of that do we want the student user to encounter? It could be quite instructive for students to see sensitivity to (poorly known) temperature, but they would probably need sufficient explanation from an instructor.

@jbassis
Copy link

jbassis commented Jun 8, 2022 via email

@ehultee
Copy link
Member

ehultee commented Jun 8, 2022

@jbassis do you mean Eq. 3.35 on p 72, as Erik suggested above? If so, Erik says it's tough to select A*. Thoughts?

I don't actually have Cuffey and Paterson in front of me 😲 so hard for me to check

@jbassis
Copy link

jbassis commented Jun 8, 2022 via email

@ehultee
Copy link
Member

ehultee commented Jun 8, 2022

@Holmgren825 can you find the calibrated value of A* and use that?

We could if necessary add a little text cell the first time this adjustment is possible in a notebook, explaining key issues as Jeremy outlines above.

IMO it's better to use something that's already in wide use (e.g. C&P's existing functional form), rather than doing an ersatz fit to the table and coming up with slightly different results from what students might find elsewhere. Nuance is great but can be confusing for students who are encountering ice dynamics for the first time.

@fmaussion
Copy link
Member Author

fmaussion commented Jun 8, 2022

I don't talk to people who don't have C&P on their desk, sorry,

(joke)

fwiw that's the table:

image

That would be good enough for me, but if you have a reference implementation of what's " already in wide use" or a link to it we can implement that of course.

@fmaussion
Copy link
Member Author

t = [0, -2, -5, -10, -15, -20, -25, -30, -35, -40, -45, -50]
a = [2.4*1e-24, 1.7*1e-24, 9.3*1e-25, 3.5*1e-25, 2.1*1e-25, 1.2*1e-25, 6.8*1e-26, 3.7*1e-26, 2.0*1e-26, 1.0*1e-26, 5.2*1e-27, 2.6*1e-27]

plt.plot(t, a, 'o-');
plt.semilogy();
plt.ylabel('A'); plt.xlabel('T'); 

@ehultee
Copy link
Member

ehultee commented Jun 8, 2022

By "in wide use" I mean the functional form of A that C&P already give. The equation Erik referenced first. Maybe it's the same as a log-linear fit to the table anyway! Since I'm a van der Veen type, I wouldn't know offhand 😅

@fmaussion
Copy link
Member Author

OK here is the implementation:

t = [0, -2, -5, -10, -15, -20, -25, -30, -35, -40, -45, -50]
a = [2.4*1e-24, 1.7*1e-24, 9.3*1e-25, 3.5*1e-25, 2.1*1e-25, 1.2*1e-25, 6.8*1e-26, 3.7*1e-26, 2.0*1e-26, 1.0*1e-26, 5.2*1e-27, 2.6*1e-27]

a_star = 3.5 * 1e-25
q_plus = 115_000
t_star = 263 + 7*1e-8
q_minus = 60_000
r = 8.314

def cp_glena(t):

    t = t + 273
    t_h = t + 7*1e-8

    if t < t_star:
        q_c = q_minus
    else:
        q_c = q_plus

    return a_star * np.exp(- (q_c / r) * (1 / t_h - 1 / t_star))

a_book = [cp_glena(tmp) for tmp in t]

plt.plot(t, a, 'o-', label='Table');
plt.plot(t, a_book, 'o-', label='Analytic');
plt.semilogy();
plt.ylabel('A'); plt.xlabel('T'); plt.legend();

image

@fmaussion
Copy link
Member Author

(reference A* is given on page 74)

@fmaussion
Copy link
Member Author

(just to be clear: the analytical function is better of course)

@Holmgren825
Copy link
Member

Awesome! To me using the equation makes total sense. If the students can only select from a table of approved temperatures, they might as well enter the value of A directly. I will implement eq 3.35 as Fabi did above.

@jbassis
Copy link

jbassis commented Oct 11, 2022 via email

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 a pull request may close this issue.

4 participants