Skip to content

LLC90 Heat Salt and Mass budgets on native coordinates#25

Merged
hdrake merged 18 commits intohdrake:mainfrom
anthony-meza:llc90_heat_mass_budget
Mar 25, 2026
Merged

LLC90 Heat Salt and Mass budgets on native coordinates#25
hdrake merged 18 commits intohdrake:mainfrom
anthony-meza:llc90_heat_mass_budget

Conversation

@anthony-meza
Copy link
Copy Markdown
Contributor

No description provided.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@anthony-meza anthony-meza marked this pull request as draft March 24, 2026 16:05
@anthony-meza
Copy link
Copy Markdown
Contributor Author

anthony-meza commented Mar 24, 2026

Brief summary @hdrake: I've added ECCO V4r4 support to xbudget!

This required me to add the following source code:
llc90: A folder that contains code to calculate horizontal differences on the LLC90 grid (operations.py) as well as code to process the standard ECCO output from PO.DAAC (budget_diagnostics.py).

collect.py: Added a lateral_divergence operation that currently only calls operations.py since it is currently only needed to operate on the tricky LLC90 grid. I have not written a test for this operation because it only works with the LLC90 grid output. In the future, this particular operation could just use an xgcm operation, but currently, I'm not able to figure out what the problem is.
PS: lateral_divergence could be extended to support other non-LLC90 grids, but it would require repeating a lot of the code found in difference, so for now, I have not added it.
PSS: lateral_divergence is maybe a bit of a misnomer, since it's really only taking differences and not dividing by any sort of length scale.

I've also added an example of how to calculate native budgets in ECCO V4r4 using xbudget. The notebook calls an example ECCO dataset that I've uploaded to Zenodo. I could move budget_diagnostics.py to that repository and do preprocessing there if you think that would be a better home for it.

@anthony-meza anthony-meza marked this pull request as ready for review March 24, 2026 18:14
@hdrake
Copy link
Copy Markdown
Owner

hdrake commented Mar 25, 2026

This is great, @anthony-meza!

In general, I would like to separate model-specific preprocessing of budget terms from the core xbudget functionality.

Can you move llc90/budget_diagnostics.py to examples/eccov4r4_budget_diagnostics.py?

With the understanding that we would indeed eventually like to replace the lateral_divergence operation with something more generic that works for any xgcm.Grid with face_connections, this looks good to me as a placeholder!

@anthony-meza anthony-meza changed the title LLC90 Heat Salt and Mass budgets on native coordiantes LLC90 Heat Salt and Mass budgets on native coordinates Mar 25, 2026
@anthony-meza
Copy link
Copy Markdown
Contributor Author

I agree with your suggestions, this looks a lot better. It should be ready to merge now @hdrake!

@hdrake hdrake merged commit b641573 into hdrake:main Mar 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants