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

(*) Remap opacity diagnostic to tanh() #952

Merged
merged 1 commit into from
Jul 20, 2019

Conversation

marshallward
Copy link
Collaborator

This patch remaps the opacity diagnostic to a tanh function, i.e.

op -> 1/L * tanh(op * L)

where L is arbitrarily set to 10^-10 (1 Angstrom). For op << 1/L, the
diagnostic is nearly equivalent to the model opacity. For values
comparable and larger than L, the diagnostic approaches 1/L, a
sufficiently large value to reproduce the effects of a divergent
opacity.

This allows us to safely manipulate and store the opacity while also
avoiding infinite values and floating point overflow.

This change will modify the opacity diagnostic, but should not affect
the dynamic state.

This patch remaps the opacity diagnostic to a tanh function, i.e.

    op -> 1/L * tanh(op * L)

where L is arbitrarily set to 10^-10 (1 Angstrom).  For op << 1/L, the
diagnostic is nearly equivalent to the model opacity.  For values
comparable and larger than L, the diagnostic approaches 1/L, a
sufficiently large value to reproduce the effects of a divergent
opacity.

This allows us to safely manipulate and store the opacity while also
avoiding infinite values and floating point overflow.

This change will modify the opacity diagnostic, but should not affect
the dynamic state.
@marshallward
Copy link
Collaborator Author

@marshallward
Copy link
Collaborator Author

GitLab tests have passed (excepting parameters, which is waiting on an update)

@adcroft adcroft merged commit da6c760 into mom-ocean:dev/gfdl Jul 20, 2019
@marshallward marshallward deleted the tanh_opacity branch September 3, 2019 15:44
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.

2 participants