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

EAMxx: add p3 process rates as outputs #6938

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

Conversation

mahf708
Copy link
Contributor

@mahf708 mahf708 commented Jan 24, 2025

adds p3 process rates as outputs controlled by a runtime flag.

fixes #6936

this impl is kind of hacky because
we don't yet have the facility to
request output fields adhoc
and these fields are buried deep
in the p3 impl; in the future,
this could be edited to be done
more smartly, but for now, this
may be just enough...
@mahf708 mahf708 added the EAMxx PRs focused on capabilities for EAMxx label Jan 24, 2025
@mahf708 mahf708 requested review from bartgol and jgfouca January 24, 2025 15:32
@mahf708 mahf708 changed the title EAMxx: add some extra p3 diags EAMxx: add p3 process rates as outputs Jan 24, 2025
Copy link

PR Preview Action v1.6.0

🚀 View preview at
https://E3SM-Project.github.io/E3SM/pr-preview/pr-6938/

Built to branch gh-pages at 2025-01-24 15:34 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@mahf708
Copy link
Contributor Author

mahf708 commented Jan 24, 2025

@hassanbeydoun + @brhillman, after we get a review from Luca and/or Jim (or other reviewers), you can test this with dpxx or short runs. In the meanwhile, let me know if I missed something that we might as well add while at it?

I expect Luca and Jim to request some edits, because this was a rushed impl. I don't have much time to make this super fancy or complicated, because the p3 source code is pretty convoluted. Actually, dealing with the hardcoded unit tests was probably the most challenging and wasted most of my time. I anticipate we will have to rewrite much of p3 and shoc in the future, because I don't think they're optimal (I'd argue both performance and code readability are much below what I'd think we should have)

I know Cornard is working on a way to make this type of work less painful (i.e., by making adhoc diagnostic requests through the field manager). Once that's ready, we can rewrite this impl. But I wanted to get this out because I know people are interested in scientific analysis/validation around these rates asap.

Comment on lines +372 to +379
// if not, let's just use the buffer for the unused? field
// TODO: check if this is actually okay and doesn't have uintended consequences
// if we are not outputing these fields, we really don't care about their values
// but would this have side effects or memory issues? idk
// TODO: maybe just use more buffer and assign stuff?
history_only.P3_qr2qv_evap = m_buffer.unused;
history_only.P3_qi2qv_sublim = m_buffer.unused;
history_only.P3_qc2qr_accret = m_buffer.unused;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may be stupid as hell, so we might need to add more to the buffer or figure out an alternative

Copy link
Member

@jgfouca jgfouca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. If p3_extra_diags is off, we could just leave the views uninitialized. Then, in p3_main_part2, you could check if P3_qr2qv_evap is a "real" view (initialized and allocated) before doing the sets.

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

Successfully merging this pull request may close these issues.

EAMxx: add p3 rates diags
3 participants