-
Notifications
You must be signed in to change notification settings - Fork 369
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 horizontal average diagnostic field #6788
base: master
Are you sure you want to change the base?
Conversation
|
@mahf708 , thanks for re-issuing this PR on the E3SM side. Quick question, there was this discussion between Peter B. and Andrew (E3SM-Project/scream#2738 (comment)) about the algorithm for the horizontal average that takes into account mass. Any thoughts on whether this could/should be incorporated into this PR? |
This PR is only area-weighted averaging, which is the typical way of doing this as far as I am concerned. I'm happy to hear arguments for including a mass adjustment, but then would the mass adjustment apply to all quantities or specific ones? I'm not sure, but we could easily have another diagnostic such that it is "area-weighted, mass-adjusted" horiz avg |
I thought dp would be more critical for a vertical aggregator |
I typically always neglect mass when doing horizontal averages in DP. Unless @ambrad has a strong opinion about including this I'm fine with keeping it area weighted. |
Yeah. Additionally, I'm not sure if it is realistic or even more accurate? Also, taking into account vertically resolved mass may become nontrivial when it comes to taking averages with unrelated dimensions (say radiation band or if a field has no vertical dimension). These diag impls are supposed to be generic and applicable to any fields (not just fields similar to dp) ... |
@AaronDonahue not to digress the PR convo (maybe we can move to slack), but if there's the need to compute "mass" quantities (e.g., dp*some_tracer), we could add a diagnostic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I have a couple of comments, one for testing, and one for the IO mods.
I consider mass weighting as probably a bit better in the case of a quantity like a tracer. But I don't think it's terribly wrong to neglect it, except in the case that the diagnostic calculation needs to be fully mass accurate (which probably is never needed). |
c6fa3aa
to
3aaf335
Compare
3aaf335
to
6ec6f3f
Compare
@bartgol there are still issues to do with composability with the complex logic of field_at_xyz. I can handle those in a later PR, otherwise the scope of this PR will creep again... Ready for re-review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I have one suggestion, but minor.
@@ -30,10 +30,12 @@ initialize_impl (const RunType /*run_type*/) | |||
using namespace ShortFieldTagsNames; | |||
const auto& fid = f.get_header().get_identifier(); | |||
const auto& layout = fid.get_layout(); | |||
EKAT_REQUIRE_MSG (layout.rank()>1 && layout.rank()<=6, | |||
EKAT_REQUIRE_MSG (layout.rank()>=2 && layout.rank()<=6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be annoying here, but I wanted all three checks to be as close as possible. I will edit these entirely in a future PR, when I address the composability
Adds an online diagnostic field for area-weighted horizontal average, following #6776.
Users are now able to request some_field_horiz_avg in their output files to get an area-weighted horizontal average. The following types of fields are supported: