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: Allow to save a dictionary of fields in the FieldManager #6842

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

Conversation

bartgol
Copy link
Contributor

@bartgol bartgol commented Dec 10, 2024

The option (off by default) allows to save a yaml file containing a dictionary of the fields on the "Physics" grid, with some of their details.


As an example, this is a snippet of the file content I get in one of our units tests:

ps:
  layout: [ncol]
  standard_name: surface_air_pressure
  units: Pa
pseudo_density:
  layout: [ncol, lev]
  standard_name: pseudo_density
  units: Pa
pseudo_density_dry:
  layout: [ncol, lev]
  standard_name: pseudo_density_dry
  units: Pa
qc:
  layout: [ncol, lev]
  standard_name: cloud_liquid_water_mixing_ratio
  units: kg/kg

I may want to add something else, so if you have suggestions, fire away. E.g., I want to save the list of atm processes in the EAMxx configuration that generated the yaml file.

@bartgol bartgol added EAMxx PRs focused on capabilities for EAMxx code usability labels Dec 10, 2024
@bartgol bartgol requested a review from AaronDonahue December 10, 2024 00:42
@bartgol bartgol self-assigned this Dec 10, 2024
Copy link

github-actions bot commented Dec 10, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://E3SM-Project.github.io/E3SM/pr-preview/pr-6842/
on branch gh-pages at 2024-12-12 00:44 UTC

@bartgol bartgol changed the title Allow to save a dictionary of fields in the FieldManager EAMxx: Allow to save a dictionary of fields in the FieldManager Dec 10, 2024
@AaronDonahue
Copy link
Contributor

@bartgol This issue lists a number of "wishlist" items for run logging: E3SM-Project/scream#1372 . There might be a few things there that we can add to this PR. We can also move this Issue over to E3SM too.

@bartgol
Copy link
Contributor Author

bartgol commented Dec 10, 2024

@bartgol This issue lists a number of "wishlist" items for run logging: E3SM-Project/scream#1372 . There might be a few things there that we can add to this PR. We can also move this Issue over to E3SM too.

Of all those items, I think the only one that can make sense here is to list the providers/customers of each field. It's not going to tell the user the order in which things happen, but at least it's going to tell the user why the field is in the FM...

@bartgol bartgol force-pushed the bartgol/eamxx/dump-fields-dictionary branch from 0c6eb2b to c2a8078 Compare December 10, 2024 21:09
@bartgol
Copy link
Contributor Author

bartgol commented Dec 10, 2024

@AaronDonahue @mahf708 I changed a bit the formatting:

  • the filename is more descriptive now
  • I added a better description entry for the file
  • I added the run provenance info to the output
  • I added customers/providers for each list

Snippet:

%YAML 1.1
---
description: |
  content of the EAMxx FieldManager corresponding to the 'Physics' grid.
  The dict keys are the field names as used in EAMxx.
  For each field, we add the following entries:
    - standard_name: the name commonly used to refer to this field in atm sciences (if applicable)
    - units: the units for this field used in EAMxx
    - layout: the names of the dimensions for this field (time excluded)
    - providers: the atm processes that update/compute this field
    - customers: the atm processes that require this field as an input
  
fields:
  LW_clnclrsky_flux_dn:
    customers: []
    layout: [ncol, ilev]
    providers: [rrtmgp]
    standard_name: LW_clnclrsky_flux_dn
    units: W/m2
...
  SW_flux_up:
    customers: []
    layout: [ncol, ilev]
    providers: [rrtmgp]
    standard_name: SW_flux_up
    units: W/m2
  T_mid:
    customers: [homme, shoc, p3, rrtmgp]
    layout: [ncol, lev]
    providers: [homme, shoc, p3, rrtmgp]
    standard_name: air_temperature
    units: K
...

I would like to merge an EKAT pr first, update ekat, then merge this, since it would help simplifying the format of the output file (e.g., output inline blah: [a, b] sequences rather than multiline ones).

@mahf708
Copy link
Contributor

mahf708 commented Dec 10, 2024

Looks good!

@bartgol bartgol force-pushed the bartgol/eamxx/dump-fields-dictionary branch from c2a8078 to 1ad10ca Compare December 11, 2024 18:46
@bartgol bartgol force-pushed the bartgol/eamxx/dump-fields-dictionary branch from 058631e to 7eb5d2c Compare December 12, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code usability EAMxx PRs focused on capabilities for EAMxx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants