-
Notifications
You must be signed in to change notification settings - Fork 446
EAMxx: upgrade/simplify step tendency calculation in atm procs #7824
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
Conversation
Do not add ALL fields to the restart group. Instead, atm procs should specify what groups the internal fields belong to (if any), and the driver will add to all those groups in the field manager
For both input and output fields. And for both individual and monolithic field (if present).
4f27762 to
f61b705
Compare
- Setup tends as internal fields (they should not be computed by other procs anyways) - Setup tends in atm procs AFTER individual fields/groups have been set in the process by the driver - Allow to compute tend of groups or group fields
f61b705 to
11a1596
Compare
Must also process its own tendencies requests
There are 2 copies of qv, so we must be explicit on which one we want
Do not finalize if it was never inited. Avoids throwing while unwinding stack after uncaught exception
|
00673e8 to
0f7bd84
Compare
|
All failures are expected:
|
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.
Pull Request Overview
This PR refactors the tendencies computation system in EAMxx to simplify the implementation and fix several issues related to field grouping and restart functionality.
- Replaced shortcut notation
[all]with explicit field lists in tendency configuration - Moved tendency setup from
create_grids()tocreate_fields()phase - Enhanced internal field handling to support proper group membership and restart tagging
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
components/eamxx/tests/single-process/shoc/input.yaml |
Updated tendency configuration from [all] shortcut to explicit field list |
components/eamxx/src/share/field/field_group_info.hpp |
Added default initializers for member variables to prevent uninitialized state |
components/eamxx/src/share/data_managers/field_manager.cpp |
Enhanced add_field to handle group info updates and monolithic allocation checks |
components/eamxx/src/share/atm_process/atmosphere_process_group.hpp |
Renamed method from setup_tendencies_requests to setup_step_tendencies |
components/eamxx/src/share/atm_process/atmosphere_process_group.cpp |
Simplified group tendency setup by removing redundant field re-registration logic |
components/eamxx/src/share/atm_process/atmosphere_process.hpp |
Refactored tendency data structures and method signatures for cleaner design |
components/eamxx/src/share/atm_process/atmosphere_process.cpp |
Simplified tendency computation logic and added group support to internal fields |
components/eamxx/src/physics/rrtmgp/eamxx_rrtmgp_process_interface.cpp |
Added guard to prevent finalize errors when initialize was not called |
components/eamxx/src/dynamics/homme/eamxx_homme_process_interface.cpp |
Tagged internal fields with RESTART group and fixed grid name in field access |
components/eamxx/src/control/atmosphere_driver.cpp |
Moved tendency setup after field creation and improved restart group handling |
components/eamxx/cime_config/testdefs/testmods_dirs/eamxx/prod/yaml_outs/eamxx_output.decadal.4hourlyAVG_coarse.yaml |
Added new tendency output field |
components/eamxx/cime_config/testdefs/testmods_dirs/eamxx/prod/shell_commands |
Updated tendency configuration with grid-specific field requests |
components/eamxx/cime_config/namelist_defaults_eamxx.xml |
Updated documentation to clarify groups support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
| $atmchange -b physics::mac_aero_mic::p3::compute_tendencies=T_mid,qv | ||
| $atmchange -b physics::rrtmgp::compute_tendencies=T_mid | ||
| $atmchange -b homme::compute_tendencies=T_mid,qv | ||
| $atmchange -b homme::compute_tendencies=T_mid,qv#physics_pg2,qc#physics_pg2 |
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.
Is this #... the syntax, or a comment? Seems like syntax, but I would think physics pg2 would be default grid.
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.
It is syntax. I can replace with a different character (e.g., qv@physics_pg2), to avoid confusing with a bash comment.
The issue is that homme has 2 copies of qv and qc, one on dyn grid, and one on pg2 grid (actually 3, if we count also the physics_gll grid). When requesting to compute tendencies, we must help atm proc to disambiguate. While pg2 is the "default" grid, the atm proc class has no knowledge about what the default grid is (or even that there is a "default" grid).
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.
Gotcha. I would prefer @ but don't have a strong preference.
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.
is this going to be needed? can we make the physics (pg2) one the default?
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.
As of now, there is no way for an atm proc to know a priori the grids names, or that one name is "the default". Although all procs do communicate via physics grid fields, so I suppose we could assume "physics" is the default. I need to consider whether or not there may be hidden ramifications. If not, I can add it to this PR.
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.
Gotcha. I would prefer
@but don't have a strong preference.
That's my preference too. I almost added a commit changing # to @, but refrained from doing it, thinking about bwd compatibility. Alas, I think nobody is using (or even has used) this feature, so maybe it's still a good time to change notation.
|
@tcclevenger @mahf708 I made the modification you requested. Defaulting to the physics grid was harder than I thought, as the base class has no knowledge of the physics grid, and the actual name of the grid ( |
Requires a bit more work to provide the ACTUAL name of the physics grid to the atm process
b7d91c1 to
669b528
Compare
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.
Pull Request Overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (5)
components/eamxx/src/share/atm_process/atmosphere_process.cpp:935
- Corrected spelling of 'proces' to 'process'.
"Error! Could not locate input field in this atm proces.\n"
components/eamxx/src/share/atm_process/atmosphere_process.cpp:959
- Corrected spelling of 'proces' to 'process'.
"Error! Could not locate input field in this atm proces.\n"
components/eamxx/src/share/atm_process/atmosphere_process.cpp:975
- Corrected spelling of 'proces' to 'process'.
"Error! Could not locate output field in this atm proces.\n"
components/eamxx/src/share/atm_process/atmosphere_process.cpp:999
- Corrected spelling of 'proces' to 'process'.
"Error! Could not locate output field in this atm proces.\n"
components/eamxx/src/share/atm_process/atmosphere_process.cpp:1015
- Corrected spelling of 'proces' to 'process'.
"Error! Could not locate input group in this atm proces.\n"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
components/eamxx/src/dynamics/homme/eamxx_homme_process_interface.cpp
Outdated
Show resolved
Hide resolved
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.
Yeah, this is ok. Also, completely agree on the set_grids name, should be something to do with requesting fields.
Co-authored-by: Copilot <[email protected]>
mahf708
left a comment
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.
Thank you!!!
|
All DIFFs are expected. Merging. |
Allow calculation also of tendency of groups monolithic/individual fields. [BFB] except for newly added var to eamxx-prod output.
Allow calculation also of tendency of groups monolithic/individual fields.
[non-BFB] Only for newly added var to eamxx-prod output.
A few more details: