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

exponential underflows in dEdd shortwave #118

Closed
eclare108213 opened this issue Feb 4, 2018 · 3 comments
Closed

exponential underflows in dEdd shortwave #118

eclare108213 opened this issue Feb 4, 2018 · 3 comments

Comments

@eclare108213
Copy link
Contributor

Some compilers are complaining about underflows in the shortwave calculation. These are coming from exponentials with very small arguments. The current code to get rid of those values does not avoid their being calculated in the first place:

argmax = 10.
exp_min = exp(-argmax)
f = max(exp(-A), exp_min) ! exp(-A) is what we are trying to compute

We should do this instead:

argmax = 10.
exp_min = min(argmax, A)
f = exp(-exp_min)

This type of calculation occurs in 3 places in icepack_shortwave.F90.
I expect this to change the answers (nonBFB).

@apcraig
Copy link
Contributor

apcraig commented Feb 5, 2018

I will take this on as one of my next tasks, after a couple other tasks....

@apcraig
Copy link
Contributor

apcraig commented Feb 5, 2018

I've implemented this on a branch and am testing, PR soon.

@eclare108213
Copy link
Contributor Author

Fixed in PR #127

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

No branches or pull requests

3 participants