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: minor cleanup of diagnostics classes #7053

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bartgol
Copy link
Contributor

@bartgol bartgol commented Feb 22, 2025

  • Ensure the diag field name matches what is used in output yaml files
  • Ensure the diag field name matches the output of the name() method of the class
  • Where possible, remove usage of packs (diags don't have a say in packing of input fields)
  • Prefer using grid's methods for creating layouts

[BFB]


Regarding packs: when a diagnostic is created, the fields in the FieldManager have already been created/allocated. As such, it is incorrect for diagnostics to request a pack size for their input fields, as the fields allocation is done already. The diagnostics could in theory check if the input fields have a pack size large enough or not, but that makes them more complicated.

In practice, it may be possible to just "assume" inputs are available with a Pack data type, since typical EAMxx process do require packed fields. However, I find this hidden assumption dangerous, so I'd rather avoid that. I'd rather settle for diagnostics that are working without packs (for now), and maybe revisit this if/when we get to reorganize how we provide diagnostics, maybe allowing diag fields to be in the FM (for simplicity). If anyone is interested in the issue, ping me, and we can chat offline.

@bartgol bartgol added BFB PR leaves answers BFB EAMxx PRs focused on capabilities for EAMxx labels Feb 22, 2025
@bartgol bartgol self-assigned this Feb 22, 2025
@@ -1314,16 +1314,9 @@ void AtmosphereOutput::set_diagnostics()
{
const auto sim_field_mgr = get_field_manager("sim");
// Create all diagnostics
for (auto& fname : m_fields_names) {
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 mod is the main reason for the changes above: in another PR, where I'm reworking the scorpio_output impl, the fact that we need to be aware that entries in m_fields_names may change when diags are created is a bit annoying. It is also confusing...

@bartgol bartgol force-pushed the bartgol/eamxx/diagnostics-minor-cleanup branch from 6f6d271 to 0af792a Compare February 22, 2025 00:13
@mahf708
Copy link
Contributor

mahf708 commented Feb 22, 2025

Pls explain somewhere the part about packs or i can ask you about it later

@bartgol
Copy link
Contributor Author

bartgol commented Feb 22, 2025

The non-MMF2 fails for v1 are unexpected, and the cprnc output is odd. I am running manually to see what happens.

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

Successfully merging this pull request may close these issues.

2 participants